codevise / pageflow

Multimedia story telling for the web.
http://pageflow.io
MIT License
688 stars 125 forks source link

Error while starting Editor #2107

Closed rbrenner-snoop closed 2 months ago

rbrenner-snoop commented 2 months ago

Hey Pageflow Team,

sorry to bother you again, but since we updated our Staging System with a lot of your help, i know started to update the live system.

After i transferred everything and tested the pageflow 16 installation before installing Pageflow Next i stumbled over another Issue that i did not encounter before.

For some entries, and i could not identify the similarities of these entries yet, i get an alert saying Error while starting Editor.

The Logs say the following:

I, [2024-05-23T15:36:21.844739 #1153163]  INFO -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0]   Rendered /home/pageflow/.rbenv/versions/2.5.9/lib/ruby/gems/2.5.0/gems/pageflow-16.0.0/app/views/pageflow/editor/entries/seed.json.erb (450.0ms)
I, [2024-05-23T15:36:21.844938 #1153163]  INFO -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0] Completed 500 Internal Server Error in 462ms (ActiveRecord: 36.2ms)
F, [2024-05-23T15:36:21.847092 #1153163] FATAL -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0]
F, [2024-05-23T15:36:21.847144 #1153163] FATAL -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0] ActionView::Template::Error (unknown keywords: permitted_classes, aliases):
F, [2024-05-23T15:36:21.847258 #1153163] FATAL -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0]     1: json.call(color_map_file, :width, :height, :sprite_url)
[1e604785-0faf-47d0-a5e9-e5afbac836a0]     2:
[1e604785-0faf-47d0-a5e9-e5afbac836a0]     3: json.components do
[1e604785-0faf-47d0-a5e9-e5afbac836a0]     4:   color_map_file.present_colors.inject(0) do |sprite_offset, color|
[1e604785-0faf-47d0-a5e9-e5afbac836a0]     5:     bounding_box = color_map_file.bounding_box_for_color(color)
[1e604785-0faf-47d0-a5e9-e5afbac836a0]     6:
[1e604785-0faf-47d0-a5e9-e5afbac836a0]     7:     json.set!(color) do
F, [2024-05-23T15:36:21.847282 #1153163] FATAL -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0]
F, [2024-05-23T15:36:21.847334 #1153163] FATAL -- : [1e604785-0faf-47d0-a5e9-e5afbac836a0] /home/pageflow/.rbenv/versions/2.5.9/lib/ruby/2.5.0/psych.rb:313:in `safe_load'

I would really appreciate your help one more time. For now i try to find the similarities in the entries which crash with this error.

Thanks in advance and best regards Ronald

rbrenner-snoop commented 2 months ago

Hey, i could resolve this issue by separately installing the psych gem with version constraint ~> 3.1 as described here https://github.com/rails/rails/issues/45590 This is the result of my old Ruby version which ships with an older psych version.

Now i get another error in the same step which is most likely again the result of a dependency problem:

F, [2024-05-24T09:59:53.615056 #1194743] FATAL -- : [8d9ef4b8-8128-4646-b4e9-45495a9f6613] ActionView::Template::Error (Tried to load unspecified class: Symbol):
F, [2024-05-24T09:59:53.615187 #1194743] FATAL -- : [8d9ef4b8-8128-4646-b4e9-45495a9f6613]     1: json.call(color_map_file, :width, :height, :sprite_url)
[8d9ef4b8-8128-4646-b4e9-45495a9f6613]     2:
[8d9ef4b8-8128-4646-b4e9-45495a9f6613]     3: json.components do
[8d9ef4b8-8128-4646-b4e9-45495a9f6613]     4:   color_map_file.present_colors.inject(0) do |sprite_offset, color|
[8d9ef4b8-8128-4646-b4e9-45495a9f6613]     5:     bounding_box = color_map_file.bounding_box_for_color(color)
[8d9ef4b8-8128-4646-b4e9-45495a9f6613]     6:
[8d9ef4b8-8128-4646-b4e9-45495a9f6613]     7:     json.set!(color) do
F, [2024-05-24T09:59:53.615224 #1194743] FATAL -- : [8d9ef4b8-8128-4646-b4e9-45495a9f6613]
F, [2024-05-24T09:59:53.615241 #1194743] FATAL -- : [8d9ef4b8-8128-4646-b4e9-45495a9f6613] (eval):2:in `symbol'

Im looking into it. If you got a hint im very thankful to any kind of help.

Thanks and best regards Ronald

rbrenner-snoop commented 2 months ago

i could resolve this error by adding a configuration to the application.rb config.active_record.yaml_column_permitted_classes = [Symbol] as of this StackOverflow answer: https://stackoverflow.com/a/72970171/15399425

But now i find the next Problem. Since these are all dependency Issues when it comes to Pageflow 16 running in an Environment like mine (Ruby 2.5.9; Rails 5.2.8.1) i continue documenting these Issues here if someone stumbles upon this in the future.

Current Error is thrown on opening Preview or Live Site (for some but not all entries):

F, [2024-05-24T12:25:47.156780 #1202300] FATAL -- : [cd9c9032-9529-4aa6-8180-bf0b8530a7fa]     1: <% if page.template.present? %>
[cd9c9032-9529-4aa6-8180-bf0b8530a7fa]     2:   <% concat render_page_react_component(entry, page, 'pageflow.react.ServerSidePage') %>
[cd9c9032-9529-4aa6-8180-bf0b8530a7fa]     3: <% end %>
F, [2024-05-24T12:25:47.156814 #1202300] FATAL -- : [cd9c9032-9529-4aa6-8180-bf0b8530a7fa]
F, [2024-05-24T12:25:47.156933 #1202300] FATAL -- : [cd9c9032-9529-4aa6-8180-bf0b8530a7fa] react-rails (2.6.0) lib/react/server_rendering/exec_js_renderer.rb:22:in `rescue in render'
rbrenner-snoop commented 2 months ago

The last error was a really stupid mistake by me. I simply forgot do add some components in app/assets/javascripts/components.js

These were the following:

//= require "pageflow/timeline_page/components"
//= require "pageflow/parent_page_box/components"

since i have not found this error documented anywhere i would leave it here.

rbrenner-snoop commented 2 months ago

There were no further problems. Therefore i'll close this issue.

tf commented 2 months ago

Hi Ronald,

due to vacation during the past weeks, I've only read your messages now. Happy to hear, you were able to resolve the issues. I think it's helpful to have these things documented in the issue tracker. If certain issues should come up again in different contexts, we can definitely consider adding some of these points to the main troubleshooting page. Since the current Pageflow version already uses Rails 7, I'm not sure the same problems still occur there. So for now, having things documented here works well for me.

All the best Tim