الروابط معطلة بعد النقل

كثير من الروابط الداخلية في المنتدى معطلة بعد الانتقال إلى خادم جديد. لقد قمت بإنشاء الخادم الجديد بعنوان URL مؤقت وهو staging.example.com للمساعدة في عملية الانتقال، ولكن الآن بعد اكتمال الانتقال، لا تزال العديد من الروابط في forum.example.com تشير إلى staging.example.com (الذي لم يعد موجودًا).

لقد تأكدت من ملف app.yml وأعدت البناء:

containers/app.yml: DISCOURSE_HOSTNAME: forum.example.com

لقد بحثت في قسم الإدارة > الإعدادات عن أي آثار لكلمة “staging”.

لقد اكتمل انتشار DNS منذ فترة طويلة.

أرى هذا المرجع القديم، ولا أعرف ما إذا كان ذا صلة.

إذا لم يكن هناك حل ممكن سوى التعديل اليدوي، هل توجد أي تلميحات حول كيفية العثور على جميع التكرارات؟ زر البحث لا يعمل بشكل جيد في هذه الحالة.

I did that. All worked great except now I have broken links.

So you’re saying the remap and/or rebake failed?

Sorry, I did not do a remap. I’ll try that tonight.

Yes, now I can say the remap failed.

> /var/www/discourse# discourse remap staging.example.com forum.example.com
> Rewriting all occurences of staging.example.com to forum.example.com
> THIS TASK WILL REWRITE DATA, ARE YOU SURE (type YES)
> YES
> Error: ERROR:  duplicate key value violates unique constraint "unique_post_links"
> DETAIL:  Key (topic_id, post_id, url)=(8718, 57455, https://forum.example.com/t/exampletopic/4606/336) already exists.
> The remap has only been partially applied due to the error above. Please re-run the script again.

I re-ran it as instructed and got the same error, on the same (topic_id, post_id, url) key.

I can get to the rails console and run some SQL/ActiveRecord if you can tell me what to run. Or Data Explorer.

Someone else will have to help you with this because I’m not sure why you would have duplicate key value.

Ironically, the offending topic 8718 and post 57455 is in a PM between two users lamenting that the links are broken!

But using data explorer, I see only one post with id 57455. I don’t know why remap is complaining.

The post probably contains both the old and new URL already. Just edit it and remove them.

I cleaned up a few posts and was able to complete the remap. However the rebake ran to 30% then encountered errors and hung the system and I had to reboot. System has adequate memory and disk space.

Question: After reboot, in ‘top’, there is a ruby process using 60% CPU. Is that the rake job? Would it resume after reboot?

It’s probably Sidekiq busy on rebakes. Go to /sidekiq on your forum to check.