# Comment formatter errors in logs

**URL:** https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856
**Category:** WordPress
**Created:** [April 18, 2022, 12:21pm UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856 "2022-04-18T12:21:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [April 18, 2022, 12:21pm UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/1 "2022-04-18T12:21:24Z")

</div>

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

```plaintext
[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  

```

> [@Issues with setting up ajax comments](https://meta.discourse.org/t/issues-with-setting-up-ajax-comments/224455/4):
>
> Yes, how it displays will depend on your theme. There is minimal styling in the plugin itself.

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

> [@Styling comments](https://meta.discourse.org/t/styling-comments/133238):
>
> Is there an easy way to style comments in Wordpress with the same CSS being used at the bottom of this post?

Thanks

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [May 2, 2022, 9:29am UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/2 "2022-05-02T09:29:39Z")

</div>

A post was merged into an existing topic: [Issues with setting up ajax comments](https://meta.discourse.org/t/issues-with-setting-up-ajax-comments/224455/10)

---

<div class="post-metadata">

### Author: ![gizadev](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gizadev](https://meta.discourse.org/u/gizadev)
#### Post date: [May 1, 2022, 4:56pm UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/3 "2022-05-01T16:56:24Z")

</div>

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.

```plaintext
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

```

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [May 2, 2022, 8:13am UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/4 "2022-05-02T08:13:55Z")

</div>

@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](https://github.com/discourse/wp-discourse) being the source of your issues which sound like they may be at least partially related to other sources.

> [@gizadev](#):
>
> I have the same issue with comment\_formatter.ERROR: and don’t even have comments from discourse turned on, nor ajax.

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

If possible, could you share your [WP Discourse](https://github.com/discourse/wp-discourse) logs with me privately.

---

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [May 2, 2022, 10:15am UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/5 "2022-05-02T10:15:51Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [May 2, 2022, 10:20am UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/6 "2022-05-02T10:20:51Z")

</div>

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:

> [@Connect 2 topics](https://meta.discourse.org/t/connect-2-topics-threads/225798):
>
> Happy Sunday, If two forum topics are related but not similar enough to merge, is there an official or recommended method to connect the two? Other than making a comment at the end of each topic and linking to each? I know when topics are split, there leaves a public trail that visitors can click to follow the related topic that was split. So basically looking for the same, but the reverse; 2 related topics that are not similar enough to merge but useful if connected/linked. Thanks!

---

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [May 2, 2022, 10:33am UTC](https://meta.discourse.org/t/comment-formatter-errors-in-logs/225856/7 "2022-05-02T10:33:56Z")

</div>

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

```plaintext
[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.
