We have a WordPress site where we use Discource to log in and comment on WordPress.
Everything worked fine until we moved WordPress (which has always run on a different server) to a new IP and a different server.
Since then, we started to get articles in the classic editor that have the settings shown in the image below not getting a Discourse link even after they are automatically published.
I always have to manually go into a particular article and just translate the article, then the Discourse link is created and everything is OK
Any ideas where to look for the cause of the problem?
Is anyone dropping clues as to where the problem might be?
The only mention of error I found in the log was this one, but I couldn’t manage to track down anything on this message.
Have you got an example of such a topic? The example in your logs shows that the Discourse topic was successfully published. That’s what these lines mean
[2024-06-14 06:45:43] publish.INFO: create_post.post_success {"wp_title":"Konec ikonického designu. Galaxy Buds 3 dostanou zcela nový vzhled","wp_author_id":"94147","wp_post_id":771981}
[2024-06-14 06:45:43] publish.INFO: create_post.body_valid {"wp_title":"Konec ikonického designu. Galaxy Buds 3 dostanou zcela nový vzhled","wp_author_id":"94147","wp_post_id":771981}
[2024-06-14 06:45:43] publish.INFO: create_post.after_publish {"post_id":771981,"remote_post_type":"create_post","discourse_post_id":"10416","discourse_topic_id":"5899","discourse_permalink":"https://komunita.svetandroida.cz/t/konec-ikonickeho-designu-galaxy-buds-3-dostanou-zcela-novy-vzhled/5899"}
You can see a link to the successfully published topic in the last line of those logs, i.e.
The webhook error you see immediately after that suggests an issue with the webhook, but it’s not necessarily indicative of an issue with publication per se.
If you could run a new test where you reproduce the issue, and have a look at the publish logs that were created, that will give us some insight as to the issue you’ve described.
Also, could you share what you mean by “translate the article”?
I always have to manually go into a particular article and just translate the article
I suspect that your Discourse install might have cached the DNS entry and is using the IP address of your old WP installation. The quickest way to try that is to restart the container and see if the problem goes away.
The log probably shows a record from the state when I save the article manually. Sorry it was a typo, it should have said save manually.
I thought of the DNS thing too, and did the “./launcher rebuild app” right after moving WordPress to the new server, but maybe it was too early from a DNS perspective. I’ll try again then.
Sorry, just to confirm, you mean that the log is not connected to the issue with automatic publishing you’ve reported? If not, could you share a log of an automatic publishing event?
It is very difficult for me to tell from the log whether specific lines are related to the problem or not. I’ve made a few changes towards DNS and we’ll see if it helped when the next article comes out at 10 o’clock.
So the current problem is that when an article in WordPress is supposed to come out automatically at a certain time, the link to the Discourse community is not created. But when I subsequently edit the problematic article manually and just save it without any changes, the link to the Discourse community is created.
Ok, so your issue is the old issue of auto-publishing with scheduled posts.
The most likely cause is one of your other plugins on your site is also hooking into your scheduling system, producing the issues others have seen in the past. Looking at your plugin list, this seems like a possible candidate:
WordPress Editorial Calendar - 3.8.5
Could you try disabling that and see if the problem persists?
How are you calling the cron job? Note that when you call wp cron, the call is affected by any global wp parameters: Config – WP-CLI – WordPress.org. It’s possible something in your wp config is affecting how the job is handled.
This will call all scheduled WordPress cron jobs:
wp cron event run --due-now
If you’re just calling wp cron event run publish_future_post, it’s possible that events that are required by the WP Discourse plugin to publish a post aren’t being triggered. I think this is the equivalent to how WordPress deals internally with scheduled posts:
wp cron event run publish_future_post future_to_publish publish_post transition_post_status
I haven’t tested this. I’m setting up a new computer and haven’t got WordPress site on it yet. I’ll do that soon.