Errno::ENOENT happened in: Events::TalksController#index
[Incident: #435] Errno::ENOENT happened in: Events::TalksController#index
Message
No such file or directory @ rb_check_realpath_internal - /rails/data/ruby-midwest/ruby-midwest-2015/videos.yml
Backtrace (up to last 10 lines)
bootsnap (1.18.6) lib/bootsnap/compile_cache/yaml.rb:234:in 'File.realpath'
bootsnap (1.18.6) lib/bootsnap/compile_cache/yaml.rb:234:in 'Bootsnap::CompileCache::YAML::Psych4::Patch#load_file'
app/models/event.rb:116:in 'Event#videos_file'
app/models/event.rb:121:in 'Event#video_ids_in_running_order'
app/models/event.rb:64:in 'Event#talks_in_running_order'
app/controllers/events/talks_controller.rb:8:in 'Events::TalksController#index'
rails (4f595868f95c) actionpack/lib/action_controller/metal/basic_implicit_render.rb:8:in 'ActionController::BasicImplicitRender#send_action'
rails (4f595868f95c) actionpack/lib/abstract_controller/base.rb:223:in 'AbstractController::Base#process_action'
rails (4f595868f95c) actionpack/lib/action_controller/metal/rendering.rb:199:in 'ActionController::Rendering#process_action'
rails (4f595868f95c) actionpack/lib/abstract_controller/callbacks.rb:261:in 'block in AbstractController::Callbacks#process_action'
View on AppSignal: https://appsignal.com/rubyvideo/sites/648c9414d2a5e4567617aaf0/exceptions/incidents/435?id=last
I can reproduce this error by deleting the YAML file from the data folder
But it is weird if it happensinn production
If this issue occurs, should we trigger an alert in AppSignal & redirect the user to the events page?
Maybe we can add a File.exists? check in all the places we are doing a File.read for the videos.yml file to prevent this?
Yea it could be done for prevention. But, do you know what the possible root cause is?
The videos.yml file is static, but how come it becomes missing in the production environment?
Based on the AppSignal report, the request was expecting an unknown path. In the master/main branch, the data/ruby-midwest/ruby-midwest-2015/videos.yml file does not exist. I guess someone has added a record in the Event model through the Rails console in prod with slug = ruby-midwest-2015.
The error still exists in prod when you visit https://www.rubyevents.org/events/ruby-midwest-2015 and navigate to the talks tab
The 2015 event does not exist here. Is it ok if an event doesn't have any talks/videos?
I want to make a PR to redirect the user to the root page if an event has no talks. What do you think?
they are more samples of this error in prod now