Back

[CLOSED] 401 Access to this resource is blocked.

  • 0
  • Databases
  • REST API
  • Web
  • Cloud
Steven
14 Jan, 2025, 19:26

can you share your code?

TL;DR
Developers were facing a '401 Access to this resource is blocked' error while attempting to add a large number of documents via the API. The issue was caused by too many requests firing off at once. The solution provided was to create fewer documents at a time rather than all at once, adjusting parameters such as `CREATE_BATCH_SIZE` and `RATE_LIMIT_DELAY` to find the best balance. The thread concluded with the issue being identified and resolved.
Manfry
14 Jan, 2025, 19:29

could you provide your email so i can send it via my password manager

Steven
14 Jan, 2025, 19:29

password manager? for your code?

Steven
14 Jan, 2025, 19:29

i mean the script you're using to import the data

Steven
14 Jan, 2025, 19:29

You can paste it here

Steven
14 Jan, 2025, 19:31

was this the original code that was executed that lead to the block?

Manfry
14 Jan, 2025, 19:32

should be, dont think ive changed it since

Steven
14 Jan, 2025, 19:33

ah i see now. So since you're not awaiting sendBatch([...documents]);, it's not actually done in batches and they're all done at once

Steven
14 Jan, 2025, 19:35

you can increase CREATE_BATCH_SIZE to a couple hundred and lower RATE_LIMIT_DELAY. play around with the numbers to see what works best

Manfry
14 Jan, 2025, 19:36

i see now, ok so something like this should resolve the issue?

Steven
14 Jan, 2025, 19:37

ya give that a go

Manfry
14 Jan, 2025, 19:39

cool i think i can work with this, thank you

Steven
14 Jan, 2025, 19:43

[CLOSED] 401 Access to this resource is blocked.

Steven
15 Jan, 2025, 00:16

did you change the code about 15 minutes ago?

Manfry
15 Jan, 2025, 00:29

hey i left the program running, left work 2 hours ago

Manfry
15 Jan, 2025, 00:29

it looked like it was about done when i left shouldn't have been executing still when you specific 15 minutes ago

Manfry
15 Jan, 2025, 00:30

unless theirs a issue with the code

Manfry
15 Jan, 2025, 00:30

ill try to remote into my workstation and see if i can stop it

Manfry
15 Jan, 2025, 00:34

cant remote in, if its causing a issue with spamming the endpoint I apologize you can block the account if needed and when i get back to work tomorrow i can request it to be unblocked

Steven
15 Jan, 2025, 00:36

your project was blocked and then i unblocked it

Manfry
15 Jan, 2025, 00:40

gotcha i appreciate it, it shows on the console Database 877K Documents though before i left my program showed it added 1.6 million documents so there is likely a issue with my program, if it causes any other issues dont worry about unblocking it until im back in office tommorrow and ill check the logs to see whats going on

Manfry
15 Jan, 2025, 00:42

looks like my program may be resuming after you unblocked as the documents are going up in the console so thank you

Steven
15 Jan, 2025, 00:47

are you looking at the stats. it might be delayed or something

Manfry
15 Jan, 2025, 00:47

it looks like it just hit 1M is that correct?

Manfry
15 Jan, 2025, 00:48
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more