Report this

What is the reason for this report?

Failing in enqueuing a job to Sidekiq due to InvalidURIError

Posted on April 2, 2022

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.



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!

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.