ENV["RAILS_RELATIVE_URL_ROOT"] is not set for Sidekiq
This came from gitlab-org/gitlab-ce#26539. Unicorn sets ENV["RAILS_RELATIVE_URL_ROOT"]
here, but Sidekiq doesn't get this setting so notification e-mails (e.g. ones that use image_url
) don't have the proper relative URLs:
- https://github.com/rails/rails/issues/3365
- https://github.com/rails/rails/commit/5266eb9f611a114663c48eec0680b7050181d3de
For example, assuming your relative URL path is /gitlab
, you can temporarily fix this by doing:
sudo echo "/gitlab" > /opt/gitlab/etc/gitlab-rails/env/RAILS_RELATIVE_URL_ROOT
sudo gitlab-ctl restart sidekiq
You have to be sure to remove this file out if the relative URL root goes away. I believe env_dir
handles this for us already.