Issue with url on links in projects settings page


First off this is a sentry install. I have noticed a bug where some options on the project settings page refers to instead of our webserver hosting the server?

i did some digging and found the template located at Which has the project settings links where the issue occurs.

links using the url function ( a href="{% url ‘sentry-manage-project’ project.organization.slug project.slug %}">{% trans “General” %}) do use the SENTRY_URL_PREFIX

where as links generated using absolute_uri ( a href="{% absolute_uri ‘/{}/{}/’ project.organization.slug project.slug %}">Issues) dont use the SENTRY_URL_PREFIX

I had a look and url references views where as absolute_uri uses this inside http module?

def absolute_uri(url=None):
if not url:
return options.get(‘system.url-prefix’)
return urljoin(options.get(‘system.url-prefix’).rstrip(’/’) + ‘/’, url.lstrip(’/’))

i think the issue is something todo with options.get(‘system.url-prefix’) ?

any help appreciated thanks!

Hey @jackc, SENTRY_URL_PREFIX has been replaced by the system.url-prefix option a long time ago.

But either way, I don’t see any places where we’ve accidentally used ourselves, so the only other real explanation is that you literally have set system.url-prefix yourself to

You can confirm this by running:

$ sentry config get system.url-prefix

Hey @matt ,

Thanks for the reply.

Is it possible that links that match the websever are actually coming from current url pattern matching? that would make sense…

As i tried applying SENTRY_FEATURES[‘auth:register’] = False and this had no effect, Nor SENTRY_SINGLE_ORGANIZATION = True

both features stayed on.

BTW ‘system.url-prefix’: SENTRY_URL_PREFIX, is what i meant which is set in a SENTRY_OPTIONS.update( call

sentry config get system.url-prefix return no config, as ipass the SENTRY_CONF env as part of the sentry cmd to load up the webserver.

so SENTRY_CONF=/etc/sentry/ sentry config get system.url-prefix returns the url i expect.

But if the config was not in effect how does it get access to the DB right?

Thanks for the speedy reply liking how simple it is to integrate so far :smiley:

Ugh… so sorry to waste your time.

All the above works fine.

Some how my ansible deployment was not restarting the services and therefor the old config was still in use ><.

after a handler to restart them, all is fine thanks again!