Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A couple of bugs I faced today (dev, publish) #316

Closed
threepointone opened this issue Jan 26, 2022 · 5 comments
Closed

A couple of bugs I faced today (dev, publish) #316

threepointone opened this issue Jan 26, 2022 · 5 comments

Comments

@threepointone
Copy link
Contributor

threepointone commented Jan 26, 2022

Today on my personal laptop, I used wrangler and faced some issues. If necessary I'll file separate issues for each of these problems, but just filing these right now while the details are still fresh -

  • I made a file index.ts with contents
    export default {
      fetch() {
        return new Response("hello world");
      },
    };
    and ran npx wrangler@beta dev index.ts on it. It returned -
    No account id found, quitting...
    I think this means that both the oauth_code and refresh_code were invalid. In such a scenario, we should popup the login flow again. I manually ran npx wrangler@beta login and 'fixed' this issue.
  • I then tried to publish it with npx wrangler publish index.js --name devto --latest (and I didn't have a script named devto already published). It did nothing for a long time (say, 20 seconds), and then this error got logged
    Cannot read properties of undefined (reading 'forEach')
    I think this is pointing to this line of code https://github.com/cloudflare/wrangler2/blob/b63efe60646c8c955f4df4f2ce1d87ce9cc84ba3/packages/wrangler/src/cfetch/index.ts#L93
    • We should include stacks in our errors here https://github.com/cloudflare/wrangler2/blob/a5537f147e61b046e141e06d1864ffa62e1f2673/packages/wrangler/src/index.tsx#L2034-L2045 (logging e.stack instead of e.message). If we think these are noisy, then we should handle expected errors properly, and exit with process.exit(1) instead of throwing.
    • It looks like there are failure modes for api calls we haven't considered. Specifically, it's possible for the api to not follow the api schema (which, makes sense, networks suck). We should be more defensive in how we handle data structures off the network (In this case, testing whether messages exists on the response)
    • running the command again published the worker successfully.
  • When running dev, using the hotkey l to toggle between edge - local - edge logged this error
    17:48:12 Error: listen EADDRINUSE: address already in use :::8787
      at Server.setupListenHandle [as _listen2] (node:net:1334:16)
      at listenInCluster (node:net:1382:12)
      at Server.listen (node:net:1469:7)
      ...
    
    This means that we're not shutting down the miniflare server cleanly, or maybe we're trying to startup the remote proxy too soon after switching (before the miniflare server has closed).
@Electroid Electroid added the bug label Jan 27, 2022
@Electroid Electroid added this to the 2.0 milestone Feb 3, 2022
@Electroid Electroid moved this to Non-blocking in workers-sdk Feb 7, 2022
@tanguyantoine
Copy link

experienced the same issue while using wrangler dev

wrangler login did not solve the issue

threepointone added a commit that referenced this issue Mar 26, 2022
If the auth refresh token isn't valid, then we should trigger the login flow. Reported in #316
threepointone added a commit that referenced this issue Mar 26, 2022
If the auth refresh token isn't valid, then we should trigger the login flow. Reported in #316
threepointone added a commit that referenced this issue Mar 26, 2022
If the auth refresh token isn't valid, then we should trigger the login flow. Reported in #316
threepointone added a commit that referenced this issue Mar 26, 2022
If the auth refresh token isn't valid, then we should trigger the login flow. Reported in #316
@threepointone
Copy link
Contributor Author

This should be in a better place now. We still need to handle error messages better and present them in a better manner, tracking that in #377. Closing this issue. @tanguyantoine let us know if you face the issue again, thank you!

Repository owner moved this from Should-have to Done in workers-sdk Apr 1, 2022
@tanguyantoine
Copy link

actually, I still have the same message

No account id found, quitting...

@threepointone
Copy link
Contributor Author

Oh really? Have you just not been able to login? Does it open the browser and ask you for permissions? Please share any information you may have.

@tanguyantoine
Copy link

Sorry I switched back on something else, I might give it another shot later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants