coder/code-server

[BUG]: Editor window keeps returning with a "Invalid URL" error message

Closed this issue · 9 comments

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser: Google Chrome
  • Local OS: Windows 11
  • Remote OS: Ubuntu Server (running in a Docker container)
  • Remote Architecture: arm64
  • code-server --version: 4.103.2 54b33a75e0b4593b77f9a217323c4b27a42f4073 with Code 1.103.2

Steps to Reproduce

  1. Open code-server in Google Chrome
  2. Tried to reload the page like it asked
  3. Nothing worked

Expected

It was supposed to load the entire workspace editor without any problems

Actual

It only returns with the "Invalid URL" error message and it doesn't go away even if I reload the page or by changing some of my nginx configuration settings to see if it works from there

Logs

Screenshot/Video

Image

Does this bug reproduce in native VS Code?

I did not test native VS Code

Does this bug reproduce in GitHub Codespaces?

I did not test GitHub Codespaces

Are you accessing code-server over a secure context?

  • I am using a secure context.

Notes

No response

Could you paste the browser console logs?

Hmm the file paths and line numbers are truncated but assuming this is browser/workbench.ts, the only new URL I see is this one: https://github.com/microsoft/vscode/blob/f220831ea2d946c0dcb0f3eaa480eb435a2c1260/src/vs/code/browser/workbench/workbench.ts#L417

What happens if you run new URL(document.location.href) in the browser console?

Or, it could be a different file. Can you expand that error?

Sure thing! Here's the output to the new URL(document.location.href) command.
Image

As for the Invalid URL error, here's the output for that as well.
Image

If you need to see the host name for the editor, I can send it to you privately since I have it restricted for only a list of IP addresses that are able to access it through Cloudflare. Let me know if that's okay with you because I had to censor it out for the new URL(document.location.href) command output.

No need for the full hostname I think, just wanted to see if it gave you the same error. It must be something else if running that manually works without error.

Hmm is that the full stack trace? It seems to still be missing the original error source.

Just to double check, are you able to access directly via IP address or some other means like port forwarding? Does it give the same error in those cases?

I am able to access it via the servers IP address, and it still gives me the same error message as before.

Interesting, so the issue is not related to the reverse proxy then.

Were you able to check if that was the full error stack? You should be able to right click and copy the whole thing as text.

I don't how, but I've managed to fix it by changing my docker-compose.yml file for the environment variables and the user that is able to access the data from the container to the host. My guess is that either the VSCODE_PROXY_URI or PROXY_DOMAIN are the reason for the error to occur, but I haven't figured it out until now.