Comment formatter errors in logs

Thanks again. Here’s a dump of today’s logs. (less errors). Any idea on why there are still a few errors?

[2022-04-18 01:37:57] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 02:27:47] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 02:39:16] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 02:39:17] comment.INFO: sync_comments.success {"post_id":14775} 
[2022-04-18 05:57:20] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 07:20:20] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 08:10:57] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 11:00:41] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-18 11:04:45] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-18 11:06:40] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-18 11:15:22] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-18 11:42:45] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 11:45:47] comment.INFO: sync_comments.success {"post_id":14785} 
[2022-04-18 11:45:48] comment.INFO: sync_comments.success {"post_id":14775} 
[2022-04-18 11:57:11] publish.INFO: update_post.post_success {"wp_title":"Webpc: Personal cloud desktop in your browser","wp_author_id":"34","wp_post_id":14785,"discourse_post_id":"555"} 
[2022-04-18 11:57:11] publish.INFO: update_post.body_valid {"wp_title":"Webpc: Personal cloud desktop in your browser","wp_author_id":"34","wp_post_id":14785,"discourse_post_id":"555"} 
[2022-04-18 11:57:12] publish.INFO: featured_link.post_success {"wp_title":"Webpc: Personal cloud desktop in your browser","wp_author_id":"34","wp_post_id":14785,"discourse_post_id":"555"} 
[2022-04-18 11:57:12] comment.INFO: sync_comments.success {"post_id":14785} 
[2022-04-18 11:57:12] comment.INFO: sync_comments.success {"post_id":14775} 
[2022-04-18 12:05:24] comment.INFO: sync_comments.success {"post_id":9305} 
[2022-04-18 12:08:39] comment.INFO: sync_comments.success {"post_id":14785} 
[2022-04-18 12:11:51] connection.INFO: check_connection_status.successful_connection  

Are there any other threads besides this one on customizing the Discouse comments imported to WordPress?:


1 Like

A post was merged into an existing topic: Issues with setting up ajax comments

I have the same issue with comment_formatter.ERROR: and don’t even have comments from discourse turned on, nor ajax. It hits the logs ever 2 seconds round the clock. Meanwhile a lot of slow PHP processes and an FLOCK that halts everything, bringing the site down repeatedly.

script_filename = /www/index.php
[0x00007fa5ef613c90] flock() /www/wp-content/plugins/wp-discourse/vendor_namespaced/monolog/monolog/src/Monolog/Handler/StreamHandler.php:106
[0x00007fa5ef613c00] write() /www/wp-content/plugins/wp-discourse/lib/logs/handlers/file-handler.php:167
[0x00007fa5ef613b50] write() /www/wp-content/plugins/wp-discourse/vendor_namespaced/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:34
[0x00007fa5ef613ad0] handle() /www/wp-content/plugins/wp-discourse/vendor_namespaced/monolog/monolog/src/Monolog/Logger.php:283
[0x00007fa5ef6139b0] addRecord() /www/wp-content/plugins/wp-discourse/vendor_namespaced/monolog/monolog/src/Monolog/Logger.php:614
[0x00007fa5ef613930] error() /www/wp-content/plugins/wp-discourse/lib/discourse-comment-formatter.php:62
[0x00007fa5ef613670] format() /www/wp-content/plugins/wp-discourse/lib/discourse-comment.php:310

@gizadev Thanks for the report. We’ll be addressing the logging issue soon (it’s at the top of my list this week).

Just a note that I have a few doubts as to WP Discourse being the source of your issues which sound like they may be at least partially related to other sources.

Did you previously have them enabled and do you have existing Discourse comments on your Wordpress?

If possible, could you share your WP Discourse logs with me privately.

1 Like

@haydenjames Just following up on this, would you be able to check your logs to see if that warning has cropped up again?

Looking at it again now it seems the logging is accurate, albeit it should be a warning rather than an error, and it needs additional data (like the post causing it), however I’m not sure I’m capturing all scenarios in the test.

1 Like

Sure I can enable logging. Will report back. Haven’t had any issues since. (That I know of ha)

Also can you have a look at my other thread, probably my bad for posting on a sunday:


Without enabling the logs I had disabled previously, I found these. Only on the 30th April:

[2022-04-30 17:17:01] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:20:01] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:20:18] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:20:47] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:28:06] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:29:11] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:29:41] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"} 
[2022-04-30 17:38:09] comment_formatter.ERROR: format.missing_post_data {"keys":"discourse_comments_raw"}

Before that, last time the log file was written to was the 19th just before disabled.