Question

Failing in enqueuing a job to Sidekiq due to InvalidURIError

I am in process of deploying a Rails 7 (Hotwire enabled) application using App Platform. This is my first time with both, Rails 7 and App Platform. Now when I am trying to delete a resource having active storage attachment I am getting following error in the logs:

[ActiveJob] Failed enqueuing ActiveStorage::PurgeJob to Sidekiq(xx_yyy_zzzz): URI::InvalidURIError (bad URI(is not URI?): "rediss://default:XYZxyzXYZ@xx-yy-zz-aa-bb-cc.b.db.ondigitalocean.com:12345}")

(Obfuscated the URI here)

I am using a managed Redis DB as a component, and referring to it in the web service component using REDIS_URL environment variable.

I am stuck at this problem from quite a long time, any help would be appreciated.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

It sounds like Rails does not like the ${REDIS_URL} format.

What I could suggest is to use the ${DATABASE_URL} environment variable so that you could then build your Redis connection string to match the required Rails format rather than using the ${REDIS_URL} env var directly.

Hope that this helps!

Best,

Bobby