Closed danbars closed 2 years ago
EDIT: googling this error brings tons of results all related to Sentry. Is there a dependency on Sentry from wrangler?
Can anyone please look at this? I have 2 paying accounts and blocked from working!
Same problem. One workaround, I've found, is using sudo
for the wrangler dev
as it seems to work if the account that wrangler is coming from isn't logged in. If you run sudo wrangler login
or sudo wrangler config
and login with root
, as wrangler tells you to, it breaks.
@danbars, sorry you've been waiting on a response for this. I attempted to reproduce but haven't been able to track down the error yet. It may be an environment issue with npm
. Have you tried clearing your cache and node_modules like so?
@nataliescottdavidson @solbloch @danbars just fixed this by commenting route
and setting workers_dev=true
in wrangler.toml
I found that the bug originates from here: https://github.com/cloudflare/wrangler/blob/b1a9fa5d139c9341b84f12fa98523fe04742718e/src%2Fcommands%2Fdev%2Fedge%2Fsetup.rs#L164 (Tagging @EverlastingBugstopper as I see you in the git history)
I printed the URL and API token, then made a call from an HTTP client. Here are the response headers (probably useless info but you may never know):
date: Wed, 23 Dec 2020 10:33:09 GMT
content-length: 0
cf-ray: 60616c30298cf951-BRU
cf-cache-status: DYNAMIC
cf-request-id: 0730c1f2150000f951113c7000000001
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
x-envoy-upstream-service-time: 91
server: cloudflare
The body is empty.
I doubt this is a wrangler-related issue. It seems to be a problem with the backend.
By the way, I believe this to be a critical bug. I experienced it while strictly following the Getting Started guide of Cloudflare Workers, meaning that any new person testing the platform might experience it as well.
Just trying to test my first 'hello world' worker and I'm hitting this issue currently.
I've just tried commenting out the route and zone_id in my wrangler.toml as suggested by @meoyawn but unfortunately that didn't work in my case.
node -v
: v10.19.0
wrangler --version
: wrangler 1.12.3
OS = Ubuntu 20.04.1 LTS
I used wrangler config
to configure my access token
I've just done wrangler generate -t javascript test
and then set my account_id
in wrangler.toml
Just for reference I tried some older versions of wrangler (back to 1.11.0) but they all just report:
Error: EOF while parsing a value at line 1 column 0
As suggested by @solbloch this issue seems related to the login since I don't see this issue if remove my default.toml with my authentication token. (Or at least it says Running preview without authentication
and Listening on http://127.0.0.1:8787
)
Is there going to be some subtle difference between using wrangler login
vs wrangler config
perhaps? It's awkward for me to test wrangler login
instead on the machine I'm currently using.
Ok, so actually I was able to try out using wrangler login
and after it opened a browser window (Firefox) and I clicked to authorize it then it created a new token ok and said I could close the window. On the terminal though it was just stuck forever waiting for the new token :-/ (which sounds like this other issue: https://github.com/cloudflare/wrangler/issues/1514 which others are hitting so I don't really know why it's closed)
Based on some comments for that issue I tried out deleting the token I created manually and the new token created but even then wrangler login
still just hangs forever waiting for the token.
This is really not an impressive out of box experience so far :-(
Although probably unrelated to this I filed a separate issue for the fact that wrangler login
hangs forever for me here: https://github.com/cloudflare/wrangler/issues/1703 since #1514 looks like it was originally for a different issue (even though there are a number of recent comments about seeing the same hang I see)
In an effort to get a bit more detail with the error I ran with RUST_LOG=debug
but didn't really get any more insight:
[2020-12-28T21:56:54Z INFO wrangler::settings::global_config] No $WRANGLER_HOME detected, using $HOME
[2020-12-28T21:56:54Z INFO wrangler] Starting dev server
[2020-12-28T21:56:54Z INFO wrangler::settings::global_config] No $WRANGLER_HOME detected, using $HOME
[2020-12-28T21:56:54Z INFO wrangler::settings::global_config] Using global config file: /home/rib/.wrangler/config/default.toml
[2020-12-28T21:56:54Z INFO wrangler::settings::global_user] Config path exists. Reading from config file, /home/rib/.wrangler/config/default.toml
[2020-12-28T21:56:54Z DEBUG reqwest::connect] starting new connection: https://api.cloudflare.com/
[2020-12-28T21:56:54Z DEBUG hyper::client::connect::dns] resolving host="api.cloudflare.com"
[2020-12-28T21:56:54Z DEBUG hyper::client::connect::http] connecting to 104.19.192.29:443
[2020-12-28T21:56:54Z DEBUG hyper::client::connect::http] connecting to [2606:4700:300a::6813:c11d]:443
[2020-12-28T21:56:54Z DEBUG hyper::client::connect::http] connecting to [2606:4700:300a::6813:c01d]:443
[2020-12-28T21:56:56Z DEBUG hyper::client::connect::http] connected to 104.19.192.29:443
[2020-12-28T21:56:57Z DEBUG hyper::proto::h1::io] flushed 232 bytes
[2020-12-28T21:56:58Z DEBUG hyper::proto::h1::io] read 663 bytes
[2020-12-28T21:56:58Z DEBUG hyper::proto::h1::io] parsed 11 headers
[2020-12-28T21:56:58Z DEBUG hyper::proto::h1::conn] incoming body is empty
[2020-12-28T21:56:58Z DEBUG hyper::client::pool] pooling idle connection for ("https", api.cloudflare.com)
[2020-12-28T21:56:58Z DEBUG reqwest::async_impl::client] response '200 OK' for https://api.cloudflare.com/client/v4/accounts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/workers/subdomain/edge-preview
Error: EOF while parsing a value at line 1 column 0
I also tried printing out the json being parsed (as found by @yacinehmito) and can at least confirm that I basically see the same thing - the response contents being parsed are empty....
URL=https://api.cloudflare.com/client/v4/accounts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/workers/subdomain/edge-preview
RESPONSE=Response {
url: Url { scheme: "https", host: Some(Domain("api.cloudflare.com")),
port: None,
path: "/client/v4/accounts/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/workers/subdomain/edge-preview",
query: None,
fragment: None },
status: 200,
headers: {
"date": "Mon, 28 Dec 2020 22:15:05 GMT",
"content-length": "0",
"connection": "keep-alive",
"cf-ray": "608ea348feb0f42b-LHR",
"cf-cache-status": "DYNAMIC",
"cf-request-id": "074d04619f0000f42b3ca74000000001",
"expect-ct": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"",
"x-envoy-upstream-service-time": "61",
"server": "cloudflare"
} }
TEXT=""
Error: EOF while parsing a value at line 1 column 0
Going to give up at this point for now I think :/ - as @yacinehmito suggests, it looks like a backend issue at this point or at least some kind of assumption about something that's maybe supposed to be configured on the backend but isn't?
Aaaah, okeeey, my last hunch pointed me in the right direction, the issue for me was that I had to first explicitly navigate to "Workers" in the Cloudflare console and select Manage Workers
to first create a workers.dev
subdomain (which also requires agreeing to terms to use workers and selecting a usage tier).
It would of course be suuuuuper helpful if wrangler could print a really clear message in this situation which I imagine is going to be really common for a first time user who hasn't yet used Workers. From all the docs I'd seen none of them said to explicitly enable them via the console first!
hmmm, actually after a timeout now I'm hitting a different error...
I now get as far as Listening on http://127.0.0.1:8787
and it looks like it's working but then see:
thread 'tokio-runtime-worker' panicked at 'Failed to connect to devtools instance: Http(504)', src/commands/dev/socket.rs:29:14
:-/
Looks like this is the next issue: https://github.com/cloudflare/wrangler/issues/1510 :-/
...yeah, I'd say I'm definitely getting concerned about whether this stuff is really sensible to consider using after hitting three separate wrangler
issues back to back all related to trying out the most basic Hello World worker. :/
I get this error as well just following the very basic Getting Started guide here: https://developers.cloudflare.com/workers/learning/getting-started
Wrangler: 1.12.3 NPM: 6.14.4 Node: 13.12.0
I get this error as well just following the very basic Getting Started guide here: https://developers.cloudflare.com/workers/learning/getting-started
Wrangler: 1.12.3 NPM: 6.14.4 Node: 13.12.0
Update: I had to setup a Worker sub-domain on the CF admin site before wrangler dev or wrangler publish would work.
@nataliescottdavidson this is also happening for me again. Given all the activity on this ticket I think you should investigate.
Happens also with wrangler 1.12.3
Let me know if you need more info.
@rita3ko or anyone from cf team - can you assign someone to this ticket?
It is impossible to have a proper dev lifecycle with that issue. I can't locally test any code. Only option is to publish and hope for the best. This turns development into a long nightmare (code > publish > wait > refresh > test) and if it breaks rollback, etc, and of course it affects customers in production
@yacinehmito had suggested where the fault is https://github.com/cloudflare/wrangler/issues/1583#issuecomment-750112648
FYI - I opened a support ticket number 2084430
@rib thank you for your investigation, it's spot on. We identified a missing check for the existence of a chosen workers.dev subdomain, and once we return a proper error for that case we can update wrangler to provide a nicer error message here.
I believe this would manifest as a 500 with an "Internal Server Error" as the body, not a 200 with an empty body however, and I'd like to figure out how to reproduce the empty response body case.
@danbars I see in your original issue you were hitting this problem when using wrangler dev on a route, rather than with workers_dev = true.
wrangler subdomain
or in the dashboard?wrangler dev
?I'm struggling to reproduce the exact empty response body that you are experiencing, and I want to make sure my test account is as close to your situation as possible.
Hi @xortive,
I never used wrangler subdomain
. All my configurations were done manually. I'll try now again with a new worker and let you know.
@xortive , I just started a fresh worker and recorded step by step exactly what I did to reproduce. I also wrote the things that are seemingly unrelated. Hope this helps.
After the first 5 steps I can run wrangler dev
. But then after completing the process, it fails with the error
test-wrangler
wrangler init
npm init
to create a package.json fileaddEventListener('fetch', (event) => {
event.respondWith(new Response("HELLO"));
});
At this point wrangler dev
works properly
https://test.form-data.com/*
workers.dev
mappingtest
subdomain with IPs 151.101.1.195
and 151.101.65.195
workers_dev = false
route = "https://test.form-data.com/*"
zone_id = "f6bxxxxxxxxxxxe15"
wrangler publish
wrangler dev
Now the error happens
Error: EOF while parsing a value at line 1 column 0
I did try to run wrangler subdomain
at this point, but it seems to only allow configuring workers.dev subdomain. Did I miss something?
@danbars is the apex A record for form-data.com
configured to be proxied by cloudflare (orange cloud in the dash). If not, and if it's possible to turn that on, can you do that and see if this fixes your problem?
Currently, wrangler dev
requires that the apex A record of your zone is proxied by cloudflare. We'll work on documenting this better, but unfortunately it's not something we can change in the short-term.
Hi @xortive,
The apex A record is not proxied by cloudflare. At the moment I can't change that because my website is hosted at Wix which doesn't work via this proxy. At the end of the month I'll be transferring the site to cf site-workers and then I'll be able to check it.
Question - if I keep something.workers.dev mapping for the worker in addition to my domain mapping, will this allow me to run it? It may be a reasonable workaround.
Anyway - good that you've identified the reason, and proper documentation will indeed save a lot of frustration to others.
Yeah, if you can adequately test your worker using the workers.dev mapping, that is a good work around for the time being.
On Tue, Mar 9, 2021 at 2:47 AM danbars notifications@github.com wrote:
Hi @xortive https://github.com/xortive,
The apex A record is not proxied by cloudflare. At the moment I can't change that because my website is hosted at Wix which doesn't work via this proxy. At the end of the month I'll be transferring the site to cf site-workers and then I'll be able to check it.
Question - if I keep something.workers.dev mapping for the worker in addition to my domain mapping, will this allow me to run it? It may be a reasonable workaround.
Anyway - good that you've identified the reason, and proper documentation will indeed save a lot of frustration to others.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudflare/wrangler/issues/1583#issuecomment-793496612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEKLUMELEWU6HAIGSGNWYTTCXG7TANCNFSM4SEZYVIA .
-- Sincerely, Matthew Alonso
he/him/his - Workers Distributed Data - Systems Engineer
This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. You may re-open the issue if it is still relevant.
🐛 Bug Report
Environment
operating system: Mac Mojave 10.14.6
output of
rustc -V
:command not found
output of
node -v
:v11.10.1
output of
wrangler -V
:👷 ✨ wrangler 1.11.0
contents of
wrangler.toml
Steps to reproduce
At first everything worked great.
wrangler dev
ran the code locally as expected. After the first time that I published usingwrangler publish
, suddenlywrangler dev
stopped working.publish
andbuild
still works which is why I think it's not related to my code. The error that I get when I runwrangler dev
is this:The verbose log file has this: