Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Wrangler timeout too short for bulk uploads #746

Closed
gregmsanderson opened this issue Sep 29, 2019 · 4 comments Β· Fixed by #757
Closed

Wrangler timeout too short for bulk uploads #746

gregmsanderson opened this issue Sep 29, 2019 · 4 comments Β· Fixed by #757
Assignees
Labels
bug Something isn't working

Comments

@gregmsanderson
Copy link

πŸ› Bug Report

Environment

  • operating system:
  • output of rustc -V:
  • output of node -v:
    v10.16.2
  • output of wrangler -V:
    πŸ‘· ✨ wrangler 1.4.0

Steps to reproduce

I've been trying the newly added Workers Sites as it looked awesome. I tried it first with a simple site with about 10 assets. Worked perfectly, first time. Dev, Prod, all fine. Yay. So I then tried it with another site with more pages and many more assets (mainly images). This time, the publish failed :(

It seems to be at the point where it uploads all the site's static files to KV. The time out seems too short ... can it be increased? I guess this is outside of wrangler but maybe that request could be passed on. Since I can see it using the /bulk operation which makes sense. However I'd think someone would only be using the /bulk API if they were uploading a lot and so would need a generous timeout, even outside of Workers Sites.

It's not clear from the error if it is a timeout with one file (like too big, and so timing out) or the entire operation (too many files within its allowed time)

I'd guess there are maybe 500 files.

What did you expect to see?

The publish to successfully complete

What did you see instead?

$ wrangler publish --env dev
πŸŒ€ Using namespace for Workers Site "__name-dev-workers_sites_assets"
πŸ’ ignoring file .DS_Store
πŸ’ ignoring file .DS_Store
πŸ’ Uploading...
Error: ⚠️ Error: https://api.cloudflare.com/client/v4/accounts/longidhere/storage/kv/namespaces/longidhere/bulk: timed out

@ashleymichal
Copy link
Contributor

thanks @gregmsanderson for the bug report! we've notified the team that works on the KV API and are working out a solution with them. That team is internal to Cloudflare so I can't necessarily link you to an issue to track, but I'll update here when we have a fix.

@ashleymichal ashleymichal added bug Something isn't working external bug labels Sep 30, 2019
@ashleymichal ashleymichal self-assigned this Sep 30, 2019
@bretthoerner
Copy link

@gregmsanderson I'm curious approximately how long it's taking before it times out. If this is repeatable I wonder if you could prefix your command with time (if you're on Mac/Linux).

It would be awesome for wrangler to print the time taken and the Ray ID (if there is one).

@ashleymichal
Copy link
Contributor

ashleymichal commented Sep 30, 2019

it looks like we need to increase the default timeout on the client that Wrangler uses for these requests; we use reqwest (via cloudflare-rs) with no increase to the default timeout of 30s. I'm going to update the name of this ticket and we'll triage ASAP.

@ashleymichal ashleymichal changed the title Error during publish to Workers Sites: bulk timed out Wrangler timeout too short for bulk uploads Sep 30, 2019
@gregmsanderson
Copy link
Author

Hey @ashleymichal @bretthoerner

Yes, It seemed to give up after about a minute. May well have been even less, like 30s, since as you say there is no time report on the output, and I didn't run a stopwatch or anything to see exactly when. I just assumed it had some timeout-after-X rule that it was hitting.

I wasn't aware of that time command. That would indeed have helped.

Unfortunately I'm currently unable to do that for you. Earlier on today I had an idea to bypass the problem. Since the upload was timing out, I needed a faster way to upload to your server. Since there's nothing I can do about the connection from here, I figured I would instead run wrangler publish from a server I assume is near yours, using the CircleCI service. If not, at least with a faster network. And indeed I was right: their connection to you is super-fast. Watching the output of wrangler publish in their system, the bulk upload operation sails by. Hundreds of files upload in seconds. And so the bulk operation does not time out when run from there. And the operation completes.

So if I were to now publish myself, that will confuse things. But it sounds like Ashley is on the case and so that won't be needed. And it's less of an issue for me now since I might as well stick with CircleCI. But I'm sure it will be useful for others to increase that timeout a little.

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants