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

turbo login crashed #7111

Open
1 task done
the1812 opened this issue Jan 26, 2024 · 4 comments
Open
1 task done

turbo login crashed #7111

the1812 opened this issue Jan 26, 2024 · 4 comments
Labels
area: docs Improvements or additions to documentation kind: bug Something isn't working linear: turbo Issues to sync to Linear for Turborepo team owned-by: turborepo

Comments

@the1812
Copy link

the1812 commented Jan 26, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/vercel/turbo/tree/main/examples

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Windows

Which canary version will you have in your reproduction?

1.11.4-canary.2

Describe the Bug

I'm trying to setup Remote Caching following the docs:

For Local Development

If you want to link your local turborepo to your Remote Cache, first authenticate the Turborepo CLI with your Vercel account:

turbo login

When I run turbo login, my browser opened vercel authorize page but turbo CLI crashed instantly.

>>> Opening browser to https://vercel.com/turborepo/token?redirect_uri=http%3A%2F%2F127.0.0.1%3A9789
>   Waiting for your authorization...
Oops! Turbo has crashed.

A report has been written to <report-path>

Please open an issue at https://github.com/vercel/turbo/issues/new/choose and include this file

Expected Behavior

turbo CLI should not crash but pick another port. See additional context below.

To Reproduce

Install turbo and run login command.

turbo login

Additional context

Looks like listening on the 9789 port (and nearby ports) is not allowed in Windows. I confirmed no other process is using this port. Using serve can get similar result.

serve . -p 9789

> Error: Failed to serve: Error: listen EACCES: permission denied 0.0.0.0:9789

serve . -p 9790

> Error: Failed to serve: Error: listen EACCES: permission denied 0.0.0.0:9790

serve . -p 9788

> Error: Failed to serve: Error: listen EACCES: permission denied 0.0.0.0:9788

serve . -p 9700

> Serving!  Local: http://localhost:9700

Full crash report:

name = "turbo"
operating_system = "Windows 10.0.22621 (Windows 11 Professional) [64-bit]"
crate_version = "1.11.4-canary.2"
explanation = '''
file 'crates\turborepo-auth\src\server\login_server.rs' at line 55
'''
cause = "failed to start one-shot server: Os { code: 10013, kind: PermissionDenied, message: \"以一种访问权限不允许的方式做了一个访问套接字的尝试。\" }"
method = "Panic"
backtrace = """

   0: 0x7ff6d6cc2d6c - <turborepo_auth[38843eb57d908cdd]::server::login_server::DefaultLoginServer as turborepo_auth[38843eb57d908cdd]::server::login_server::LoginServer>::run::{closure#0}
   1: 0x7ff6d71d4537 - turborepo_lib[4973cb2f3dc246b]::cli::run::{closure#0}.43719
   2: 0x7ff6d70160c1 - <tokio[bd8e5df648212ddb]::runtime::context::blocking::BlockingRegionGuard>::block_on::<turborepo_lib[4973cb2f3dc246b]::cli::run::{closure#0}>
   3: 0x7ff6d6e380bb - turborepo_lib[4973cb2f3dc246b]::cli::run
   4: 0x7ff6d6fcb49b - turborepo_lib[4973cb2f3dc246b]::shim::run_correct_turbo
   5: 0x7ff6d6fc6a4b - turborepo_lib[4973cb2f3dc246b]::shim::run
   6: 0x7ff6d6c429f9 - turbo[1fe347dfaa3bc217]::main
   7: 0x7ff6d6c502a6 - std[7e3e6971e24a0245]::sys_common::backtrace::__rust_begin_short_backtrace::<fn() -> core[ed979114aa864e25]::result::Result<(), anyhow[530d6f32f0979061]::Error>, core[ed979114aa864e25]::result::Result<(), anyhow[530d6f32f0979061]::Error>>
   8: 0x7ff6d6c50040 - std[7e3e6971e24a0245]::rt::lang_start::<core[ed979114aa864e25]::result::Result<(), anyhow[530d6f32f0979061]::Error>>
   9: 0x7ff6d65712ef - __tmainCRTStartup
  10: 0x7ff6d6571406 - mainCRTStartup
  11: 0x7ffc853f26ad - <unresolved>
  12: 0x7ffc864ea9f8 - <unresolved>"""

TURBO-2188

@the1812 the1812 added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Jan 26, 2024
@mehulkar
Copy link
Contributor

I haven't been able to get my Windows box running.. can you confirm that these specific ports are blocked on Windows in general or is it something specific to your machine? If it's the former, some Windows documentation about this would be useful also.

I can see a case for port finding in general here, but if it's specific to our machine, we will think about priority differently than if it's a problem for all Windows users by default.

@the1812
Copy link
Author

the1812 commented Jan 27, 2024

I checked blocked ports using:

netsh interface ipv4 show excludedportrange protocol=tcp
Start Port    End Port
----------    --------
      1118        1217
      1318        1417
      1418        1517
      5357        5357
      7390        7489
     14229       14328
     14412       14511
     14536       14635
     14839       14938
     50000       50059

Wikipedia have no record for 9789 port.
But I found running turbo login in an elevated shell solved the problem. And after that a normal shell can listen on 9789.

@mehulkar
Copy link
Contributor

@the1812 thanks for looking into that. So do you think this is a problem for turbo to solve? It sounds specific to your setup. I am sure we could add some port finding mechanism, but I'm leaning towards documenting instead.

@the1812
Copy link
Author

the1812 commented Jan 30, 2024

It sounds specific to your setup.

Yes, leaving some documentation should be fine.

@mehulkar mehulkar added area: docs Improvements or additions to documentation linear: turbo Issues to sync to Linear for Turborepo team and removed needs: author input needs: triage New issues get this label. Remove it after triage labels Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Improvements or additions to documentation kind: bug Something isn't working linear: turbo Issues to sync to Linear for Turborepo team owned-by: turborepo
Projects
None yet
Development

No branches or pull requests

2 participants