Logins redirects to missing notifications page

Hi there, brand new Discourse user here.

I’m on 2.5.0.beta3, and have customized discourse via the admin settings with bunch of changes to disable features I do not need (badges, private messaging, etc). I didn’t make any changes to code or raw config, no SSO as well.

I didn’t realise, but upon logging out and back in, I get redirected to /notifications?recent=true&limit=5, which shows “Oops! That page doesn’t exist or is private.”

I could not find the offending setting that controls this behaviour: my user has “Default Home Page” set as “Categories”. I tried with multiple accounts, with all showing the same behaviour.

Any help is much appreciated!

2 Likes

We’ve just upgraded to 2.5.0.beta3 and have the exact same problem
Login is redirecting to notifications?recent=true&limit=5 rather than the selected user preference home page - gives a 404

The correct url for notifications for a user would be /u/username/notifications?recent=true&limit=5

But anyway it should be picking up user preferences. Looks like login is not picking up the user id (login in with username) but after the 404 page you are in fact logged in.

1 Like

That’s very strange. I just upgraded a site and don’t have that problem.

Are you running any plugins or themes that might do this? Does safe-mode fix it?

Can you share your site url?

Not aware of any themes or components that would affect this. Had to disable one custom component which broke going from 2.4 to 2.5 but that is unrelated (changes layout of groups to a list).
What is safe-mode and how do I use it?

Site url wont help as there is no public access.

1 Like

safe-mode seems to make no difference, but I’m not convinced it enabled safe mode by following these instructions

as simply using /?safe_mode on the end of the site url didn’t bring up and option page - just reloaded the login page, and using /?safe_mode=no_custom&no_plugins&only_official did the same and there appeared to be no difference on the site.

1 Like

I was able to enable safe mode (I just logged in, and there the options were). I left them all ticked, logged out, and logged in again.

After logging in, it directed me to page /notifications?recent=true&limit=5

Why?

Why isn’t it consistent (sometimes it goes to the correct place).

Note this uri is in a cookie from the login page.

1 Like

Any progress yet - we’ve got the same problem. It does it on one server but not on another test server with the same load of plugins and components.

OAuth2 plugin has been installed on both but is now disabled (since before the upgrade). It is just possible that the Outh2 plugin was enabled on the one with the problem while it was being upgraded and has been disabled after the upgrade - I’m waiting for the sysadmin to confirm what order he did things.

Oauth2 was installed during the upgrade. It has been disabled since.

Have you got the OAuth2 plugin installed?

1 Like

Are you on a subfolder install?

What is a subfolder install?
We just have a standard install. We have a containers folder with an app.yml in it, and we start Discourse by running a script called launcher (as root).

I have the same issue after the upgrade to 2.5.0.beta3.
Self hosted standard install, only official plugins used.
Google Oauth is configured.

1 Like

I can confirm this is happening – or something like it – on my testing install.


Testing: https://smoke-test.redacted.invalid/
Starting Discourse Smoke Test for https://smoke-test.redacted.invalid/
PASSED: go to site - 1119ms
PASSED: expect a log in button in the header - 266ms
PASSED: open login modal - 85ms
PASSED: login modal is open - 8ms
FAILED HTTP REQUEST TO https://smoke-test.redacted.invalid/notifications?recent=true&limit=5 Status is: 403
PAGE LOG: Failed to load resource: the server responded with a status of 403 ()
FAILED HTTP REQUEST TO https://smoke-test.redacted.invalid/logs/report_js_error Status is: 429
PAGE LOG: Failed to load resource: the server responded with a status of 429 ()
PASSED: type in credentials & log in - 363ms
PASSED: is logged in - 1606ms

Checking the inspector, I see a request to /notifications?recent=true&limit=5 as soon as I open the login modal, but no redirect happens.

2 Likes

I think it is coming from

https://github.com/discourse/discourse/pull/9525

1 Like

Ok so @featheredtoast

A quick fix has been committed:

https://github.com/discourse/discourse/commit/8e4fea897e68e4b50e548f820dc1f1fdeeeb199d

This should show up in tests-passed in about 15 minutes.

5 Likes

I can confirm that the fix solved the issue on my installation.
Thanks for the quick reaction!

4 Likes