message":"Too Many Requests","discourse_topic_id"

I upgraded to the most recent version of WP-disourse today and for the first time started seeing these errors:

2025-05-29 13:22:11] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3886","wp_post_id":3151,"http_code":429} 
[2025-05-29 13:22:11] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3888","wp_post_id":3026,"http_code":429} 
[2025-05-29 13:22:11] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3889","wp_post_id":2374,"http_code":429} 
[2025-05-29 13:22:12] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3890","wp_post_id":2288,"http_code":429} 
[2025-05-29 13:22:12] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3891","wp_post_id":2083,"http_code":429} 
[2025-05-29 13:22:13] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3892","wp_post_id":2031,"http_code":429} 
[2025-05-29 13:22:14] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3894","wp_post_id":1495,"http_code":429} 
[2025-05-29 13:22:15] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3895","wp_post_id":975,"http_code":429} 
[2025-05-29 13:22:15] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3896","wp_post_id":841,"http_code":429} 
[2025-05-29 13:22:15] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"3897","wp_post_id":783,"http_code":429} 
[2025-05-29 13:22:15] comment.ERROR: sync_comments.response_error {"message":"Too Many Requests","discourse_topic_id":"4023","wp_post_id":730,"http_code":429} 

Any ideas where’s causing this?

1 Like

The most likely explanation is the one stated in the error message. Your site is sending too many requests to the comments endpoint of Discourse.

  • Are pages the Discourse comments appear on are being refreshed alot?
  • Is your site experiencing heavier than normal load?
  • Are the log messages continuing?
  • Are you using the WP Discourse comment caching feature? If not, that would likely help here. You can enable comment caching in the settings.

I was able to roll back to the previous version 2.5.6 and that resolved the issue completely without any other changes:

image

With version 2.5.7 the below screenshot would show disconnected unless I click save every single time on that page. Even then, if I clicked to another tab and clicked back to the main plugin page, it would show disconnected again. Since reverting back to 2.5.6 it ALWAYS shows “You are connected to Discourse!” regardless if I leave that page/tab or not.

I found it odd but thought maybe it was like that prviously and I had not noticed, so I don’t have the before screenshot as I just dismissed it. After reverting to 2.5.6 I realize it was indeed not normal and only happened after 2.5.7. upgrade.

*** Are pages the Discourse comments appear on are being refreshed alot?**
(I don’t think so nothing has changed other than clicking to upgrade the plugin)

*** Is your site experiencing heavier than normal load?**
(no same traffic as every thursday)

*** Are the log messages continuing?**
(Yes, they did, so I reverted to 2.5.6. I thought maybe with time it would resolved but the log grew to about 2 pages in estimated lenght.)

*** Are you using the WP Discourse comment caching feature? If not, that would likely help here. You can enable comment caching in the settings.**
(No, I’ve never had to. None of the settings of WP-Discourse have been changed in about a year. My sole action of maintenance has been to just update to new versions.)

I have not posted any new content since the nightly WordPress backup or updated any other plugins, so the revert was a quick way to see if fixed.

1 Like

Thanks for the detailed response, it’s appreciated!

It looks like you rolled back your entire site? Is that correct? Are you absolutely positive the only thing that changed was the WP Discourse plugin? If so, what makes you certain? How was the upgrade performed? Rolling back your entire site would have also rolled back any other changes that were made. Also, are you using a block enabled theme, and are you using the WP Discourse Comments Block?

1 Like

Only thing I can think of is this block in functions.php maybe?

add_filter( 'discourse_comment_html', function () {
	ob_start(); ?>
	<li class="comment depth-1">
		<article class="comment-body">
			<header class="comment-header">
				<img
					src="{avatar_url}"
					alt="{username} avatar"
					class="comment-avatar"
					width="40" height="40" loading="lazy"
				/>
				<div class="comment-meta">
					<b class="fn">
						<a href="{topic_url}" rel="external">{username}</a>
					</b>
					<time datetime="{comment_created_at}">
						{comment_created_at}
					</time>
				</div>
			</header>

			<div class="comment-content">
				{comment_body}
			</div>
		</article>
	</li>
<?php
	return ob_get_clean();
} );