Empty category about topic is crashing my browser tab

We have a weird issue where one ‘about’ page is crashing the browser. I can’t figure out how to debug or even solve this - some ideas would be appreciated!

To reproduce:

  1. Tested in Chrome, Safari and Firefox
  2. Visit Blender Artists Community to disable all our themes and plugins
  3. Navigate to Categories > Jobs
  4. Warning this step will crash your current tab: navigate to the ‘About the Jobs category’ topic.
1 Like

I’m not sure what the problem is, but I see this error in the console

Could not view topic TypeError: Cannot read property 'get' of undefined
    at _application-2a1d858e65ec0b4525cdf5e0b11710ee777a37442b3db4ccec07b79396ed4e02.js:26658
    at h (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:56524)
    at C (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:56702)
    at E (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:56687)
    at e.invoke (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:26887)
    at e.flush (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:26790)
    at e.flush (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:26963)
    at e._end (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:27447)
    at e.end (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:27180)
    at e._run (_ember_jquery-716f4989c2eb49ad65163ffb56185407340c2b195b81b9392b62cde3e992cade.js:27492)
2 Likes

Is this topic from yesterday related?

Note that safe mode doesn’t disable everything, the only way to be totally sure is to briefly comment out plugins and rebuild.

This topic has 0 posts or an empty post so, it looks like a regex goes crazy.

Can you query this topic and posts in the console or database?

Compare your topic and a normal one.

The post_stream.posts element in the json.

Maybe this is related to translations @gerhard ?

I think you’re on to something. I ran the following query in the Data Explorer and came up with 0 results - so apparently I have a topic with no posts. I wouldn’t be surprised if this has been the case since we migrated from vBulletin.

Is there a way to fix it? Can I generate a new ‘About’ topic?

select *
from posts
where topic_id = 294130

Try posting to it with the API. That will either error out or fix it :stuck_out_tongue:

1 Like

Do you have any hints, tools or code snippets to help me with that? :slight_smile:

Wait, I think I’ve got this. Let me try and learn :slight_smile:

https://github.com/discourse/discourse_api/blob/master/README.md

I went for the curl solution and that fixed it. You’re awesome, thanks for your quick help!

For future readers: first create an API key in the user admin for your account, then run this from the command line. You’ll find in-depth API documentation here.

curl -X POST "https://<server name>/posts.json" \
-H "Content-Type: multipart/form-data;" \
-F "api_key=<your api key>" \
-F "api_username=<your user name>" \
-F "topic_id=<topic id>" \
-F "raw=<some content>"
2 Likes

Anyone can say anything about this topic?

Opa,

Use the same workaround that @bartv used.

We will try to find a root cause in the meantime. I suspect of https://github.com/discourse/discourse/pull/7110 plus migrations leaving an inconsistent state @gerhard .

I believe both GUJ and BlenderArtists came from imports.

4 Likes

This (problems with 0-post topics) has happened enough times that I think adding an additional mitigation is worth it - e.g. the server-side TopicView giving the client an error message if it’s asked for a topic with no posts.

1 Like

I fail to see how the changes in PR #7110 could cause such issues. There’s no migration that touches arbitrary categories. And the fixtures for special categories like Staff, Meta and Lounge should work the same as before. The wizard and the “Replace Text” functionality also updates only the About topics of those categories.

There must be another reason for missing posts in the “About category” topics or, if the posts are missing for a long time, why the browser crash didn’t happen before.

4 Likes

Our weekly schedule should clean this up just in case. Categories without “About category” cause a lot of pain.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.