Error: Something went wrong - "Error while processing route: discovery.categories"

One admin user is having a strange error after updating Discourse. The error happens when the user clicks on the back button or the site logo. It appears to trigger JavaScript to go to the root/home of the site, but instead the following errors trigger:

Visually the error appears as:
image

In the JS console:

I’ve also found that this happens with any nav bar clicks such as trying to go to /admin as well.

Any thoughts on tracing this out further? Not seeing error in production.log or otherwise, so this has been a real head scratcher since it seems bound to JS.

Did you try How to use Discourse Safe Mode

Thank you for the suggestion. Strangely it still had the error even with enabling all 3 options in Safe Mode:

Still been hitting dead ends in further debugging so far. I have to suspect that “Safe Mode” is not fully disabling JS due to this… Is there another step that can further eliminate JS from functionality for testing?

Is your site publicly accessible? If so, any chance you can share a link? (via a PM is fine if you prefer not to post it publicly)

Thanks for the link @mreach. I’m not seeing any obvious issues from here.

You mentioned that this is only affecting one user on the site. Do you know if it’s a problem is limited to a single browser/device? Or does it happen to this user even when they log in using a different device?

If it’s just one browser/device, then it could suggest a browser plugin (e.g. an ad blocker) intefering with Discourse’s code.

If it’s affecting them in every browser, then that’s more tricky. Do you have any third-party plugins installed on your forum? It would also be interesting to know what the user has configured for their ‘default home page’ (found in their Discourse ‘interface’ preferences)

Thanks - yes, I’ve had mostly the same thoughts. I had them try disabling all extensions, clearing all browser data. I just had ANOTHER user report the same problem… And they’re both on Chrome. I asked them to try Firefox and Brave and they each said it worked for them there, but nothing they can do seems to make Chrome work “properly” for them again. The asked them again about Incognito results and they both reported that Incognito DOES work. Again, all of this was after the last Discourse update, so it seems as though something must not be clearing in JS somehow… Which I truly don’t understand how that could be the case.

I’ve asked them what they have configured as their homepage… Will let you know. That’s a very good idea that had not crossed my mind…

1 Like

Alright, interesting but not conclusive:

The user that has the problem has “Categories” set as their home:
image

If they change it to another, such as “Latest” instead, they CAN load the home page by clicking the site logo AND using the “back” arrow in the browser. If they change BACK to “Categories” instead of “Latest” the problem / error returns. :weary:

So this user is also an admin and if/when they click on the hamburger icon in the upper right and click “Admin”, they also get the error as reported above - even when the home page is changed to “Latest” instead of “Categories”.

Of course that’s new info, but not entirely helpful given my perspective. Hm.

1 Like

Any chance you can get some more detail on these errors? They should all be expandable, and should hopefully include a little more detail about the error.

They got me the following console output: https://pastebin.com/LuDHesyQ

Thanks again for the suggestions up to now - happen to have any observations from that @david?

1 Like

I’m afraid not - these logs are fairly generic and don’t seem to say much about what the actual cause.

The most interesting log is the one which is at the top of the screenshot you shared above, and is also the last entry in the pastebin

domainname.com/:1 Uncaught (in promise) {readyState: 4, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}

It might be useful to know what’s in the ... there. If you click on the little triangle to the left hand side of the log, it should expand to reveal some more information. A copy/paste, or a screenshot, of that might help.

Separately, are you seeing any server-side errors (at /logs)? And are you running the latest version of Discourse?

Yes, running the latest version. I have checked the logs during the error and see nothing in production or otherwise…

Hmm, they did a copy object on that line and got the following:

{
    "readyState": 4,
    "responseText": "<!doctype html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <meta http-equiv=\"refresh\" content=\"30\">\n        <title>domainname.com Maintenance</title>\n        <style>\n\t    html {\n\t        background: #3d4147;\n\t    }\n            .center {\n                display: flex;\n                justify-content: center;\n            }\n            .container {\n                background: #717984;\n                max-width: 500px;\n                padding: 5px 50px 30px 50px;\n                margin-top: 20px;\n            }\n            .title {\n                padding-top: 20px;\n            }\n            h1, p {\n                font-family: \"Helvetica Neue\",Helvetica,Arial,sans-serif;\n            }\n            @keyframes spin {\n                from { transform: rotate(0deg); }\n                to { transform: rotate(360deg); }\n            }\n            .spinner {\n                animation: spin 10s infinite linear;\n                height: 75px;\n                width: 75px;\n                border: 7px solid #555555;\n                border-right-color: transparent;\n                border-radius: 50%;\n                margin-top: 20px;\n            }\n        </style>\n    </head>\n    <body>\n                <div class=\"center\">\n                    <img src=\"/err/site.png\" alt=\"site logo image\" width=\"512\" height=\"171\">\n                </div>\n        <div class=\"center\">\n            <div class=\"container\">\n\t\t<center>\n                  <h1 class=\"title\" >We're temporarily under maintenance&hellip;</h1>\n\t\t</center>\n\n                <div class=\"center\">\n                    <img src=\"/err/error.png\" alt=\"maintenance image\" width=\"150\" height=\"152\">\n                </div>\n\n\t\t<center>\n                  <p>domainname.com is currently undergoing maintenance. We're either upgrading the site or performing scheduled maintenance. </p>\n\t\t  <p>For your convenience, we've set this page to AUTOMATICALLY refresh for you when the system's available again!</p>\n                  <p>Thanks so much for your patience.</p>\n\t\t</center>\n\t\t\n                <div class=\"center\">\n                    <div class=\"spinner\"></div>\n                </div>\n            </div>\n        </div>\n    </body>\n</html>\n",
    "status": 200,
    "statusText": "parsererror"
}

And a screenshot of it from the console:

@david is that what you were referring to? I’m hoping we captured the correct results.

Are you running Discourse behind a proxy? I’m pretty sure this maintenance message is not coming from Discourse itself :thinking:

That is an error page implementation that renders when the site is undergoing maintenance (such as an upgrade or docker update)…

I’m guessing your site wasn’t undergoing deliberate maintenance at the time of the error? In which case there must be something wrong with that proxy implementation/config. To rule it out, are you able to expose discourse directly on port 80/443? (according to our standard install instructions)

Of course, it’s possible that an error in Discourse is causing the proxy to display this message. But it’s difficult to diagnose that without knowing what Discourse was returning. Maybe your proxy keeps logs of the upstream Discourse responses?