429 error with api

Hi All
I have stood up a simple linux vm in azure and installed discourse. I am using this machine to develop some migration scripts. I am running in to http 429 errors when running the migration scripts. I found the post how to set the limits in app.yml

my configurations are as follows:

i have also “./launcher rebuild app” after these changes.

but still i am getting 429 errors at around 200 api requests. what could i be missing here?

Probably coming from NGINX, are you mixing in the NGINX rate limiting template?

1 Like

we’ve tried to make changes in /etc/nginx/conf.d/discourse.conf – we have adjusted these values hoping of not getting any more 429 (“too many requests”):

limit_req_zone $binary_remote_addr zone=flood:10m rate=1200r/s;
limit_req_zone $binary_remote_addr zone=bot:10m rate=2000r/m;
limit_req_status 429;
limit_conn_zone $binary_remote_addr zone=connperip:1000m;
[...]

  limit_conn connperip 2000;
  limit_req zone=flood burst=1200 nodelay;
  limit_req zone=bot burst=1000 nodelay;

and followed by:

sv stop nginx
sv start nginx
under /var/www/discourse

we still get 429 (“too many requests”) despite these changes.

Is there any other setting we should change? The error seems to come from discourse itself and not NGINX. I got this error:

{"errors":["You’ve reached the maximum number of new topics. Please wait 15 hours before trying again."],"error_type":"rate_limit","extras":{"wait_seconds":54224}}

If I try to post messages with other users, then it seems to work fine.

I wonder where is the setting to remove this restriction of number of new topics for each user. I didn’t find it under Settings \ Users or Settings \ Posting.

actually I found what I was looking for under Settings \ Rate Limits

1 Like

If you’re trying to import data from another forum, you’ll be much better off looking at the existing import scripts.

1 Like