בעיה ב-WordPress עם קישור ל-Discourse

סיכום מבוסס בינה מלאכותית

A user, Petr_Mišák, reports an issue where WordPress articles are creating hidden topics in Discourse, but the links to these topics are not being saved, preventing community engagement. The problem occurs with specific articles, such as one titled “Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček,” where the Discourse topic ID is created but the link is missing in WordPress. The logs show a 422 error with the message “Embed url už je zabráno” (Embed URL already taken), suggesting a conflict with existing URLs. pfaffman suggests the issue might be related to accented characters in the URL, though Petr_Mišák clarifies it’s likely not the cause. They also consider connectivity issues between WordPress and Discourse, but the WordPress logs provide no further insight. The issue appears inconsistent, affecting only certain articles, and the user has resorted to manually linking topics in the classic editor Petr_Mišák.

Hey. Hey. We use Discourse as a platform for our WordPress users to log in and for comments.
So everything dynamic happens in Discourse and WordPress is only used to publish articles and link to a specific Discourse thread to the community.

But recently, after publishing some articles in WordPress, we have been getting (hidden) topics created in Discourse, but WordPress doesn’t get a link to them :(.
So nobody can join the discussion, since we publish Discourse comments primarily as hidden.

Here is the communication log dump. We’re talking about an article with the headline “Best wireless headphones under CZK 1,000. We chose quality for little money”

[2024-10-15 07:51:35] publish.INFO: create_post.post_success {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321}
[2024-10-15 07:51:35] publish.INFO: create_post.body_valid {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321}
[2024-10-15 07:51:35] publish.INFO: create_post.after_publish {"post_id":788321,"remote_post_type":"create_post","discourse_post_id":"","discourse_topic_id":"11236","discourse_permalink":""}
[2024-10-15 07:51:36] webhook_topic.INFO: update_topic_content.update_post_metadata_success {"post_ids":"788321"}
[2024-10-15 07:51:48] publish.INFO: create_post.post_success {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321}
[2024-10-15 07:51:48] publish.INFO: create_post.body_valid {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321}
[2024-10-15 07:51:48] publish.INFO: create_post.after_publish {"post_id":788321,"remote_post_type":"create_post","discourse_post_id":"","discourse_topic_id":"11236","discourse_permalink":""}
[2024-10-15 07:53:39] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422}
[2024-10-15 07:53:46] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422}
[2024-10-15 07:54:06] connection.INFO: check_connection_status.successful_connection
[2024-10-15 07:54:06] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 07:59:19] connection.INFO: check_connection_status.successful_connection
[2024-10-15 07:59:19] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 07:59:20] connection.INFO: check_connection_status.successful_connection
[2024-10-15 07:59:20] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 08:01:38] connection.INFO: check_connection_status.successful_connection
[2024-10-15 08:01:38] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 08:01:41] connection.INFO: check_connection_status.successful_connection
[2024-10-15 08:01:41] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 08:02:08] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422}
[2024-10-15 08:02:15] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422}
[2024-10-15 08:04:41] connection.INFO: check_connection_status.successful_connection
[2024-10-15 08:04:41] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 08:07:42] sso_client.INFO: auth_user.success {"user_id":124866}
[2024-10-15 08:12:06] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422}
[2024-10-15 08:12:13] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422}
[2024-10-15 08:13:11] connection.INFO: check_connection_status.successful_connection
[2024-10-15 08:13:11] connection.INFO: check_connection_status.valid_scopes
[2024-10-15 08:13:30] connection.INFO: check_connection_status.successful_connection
[2024-10-15 08:13:30] connection.INFO: check_connection_status.valid_scopes

Can anyone advise how to fix this, or where the error originates?

Does it have to do with the accented letter?

There is a site setting having to do with urls with special characters.

I’m not sure if I understand, but this problem should not be related to the accent.

Just to clarify, it happened to us with this article Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme TOP6 and the community Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček - Komentáře ke článkům - Komunita Svět Androida

We already have it linked, but we had to manually insert the link to the community into WordPress via a switch to the classic editor.

I agree that it shouldn’t be connected, but that’s my best guess. I would try making the next one not having accented characters in the url.

Which URL do you see the diacritics in please?

Darn. I don’t see them. I think I got confused about the title in your logs. Sorry.

Maybe it’s not able to connect to WordPress? So check the WordPress logs?

[2024-10-15 08:12:06] publish.ERROR: create_post.post_error {"wp_title":"Nejlepší bezdrátová sluchátka do 1 000 Kč. Vybrali jsme kvalitu za pár kaček","wp_author_id":"152876","wp_post_id":788321,"response_message":"Embed url už je zabráno","http_code":422} 

The WP logs didn’t tell us much.
It only happens for some articles, so not being able to connect makes sense, but I don’t know the reason.