Skip to content

URL in email wrong #804

Closed
Closed

Description

@23doors

Since I believe 5.3 version there are some issues with URLs in emails.

Sentry is running at URL/sentry.
In emails URLs are URL/sentry/sentry/...

Running with:
SENTRY_URL_PREFIX = ''
Other URL settings are default.

Everything is fine in web environment, all URLs are fine there. Just the emails.
Running in uwsgi (not sentry start) environemnt with:

   uwsgi_param SCRIPT_NAME /sentry;
   uwsgi_modifier1 30;

Which makes it all fine in web as I wrote.

Was perfectly fine in some older version (5.x).

Activity

  1. 23doors commented on Feb 27, 2013

    @23doors
    Author

    Haven't tried 5.4 yet, is it something that may have been fixed by this version?

  2. robertlucido commented on Mar 1, 2013

    @robertlucido

    Problem exists for me in 5.4.2, running under gunicorn.

  3. 23doors commented on Jun 27, 2013

    @23doors
    Author

    After adding (r'^sentry/', include('sentry.web.urls')), to django app I got:
    /sentry/default/blabla

    Basically - yup, no /sentry/sentry but also hmm.. Server url disappeared... They are no longer valid links. href="/sentry/defaultblabla".

  4. dcramer commented on Jun 27, 2013

    @dcramer
    Member

    I would test against master, but if you're seeing issues its because we dont hijack all URL generation areas yet, and you're hosting on a subpath (which requires SCRIPT_NAME changes via proxying).

  5. 23doors commented on Jun 27, 2013

    @23doors
    Author

    Really? And it was working before new version - with exactly same setup. Everything works but email notifications so I honestly doubt that is the correct explanation... Especially as @Hopson commented - it is flawed under gunicorn as well.

  6. dcramer commented on Jun 27, 2013

    @dcramer
    Member

    @23doors in master (which may not be 5.4) nearly all URLs are generated using SENTRY_URL_PREFIX

    This doesnt guarantee things will work. You'll likely still need to set FORCE_SCRIPT_NAME if you're doing something with a path (which is a Django thing).

    This isn't really a Sentry bug, but its more of a "we dont support subpaths" or at least "we dont document how to run Sentry in a subdirectory"

  7. 23doors commented on Jun 27, 2013

    @23doors
    Author

    I understand but it doesn't really seem like subpath thingie. Mind that I am using queue (celery) to deliver messages. And from what I saw - mail notifications are also sent from celery level. Which would mean that urls are also generated from there. It seems like something that would work like that irrelevant of subpath (or lack of it) or server choice/configuration.

    When not using queue I am getting URL + double sentry/sentry (but I havent tested with proper urls.py). With celery I am getting correct path but no server url - is there a way to force server url to use? As I see it is not using django current site url so how to force it from celery level (where things like pathinfo etc does not exist).

  8. dcramer commented on Jun 27, 2013

    @dcramer
    Member

    The URL should be team-slug/project-slug, are you sure this isn't what you're seeing?

  9. 23doors commented on Jun 27, 2013

    @23doors
    Author

    Without celery (queue = false) I am seeing:
    http://server_url/sentry/sentry/team-slug/project-slug/group/group_id/

    With celery:
    I am seeing:
    /sentry/team-slug/project-slug/group/group-id/

    So basically correct path but no http and no server_url.

    Update: I checked how url is generated and got it resolved. For sentry I got SENTRY_URL_PREFIX = ''.
    For celery I am setting this to server base url. And finally email is working fine.

    I assume that when using queue this has to be set, as there is no request hostname or anything like that so url prefix will remain empty. This should be documented I guess.

  10. dcramer commented on Jun 27, 2013

    @dcramer
    Member

    You basically always have to set SENTRY_URL_PREFIX. It's documented. Where
    is the confusion?

    On Thursday, June 27, 2013, Robert Kopaczewski wrote:

    Without celery (queue = false) I am seeing:
    http://server_url/sentry/sentry/team-slug/project-slug/group/group_id/

    With celery:
    I am seeing:
    /sentry/team-slug/project-slug/group/group-id/

    So basically correct path but no http and no server_url.

    Update: I checked how url is generated and got it resolved. For sentry I
    got SENTRY_URL_PREFIX = ''.
    For celery I am setting this to server base url. And finally email is
    working fine.

    I assume that when using queue this has to be set, as there is no request
    hostname or anything like that so url prefix will remain empty. This should
    be documented I guess.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/804#issuecomment-20148166
    .

    David Cramer
    http://disqus.com/zeeg
    http://twitter.com/zeeg

  11. 23doors commented on Jun 27, 2013

    @23doors
    Author

    There is no indication anywhere that it should be set. Most of the time it works fine without it. And I have never been using it before (set to '' just as it is default).

  12. 23doors commented on Jun 27, 2013

    @23doors
    Author

    Example value in docs is also confusing:
    SENTRY_URL_PREFIX = '/sentry'
    Which seems to be pointing out that it should contain path prefix but not base url as well.

  13. dcramer commented on Jun 27, 2013

    @dcramer
    Member

    The docs need updated, but the example config shows:

    SENTRY_URL_PREFIX = 'http://sentry.example.com'  # No trailing slash!
    
  14. dcramer commented on Jun 27, 2013

    @dcramer
    Member

    docs updated in a9bb47d

  15. 23doors commented on Jun 27, 2013

    @23doors
    Author

    Great! Thanks!

  16. locked and limited conversation to collaborators on Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions