Converting a topic to a wiki returns a 500 error

AI 生成的摘要

In Discourse 1.9.0.beta8, converting a topic to a wiki triggered a 500 error, causing the topic to become inaccessible even though it appeared in activity feeds. Error logs revealed issues like NoMethodError: undefined method 'updated_at' for nil:NilClass in post_serializer.rb, and an OpenSSL RSA key error. southpaw reported the bug and provided reproducible examples in their Staff category. Although codinghorror initially couldn’t reproduce it, techAPJ confirmed the issue and noted that zogstrip had already fixed it 13 days prior via commit a6fc427. The fix was deployed to the affected site, restoring access to the previously broken wiki topics.

Discourse 1.9.0.beta8

Steps to reproduce:
Create a topic
Covert the topic to a Wiki with the “Make Wiki” option.
If it does load after converting to Wiki, refresh the page.

Result:

The topic appears in activity feeds:

image

Clicking it in the activity feed results in:

Error logs:

2
OpenSSL::PKey::RSAError (Neither PUB key nor PRIV key: nested asn1 error) /var/www/discourse/app/controllers/user_api_keys_controller.rb:138:in `initialize’
12:08 am

5
NoMethodError (undefined method updated_at' for nil:NilClass) /var/www/discourse/app/serializers/post_serializer.rb:358:in last_wiki_edit’
12:59 am

10
NoMethodError (undefined method updated_at' for nil:NilClass) /var/www/discourse/app/serializers/post_serializer.rb:358:in last_wiki_edit’
1:02 am

38
NoMethodError (undefined method updated_at' for nil:NilClass) /var/www/discourse/app/serializers/post_serializer.rb:358:in last_wiki_edit’

(Please let me know if you need the specifics from any of those errors. I had included them, but exceeded a character limit for the post.)

1 个赞

So far we cannot reproduce this?

Thank you for trying.

Is there a bug log that would help at all?

Perhaps one of the Discourse team members who has access to our site could try reproducing it in our Staff category?

I was able to reproduce it in that category both times that I tried. Those two inaccessible Wikis are:
https://forums.republicwireless.com/t/testing-a-wiki-for-500-error/12875/1
and
https://forums.republicwireless.com/t/repeating-the-wiki-500-test-filing-bug-report-w-discourse/12879/1

1 个赞

Hi @southpaw,

I think I may be able to repro and fix this issue. Added on my list to look into.

6 个赞

@zogstrip already fixed this issue 13 days ago via:

https://github.com/discourse/discourse/commit/a6fc42753cd4505aae771416373da0f61ac72487

@southpaw I deployed the above fix on your site and both the topics are loading fine now.

5 个赞