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

🐛 BUG: [pages + windows] Could not automatically determine proxy port #1587

Closed
Skye-31 opened this issue Jul 31, 2022 · 3 comments · Fixed by #1649
Closed

🐛 BUG: [pages + windows] Could not automatically determine proxy port #1587

Skye-31 opened this issue Jul 31, 2022 · 3 comments · Fixed by #1649
Labels
bug Something that isn't working pages:validated A validated Pages issue pages Relating to Pages

Comments

@Skye-31
Copy link
Contributor

Skye-31 commented Jul 31, 2022

What version of Wrangler are you using?

2.0.24

What operating system are you using?

Windows

Describe the Bug

This specifically occurs when the directory which wrangler is being run in is in a different disk than the directory that netstat is located.

For example, in this case, netstat is located on my C: drive, whereas my code is located on my F: drive. It incorrectly searches the F drive for the file, which does not exist. Creating a symlink or copying the executable into the correct path does resolve this for me, however that's obviously not a real solution.

🚧 'wrangler pages <command>' is a beta command. Please report any issues to https:/cloudflare/wrangler2/issues/new/choose
Running npm run dev...
Sleeping 5 seconds to allow proxy process to start before attempting to automatically determine port...
To skip, specify the proxy port with --proxy.
[proxy]: 
> [email protected] dev
> svelte-kit dev --host


No Instance(s) Available.
The system cannot find the path specified.
X [ERROR] Error scanning for ports of process with PID 5252: Error: Command failed: \windows\system32\netstat.exe -nao

  The system cannot find the path specified
@Skye-31 Skye-31 added bug Something that isn't working pages Relating to Pages labels Jul 31, 2022
@Skye-31 Skye-31 changed the title 🐛 BUG: [pages] Could not automatically determine proxy port 🐛 BUG: [pages + windows] Could not automatically determine proxy port Jul 31, 2022
@Skye-31
Copy link
Contributor Author

Skye-31 commented Jul 31, 2022

Found this which may be of use? https:/balena-io-modules/drivelist, as it includes which is the system drive (where netstat is located)
I imagine this issue may actually be present across all operating systems, but have no way of testing currently.

@WalshyDev
Copy link
Member

Ok, so the issue for this lies here:
https:/cloudflare/wrangler2/blob/d4fbd0be5f5801c331a76709cb375a9386117361/packages/wrangler/src/pages/dev.tsx#L322

Looks like Wrangler already has logic to see if a port is in use and wait for it to be available/error. We may be best just using this logic:
https:/cloudflare/wrangler2/blob/d4fbd0be5f5801c331a76709cb375a9386117361/packages/wrangler/src/proxy.ts#L420

Looks like this would have correctly errored for the port in use here.

@WalshyDev WalshyDev added the pages:validated A validated Pages issue label Aug 2, 2022
@Skye-31
Copy link
Contributor Author

Skye-31 commented Aug 2, 2022

The purpose of this is to automatically determine which port to proxy, not to check if a port has been proxied

Skye-31 added a commit that referenced this issue Aug 10, 2022
Skye-31 added a commit that referenced this issue Aug 12, 2022
* fix: [windows] unable to find netstat

Closes #1587
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working pages:validated A validated Pages issue pages Relating to Pages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants