Rails - Image not showing on trix editor when I deploy the app here on Fly.io but it is working locally.

Hi here,

Posting here as someone might be able to help me as image is not showing on trix_edtior. You can check here the issue https://danrayrollan.com/projects/integrating-user-verification-api-using-unity-engine-to-validate-oculus-meta-user

I am getting error

but when I am editing the post, the image is returning the value and I can view the image on edit.

but locally, this is working. I’m not sure why this is happening though.

I already set the storage.yml
production:
service: Disk
root: <%= Rails.root.join(“/data”) %>

and on production.rb
config.active_storage.service = :production

Thanks.

A stack traceback would be helpful here. Either:

  • Run flyctl logs in one window and then try to display the image again.
  • Go to your dashboard (flyctl dashboard will get you there) and select “Monitoring” on the left hand side

Hi, Thank you for your response.

2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] bootsnap (1.13.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] zeitwerk (2.6.6) lib/zeitwerk/kernel.rb:38:in require’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] image_processing (1.12.2) lib/image_processing/vips.rb:1:in <main>' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] bootsnap (1.13.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] bootsnap (1.13.0) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in require' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] zeitwerk (2.6.6) lib/zeitwerk/kernel.rb:38:in require’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/transformers/image_processing_transformer.rb:29:in const_get' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/transformers/image_processing_transformer.rb:29:in processor’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/transformers/image_processing_transformer.rb:20:in process' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/transformers/transformer.rb:22:in transform’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/variation.rb:56:in block in transform' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/notifications.rb:208:in instrument’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/variation.rb:55:in transform' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/variant_with_record.rb:35:in block in transform_blob’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/downloader.rb:15:in block in open' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/downloader.rb:24:in open_tempfile’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/downloader.rb:12:in open' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) lib/active_storage/service.rb:90:in open’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/blob.rb:301:in open' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/variant_with_record.rb:34:in transform_blob’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/variant_with_record.rb:19:in process' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/models/active_storage/variant_with_record.rb:14:in processed’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activestorage (7.0.4) app/controllers/active_storage/representations/base_controller.rb:14:in set_representation' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:400:in block in make_lambda’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info]74-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/tempfile_reaper.rb:15:in call' [34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) l 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/abstract_controller/callbacks.rb:34:in block (2 levels) in module:Callbacks
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:200:in block in halting' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:595:in block in invoke_before’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:595:in each' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:595:in invoke_before’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:116:in block in run_callbacks' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actiontext (7.0.4) lib/action_text/rendering.rb:20:in with_renderer’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actiontext (7.0.4) lib/action_text/engine.rb:69:in block (4 levels) in <class:Engine>' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:127:in instance_exec’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:127:in block in run_callbacks' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:138:in run_callbacks’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/abstract_controller/callbacks.rb:233:in process_action' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_controller/metal/rescue.rb:22:in process_action’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_controller/metal/instrumentation.rb:67:in block in process_action' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/notifications.rb:206:in block in instrument’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/notifications/instrumenter.rb:24:in instrument' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/notifications.rb:206:in instrument’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_controller/metal/instrumentation.rb:66:in process_action' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_controller/metal/params_wrapper.rb:259:in process_action’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activerecord (7.0.4) lib/active_record/railties/controller_runtime.rb:27:in process_action' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/abstract_controller/base.rb:151:in process’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionview (7.0.4) lib/action_view/rendering.rb:39:in process' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_controller/metal.rb:188:in dispatch’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_controller/metal.rb:251:in dispatch' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/routing/route_set.rb:49:in dispatch’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/routing/route_set.rb:32:in serve' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/journey/router.rb:50:in block in serve’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/journey/router.rb:32:in each' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/journey/router.rb:32:in serve’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/routing/route_set.rb:852:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] bullet (7.0.3) lib/bullet/rack.rb:12:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] warden (1.2.9) lib/warden/manager.rb:36:in block in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] warden (1.2.9) lib/warden/manager.rb:34:in catch’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] warden (1.2.9) lib/warden/manager.rb:34:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/tempfile_reaper.rb:15:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) l
2022-12-17T04:34:10Z app[c41fbdaf] sin [info]b/rack/etag.rb:27:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/conditional_get.rb:27:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/head.rb:12:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/http/permissions_policy.rb:38:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/http/content_security_policy.rb:36:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/session/abstract/id.rb:266:in context’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/session/abstract/id.rb:260:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/cookies.rb:696:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/callbacks.rb:27:in block in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/callbacks.rb:99:in run_callbacks’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/callbacks.rb:26:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/debug_exceptions.rb:28:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/show_exceptions.rb:26:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] railties (7.0.4) lib/rails/rack/logger.rb:40:in call_app’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] railties (7.0.4) lib/rails/rack/logger.rb:25:in block in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/tagged_logging.rb:99:in block in tagged’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/tagged_logging.rb:37:in tagged' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] activesupport (7.0.4) lib/active_support/tagged_logging.rb:99:in tagged’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] railties (7.0.4) lib/rails/rack/logger.rb:25:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/remote_ip.rb:93:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/request_id.rb:26:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/method_override.rb:24:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/runtime.rb:22:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/executor.rb:14:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/static.rb:23:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack (2.2.4) lib/rack/sendfile.rb:110:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] actionpack (7.0.4) lib/action_dispatch/middleware/host_authorization.rb:131:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] rack-cors (1.1.1) lib/rack/cors.rb:100:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] railties (7.0.4) lib/rails/engine.rb:530:in call' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] puma (5.6.5) lib/puma/configuration.rb:252:in call’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] puma (5.6.5) lib/puma/request.rb:77:in block in handle_request' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] puma (5.6.5) lib/puma/thread_pool.rb:340:in with_force_shutdown’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] puma (5.6.5) lib/puma/request.rb:76:in handle_request' 2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] puma (5.6.5) lib/puma/server.rb:443:in process_client’
2022-12-17T04:34:10Z app[c41fbdaf] sin [info][34f4020e-446a-4374-be5f-4e8e4318d87c] puma (5.6.5) lib/puma/thread_pool.rb:147:in `block in spawn_thread’
2022-12-17T04:34:11Z app[c41fbdaf] sin [info]I, [2022-12-17T04:34:11.498538 #540] INFO – : [96764597-8268-4010-ac50-19f61b090367] Started GET “/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkbU15YURjM2NIazViMkoxT0hreGJEbHJZMkoyYjIwd2NtZGpkQVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpVzJsdWJHbHVaVHNnWm1sc1pXNWhiV1U5SW5abGNtbG1hV05oZEdsdmJpMWpiM1psY2kxcGJXRm5aU0k3SUdacGJHVnVZVzFsS2oxVlZFWXRPQ2NuZG1WeWFXWnBZMkYwYVc5dUxXTnZkbVZ5TFdsdFlXZGxCanNHVkRvUlkyOXVkR1Z1ZEY5MGVYQmxTU0lPYVcxaFoyVXZjRzVuQmpzR1ZEb1JjMlZ5ZG1salpWOXVZVzFsT2c5d2NtOWtkV04wYVc5dSIsImV4cCI6IjIwMjItMTItMTdUMDQ6Mzk6MTAuODA4WiIsInB1ciI6ImJsb2Jfa2V5In19–364238ae5ba6213d183e636e1e9461daae3300bd/verification-cover-image” for 149.248.196.228 at 2022-12-17 04:34:11 +0000
2022-12-17T04:34:11Z app[c41fbdaf] sin [info]I, [2022-12-17T04:34:11.499809 #540] INFO – : [96764597-8268-4010-ac50-19f61b090367] Processing by ActiveStorage::DiskController#show as HTML
2022-12-17T04:34:11Z app[c41fbdaf] sin [info]I, [2022-12-17T04:34:11.499841 #540] INFO – : [96764597-8268-4010-ac50-19f61b090367] Parameters: {“encoded_key”=>“[FILTERED]”, “filename”=>“verification-cover-image”}
2022-12-17T04:34:11Z app[c41fbdaf] sin [info]I, [2022-12-17T04:34:11.500240 #540] INFO – : [96764597-8268-4010-ac50-19f61b090367] Completed 200 OK in 0ms (ActiveRecord: 0.0ms | Allocations: 136)

Here is the logs result.

Rails does give long stack tracebacks. Enough so that the line I really want to see is before that line. However, I’ve seen enough to make an educated guess. If you have uncommented out image_processing in your Gemfile you will need to add libvips42 to the line that starts with ARG DEPLOY_PACKAGES.

@rubys, Thank you, your recommendation works. You rock!