SeaFile Response [429]: {"detail":"Request was throttled. Expected available in X second."}

Hello everyone,

i’m trying to link seafile and kolab together and this was working great while my library was small but now it isnt working anymore…
Right now i have like 7000 files in 2000 folders and its not even finished yet but it seems that seafile doesnt like that many files to provide via its API…

i’ve enabled debug logging in the interface and for the first files i get a response something like:

SeaFile Response [200]: [{“permission”: “rw”, “mtime”: 1484997612, “type”: “dir”, “name”: “Document (1047)”, “id”: “a999d15580a506d8cee6e954f5c3b2a71ef1e65b”}]

after a few seconds those responses change into:

SeaFile Response [429]: {“detail”:“Request was throttled. Expected available in 59.0 seconds.”}

so to me this looks like seafile decided to throttle the responses due to the amount of files…

Is there anything i can do to prevent that? maybe a setting to increase the number of requests before throttling? or anything else?

fwiw, i am on seafile-server-6.1.2

thank you,
Andreas

same thing happens with server 6.2.2…

maybe one of the devs could chime in and point me to a setting?

thanks alot,
Andreas

i think i’ve found something:

# API throttling related settings. Enlarger the rates if you got 429 response code during API calls.
REST_FRAMEWORK = {
    'DEFAULT_THROTTLE_RATES': {
        'ping': '600/minute',
        'anon': '5/minute',
        'user': '300/minute',
    },
    'UNICODE_JSON': False,
}

# Throtting whitelist used to disable throttle for certain IPs.
# e.g. REST_FRAMEWORK_THROTTING_WHITELIST = ['127.0.0.1', '192.168.1.1']
# Please make sure `REMOTE_ADDR` header is configured in Nginx conf according to https://manual.seafile.com/deploy/deploy_with_nginx.html.
REST_FRAMEWORK_THROTTING_WHITELIST = []

however, it looks like the whitelist setting aint working…(?) at least it didnt with 127.0.0.1, with the server ip nor with my client ip… however, i could work around that by setting the user rate to a really high number…

if you guys could take a look what might be the issue with the whitelist setting, that would be awesome!

thanks,
Andreas

Hi

I have exactly the same issue… also I have Kolab connected and now I get this error messages “Request was throttled”.

I tried to setup the DEFAULT_THROTTLE_RATES but also when I enter following rates

# API throttling related settings. Enlarger the rates if you got 429 response code during API calls.
REST_FRAMEWORK = {
    'DEFAULT_THROTTLE_RATES': {
        'ping': '60000000000000000000000000000000000000000/minute',
        'anon': '50000000000000000000000000000000000000000/minute',
        'user': '30000000000000000000000000000000000000000/minute',
    },
    'UNICODE_JSON': False,
}

I have still same issue…

Which rates did you set exactly? Is this feature working really working, for me it seams it does not make any difference…

thank you

If you have problem with access files, thne you have to setup only user rate. Did’t you tried some smaller number? I don’t know how is code write but if they are using int32 then you setup will overflow, so try setup 2 000 000 000. But maybe will be better setup white list cause someone can make DDoS attack.

Are you guys using NGinx for seafile? did you setup domain name to kelab or IP of seafile server?

Ok, with following configuration is working

REST_FRAMEWORK = {
    'DEFAULT_THROTTLE_RATES': {
        'ping': '600/minute',
        'anon': '50/minute',
        'user': '3000000/minute',
    },
    'UNICODE_JSON': False,
}

# Throtting whitelist used to disable throttle for certain IPs.
# e.g. REST_FRAMEWORK_THROTTING_WHITELIST = ['127.0.0.1', '192.168.1.1']
# Please make sure `REMOTE_ADDR` header is configured in Nginx conf according to https://manual.seafile.com/deploy/deploy_with_nginx.html.
REST_FRAMEWORK_THROTTING_WHITELIST = ['127.0.0.1', 'public ip address']

but REST_FRAMEWORK_THROTTING_WHITELIST does not work!

As mentioned above the REMOTE_ADDR header is set in the seafile nginx configuration, but still not working… someone have and idea?

Can you confirm from log, debuging the IP adress which sending requests is same as in whitelist? Don’t mean you are sure, just check the logs, catch http header to check which IP going to seafile.

Hi
Checked again and your right… it is connecting via IPv6, therefore logically cannot work… I have added the IPv6 public address and now it works well with following configuration without problems

REST_FRAMEWORK = {
    'DEFAULT_THROTTLE_RATES': {
        'ping': '600/minute',
        'anon': '5/minute',
        'user': '300/minute',
    },
    'UNICODE_JSON': False,
}

# Throtting whitelist used to disable throttle for certain IPs.
# e.g. REST_FRAMEWORK_THROTTING_WHITELIST = ['127.0.0.1', '192.168.1.1']
# Please make sure `REMOTE_ADDR` header is configured in Nginx conf according to https://manual.seafile.com/deploy/deploy_with_nginx.html.
REST_FRAMEWORK_THROTTING_WHITELIST = ['127.0.0.1', 'public_IPv4_address', 'public_IPv6_address']

Thank you