wrangler-legacy icon indicating copy to clipboard operation
wrangler-legacy copied to clipboard

'wrangler publish' panic with invalid api_token in some cases

Open kevi-sun opened this issue 1 year ago • 0 comments

We had a test with an invalid api_token to publish the Cloudflare worker and it panicked on one of our servers, I tried to test in my local docker and it doesn't panic.

We use a rust app to call the wrangler command, the child process is triggered with rust crate std::process::Command to trigger the publish the script and the following is some log from the console, it is weird that the wrangler build exists with 0 which make us hard to capture this error.

[2022-08-10 14:02:21] Error: Something went wrong with the request to Cloudflare...
[2022-08-10 14:02:21] Authentication error [API code: 10000][2022-08-10T04:02:21Z INFO wrangler::settings::global_config] No $WRANGLER_HOME detected, using $HOME
[2022-08-10 14:02:21]
[2022-08-10 14:02:21] Oops! Wrangler encountered an error:
[2022-08-10 14:02:21]
[2022-08-10 14:02:21] panicked at 'range start index 2 out of range for slice of length 1', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.56/src/backtrace.rs:264:19
[2022-08-10 14:02:21]
[2022-08-10 14:02:21] Please help Cloudflare debug this issue by submitting the error report
[2022-08-10 14:02:21] (/root/.wrangler/errors/1660104141296.log)
[2022-08-10 14:02:21]
[2022-08-10 14:02:21] To submit this error report to Cloudflare, run:
[2022-08-10 14:02:21]
[2022-08-10 14:02:21] $ wrangler report
[2022-08-10 14:02:21]
[2022-08-10 14:02:21] [2022-08-10T04:02:21Z INFO zzz_cloudflare_builder::wrangler] Wrangler publish status: ExitStatus(unix_wait_status(0))

I also tried to reproduce it in my local docker with an invalid api_token and I failed to reproduce it, but it happens multiple times recently on the server with an invalid api_token.

please also see the wrangler log file and toml file

wrangler.txt wrangler.log

kevi-sun avatar Aug 10 '22 04:08 kevi-sun