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

Blank white page after authentication when using Safari with Nginx reverse-proxy but works fine with Chrome #3850

Closed
skrenes opened this issue Jul 25, 2021 · 18 comments
Labels
browser-safari Safari related bug Something isn't working high-priority This issue needs to be resolved ASAP
Milestone

Comments

@skrenes
Copy link

skrenes commented Jul 25, 2021

OS/Web Information

  • Web Browser: Safari 14.1.1
  • Local OS: Debian GNU/Linux 10 (buster) hosting docker (linuxserver/code-server:latest)
  • Remote OS: Mac OS Big Sur 11.4
  • Remote Architecture: x86 / MacBook Pro (16-inch, 2019)
  • code-server --version: v3.11.0

Steps to Reproduce

  1. Setup Nginx reverse proxy with the following differences:
    1. Code-Server runs in a docker container, while Nginx runs in a separate container
    2. Code-Server listens on regular http://Code-Server:8443/ while Nginx listens on secure https://nas.example.com:8080/
  2. Load up page in Safari.
  3. Enter password
  4. See blank white page
  5. Repeat steps 2 and 3 in Chrome and it works fine.

Actual

Chrome works fine, though it also has errors in the console. I have coded projects with it just fine, but Safari fails after trying to sign in. I enter the pasword and press enter and I get a white page. No number of refreshes corrects the issues (and it no longer asks me for the password unless I purge cookies or launch a new private tab). I prefer Safari when on battery as I get an extra several hours of usage.

Logs

The Safari (results in white/blank page) and Chrome (works correctly despite errors) console logs are below. As a note, I've changed the domain to be nas.domain.com for privacy and this is after entering the correct password and pressing submit:

Safari

[Error] Something went wrong setting the body background to the theme background color.
	(anonymous function) (vscode.browserified.js:673)
	o (vscode.browserified.js:1:270)
	r (vscode.browserified.js:1:433)
	Global Code (vscode.browserified.js:1:461)
[Error] Error: [vscode] Could not set body background to theme background color. Could not find colorThemeData in localStorage. — vscode.browserified.js:642
	(anonymous function) (vscode.browserified.js:674)
	o (vscode.browserified.js:1:270)
	r (vscode.browserified.js:1:433)
	Global Code (vscode.browserified.js:1:461)
[Error] Failed to load resource: the server responded with a status of 404 () (serviceWorker.js, line 0)
[Log] error [Service Worker] registration: Script https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/dist/serviceWorker.js load failed undefined (vscode.browserified.js, line 129)
[Error] WebSocket network error: The operation couldn’t be completed. (OSStatus error -9836.) (x2)
[Log]   ERR – "[remote-connection][Management   ][2de44…][initial][nas.domain.com:80] socketFactory.connect() failed or timed out. Error:" (workbench.web.api.js, line 627)
[Log]   ERR – Error: WebSocket close with status code 1006 (workbench.web.api.js, line 627)
Error: WebSocket close with status code 1006
[Log]   ERR – "[remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:" (workbench.web.api.js, line 627)
[Log]   ERR – Error: WebSocket close with status code 1006 (workbench.web.api.js, line 627)
Error: WebSocket close with status code 1006
[Log]   ERR – Error: WebSocket close with status code 1006 (workbench.web.api.js, line 627)
Error: WebSocket close with status code 1006
[Log]  WARN – "Ignoring the error while validating workspace folder vscode-remote://nas.domain.com/config/workspace - WebSocket close with statu…" (workbench.web.api.js, line 627)
"Ignoring the error while validating workspace folder vscode-remote://nas.domain.com/config/workspace - WebSocket close with status code 1006"
[Log]   ERR – "JSON Parse error: Unexpected identifier \"undefined\": parse@[native code…" (workbench.web.api.js, line 627)
"JSON Parse error: Unexpected identifier \"undefined\": parse@[native code]
ai@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2303:6177720
_createInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951915
_createAndCacheServiceInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1953533
_safeCreateAndCacheServiceInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1952730
get@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951016
initLayout@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2722:8077526
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2722:8124854
invokeFunction@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1950859
startup@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2722:8124715
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2848:8697667
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]
promiseReactionJob@[native code]"
[Log]   ERR – "Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/settings.json' (Error: WebSocket close with status cod…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/settings.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Log]   ERR – "Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/tasks.json' (Error: WebSocket close with status cod…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/tasks.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Log]   ERR – "Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/launch.json' (Error: WebSocket close with status cod…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/launch.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Warning] The web worker extension host is started without an iframe sandbox! (workbench.web.api.js, line 1867)
[Log]   ERR – "Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/settings.json' (Error: WebSocket close with status cod…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/settings.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Log]   ERR – "Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/tasks.json' (Error: WebSocket close with status cod…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/tasks.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Log]   ERR – "Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/launch.json' (Error: WebSocket close with status cod…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote://nas.domain.com/config/workspace/.vscode/launch.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Error] Error: WebSocket close with status code 1006

O@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2152101
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2153860
	(anonymous function) (workbench.web.api.js:8)
[Log]   ERR – "Unable to read file 'vscode-remote:/config/data/User/settings.json' (Error: WebSocket close with status code 1006)…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote:/config/data/User/settings.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Log]   ERR – "Unable to read file 'vscode-remote:/config/data/User/tasks.json' (Error: WebSocket close with status code 1006)…" (workbench.web.api.js, line 627)
"Unable to read file 'vscode-remote:/config/data/User/tasks.json' (Error: WebSocket close with status code 1006): _@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:624:1932241
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2040081
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]"
[Error] SyntaxError: JSON Parse error: Unexpected identifier "undefined"
	parse (workbench.web.api.js:2303:6177721)
	ai (workbench.web.api.js:2303:6177721)
	_createInstance (workbench.web.api.js:625:1951916)
	_createAndCacheServiceInstance (workbench.web.api.js:625:1953534)
	_safeCreateAndCacheServiceInstance (workbench.web.api.js:625:1952731)
	_createInstance (workbench.web.api.js:625:1951521)
	createInstance (workbench.web.api.js:625:1951345)
	acquireInstantiationService (workbench.web.api.js:2403:6568132)
	(anonymous function) (workbench.web.api.js:2722:8125585)
[Log]   ERR – "WebSocket close with status code 1006: O@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.c…" (workbench.web.api.js, line 627)
"WebSocket close with status code 1006: O@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2152101
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2153860"
[Log]   ERR – "JSON Parse error: Unexpected identifier \"undefined\": parse@[native code…" (workbench.web.api.js, line 627)
"JSON Parse error: Unexpected identifier \"undefined\": parse@[native code]
ai@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2303:6177720
_createInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951915
_createAndCacheServiceInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1953533
_safeCreateAndCacheServiceInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1952730
get@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951016
initLayout@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2722:8077526
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2722:8124854
invokeFunction@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1950859
startup@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2722:8124715
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2848:8697667
asyncFunctionResume@[native code]
[native code]
promiseReactionJobWithoutPromise@[native code]
promiseReactionJob@[native code]"
[Log]   ERR – "WebSocket close with status code 1006: O@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.c…" (workbench.web.api.js, line 627)
"WebSocket close with status code 1006: O@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2152101
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:634:2153860"
[Error] WebSocket network error: The operation couldn’t be completed. (OSStatus error -9836.) (x2)
[Log]   ERR – "[remote-connection][ExtensionHost][f5181…][initial][nas.domain.com:80] socketFactory.connect() failed or timed out. Error:" (workbench.web.api.js, line 627)
[Log]   ERR – Error: WebSocket close with status code 1006 (workbench.web.api.js, line 627)
Error: WebSocket close with status code 1006
[Log]   ERR – "[remote-connection] An error occurred in the very first connect attempt, it will be treated as a permanent error! Error:" (workbench.web.api.js, line 627)
[Log]   ERR – Error: WebSocket close with status code 1006 (workbench.web.api.js, line 627)
Error: WebSocket close with status code 1006
[Error] Error received from starting extension host (kind: 2)
	(anonymous function) (workbench.web.api.js:1861:5151723)
	promiseReactionJob
[Error] Error: WebSocket close with status code 1006
	(anonymous function) (workbench.web.api.js:1861:5151805)
	promiseReactionJob
[Log]   ERR – "JSON Parse error: Unexpected identifier \"undefined\": parse@[native code…" (workbench.web.api.js, line 627)
"JSON Parse error: Unexpected identifier \"undefined\": parse@[native code]
ai@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2303:6177720
_createInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951915
_createAndCacheServiceInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1953533
_safeCreateAndCacheServiceInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1952730
_createInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951520
createInstance@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:625:1951344
_createExtensionHostCustomers@https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1861:5153828
https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1861:5151699
promiseReactionJob@[native code]"
[Error] Unhandled Promise Rejection: Error: Unknown actor MainThreadWindow
	(anonymous function)
	promiseReactionJob

Chrome

vscode.browserified.js:673 Something went wrong setting the body background to the theme background color.
4.../../common/util @ vscode.browserified.js:673
o @ vscode.browserified.js:1
r @ vscode.browserified.js:1
(anonymous) @ vscode.browserified.js:1
vscode.browserified.js:674 Error: [vscode] Could not set body background to theme background color. Could not find colorThemeData in localStorage.
    at setBodyBackgroundToThemeBackgroundColor (vscode.browserified.js:643)
    at Object.4.../../common/util (vscode.browserified.js:670)
    at o (vscode.browserified.js:1)
    at r (vscode.browserified.js:1)
    at vscode.browserified.js:1
4.../../common/util @ vscode.browserified.js:674
o @ vscode.browserified.js:1
r @ vscode.browserified.js:1
(anonymous) @ vscode.browserified.js:1
A bad HTTP response code (404) was received when fetching the script.
vscode.browserified.js:129 error [Service Worker] registration: Failed to register a ServiceWorker for scope ('https://nas.domain.com:8080/') with script ('https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/dist/serviceWorker.js'): A bad HTTP response code (404) was received when fetching the script. TypeError: Failed to register a ServiceWorker for scope ('https://nas.domain.com:8080/') with script ('https://nas.domain.com:8080/static/4e8cd09ef0412dfc7b148b7639a692e20e4fd6dd/usr/local/share/.config/yarn/global/node_modules/code-server/dist/serviceWorker.js'): A bad HTTP response code (404) was received when fetching the script.
webWorkerExtensionHost.ts:117 The web worker extension host is started without an iframe sandbox!
start @ webWorkerExtensionHost.ts:117
Zn @ extensionHostManager.ts:69
_createInstance @ instantiationService.ts:110
createInstance @ instantiationService.ts:76
(anonymous) @ abstractExtensionService.ts:602
_startExtensionHosts @ abstractExtensionService.ts:601
_initialize @ abstractExtensionService.ts:505
(anonymous) @ extensionService.ts:78
async function (async)
(anonymous) @ extensionService.ts:77
Promise.then (async)
La @ extensionService.ts:76
_createInstance @ instantiationService.ts:110
_createServiceInstance @ instantiationService.ts:230
_createServiceInstanceWithOwner @ instantiationService.ts:219
_createAndCacheServiceInstance @ instantiationService.ts:208
_safeCreateAndCacheServiceInstance @ instantiationService.ts:151
_getOrCreateServiceInstance @ instantiationService.ts:135
get @ instantiationService.ts:54
initLayout @ layout.ts:255
(anonymous) @ workbench.ts:141
invokeFunction @ instantiationService.ts:61
startup @ workbench.ts:134
open @ web.main.ts:98
async function (async)
open @ web.main.ts:89
oe @ web.main.ts:390
m @ workbench.web.api.ts:526
(anonymous) @ workbench.ts:503
(anonymous) @ workbench.ts:510
r._invokeFactory @ loader.js:1136
r.complete @ loader.js:1146
r._onModuleComplete @ loader.js:1772
r._onModuleComplete @ loader.js:1784
r._resolve @ loader.js:1732
r.defineModule @ loader.js:1375
o @ loader.js:1660
v @ loader.js:2167
r._invokeFactory @ loader.js:1136
r.complete @ loader.js:1146
r._onModuleComplete @ loader.js:1772
r._onModuleComplete @ loader.js:1784
r._resolve @ loader.js:1732
r.defineModule @ loader.js:1375
p @ loader.js:1822
(anonymous) @ workbench.nls.js:7
console.ts:137 [Extension Host] Looking for parseable documents...
console.ts:137 [Extension Host] Found no documents

Notes

This issue can be reproduced in VS Code: No

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Jul 26, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 26, 2021

Thanks for opening this bug report and posting the logs! We've had Safari issues in the past.

I don't know if this is related, but what happens if you clear the cache and try again? Or try logging into your code-server instance from a private window?

@fdddf
Copy link

fdddf commented Jul 28, 2021

hi @jsjoeio , I have the same issue. clear cache is useless though I open a new web brwoser like Firefox or Microsoft Edge.

@molamooo
Copy link

Same issue here. I'm using MacOS 12 beat 3. Works fine on Edge but blank page on Safari. Clearing cache is useless.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 28, 2021

The other thing I'm wondering is if this is related to this #3829

@jsjoeio jsjoeio added browser-safari Safari related bug Something isn't working high-priority This issue needs to be resolved ASAP needs-investigation This issue needs to be further investigated and removed needs-investigation This issue needs to be further investigated labels Jul 28, 2021
@jsjoeio jsjoeio added this to the 3.12.0 milestone Jul 28, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 28, 2021

I tried reproducing locally with macOS + Safari but couldn't.

image

We will look into this for the next cycle.

@skrenes
Copy link
Author

skrenes commented Jul 29, 2021

Thanks for looking into this. The key things to remember is that this occurs when using a reverse-proxy (in my case Nginx) with HTTPS certificates (I haven't tried it without HTTPS). Also, using the cert/cert-key method (without a reverse-proxy) works with Safari. I'm also using named paths (rather than IP's, which is a known problem with service workers).

This problem also occurs with the official docker container too. I spun up another fresh instance and had caches cleared and it was a no go with Safari only. To be clear, the login screen shows up in Safari, but once I enter the password, I get a blank page.

@fdddf
Copy link

fdddf commented Jul 29, 2021

One more words, it works fine as I directly visit the code-server in LAN
But it sucks on WAN, with a nginx reverse proxy to local served code-server.

#3829 this issue mentioned ServiceWorker, I tried to replace path and it was fixed, but still output "time limit reached" error.
I found it loads workbench.web.api.js slowly.

BTW, console error:

ERR Unable to read file 'vscode-remote:/root/.local/share/code-server/User/settings.json' (Error: Time limit reached): Error: Unable to read file 'vscode-remote:/root/.local/share/code-server/User/settings.json' (Error: Time limit reached)

image

image

Thanks

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 29, 2021

The key things to remember is that this occurs when using a reverse-proxy (in my case Nginx) with HTTPS certificates

Thanks for being specific about that! @code-asher any ideas?

#3829 this issue mentioned ServiceWorker, I tried to replace path and it was fixed, but still output "time limit reached" error.
I found it loads workbench.web.api.js slowly.

Hmm 🤔 We thought that should fix it but maybe something else is happening. cc @code-asher here too.

ERR Unable to read file 'vscode-remote:/root/.local/share/code-server/User/settings.json'

Based on this and your screenshots, it seems like the json could be invalid? Have you tried copying and pasting your json file in a validator to double-check it? https://jsonlint.com/

@fdddf
Copy link

fdddf commented Jul 30, 2021

Thanks @jsjoeio.

For /root/.local/share/code-server/User/settings.json , It's exist after I saved terminal setting while visit over LAN, and its's no doubt json formated.
I guess the reason is loads slowly on reverse-proxy. I have no idea if that is related to websocket, as they cost 10 seconds more to load.

image

@code-asher
Copy link
Member

The key things to remember is that this occurs when using a reverse-proxy (in my case Nginx) with HTTPS certificates

Thanks for being specific about that! @code-asher any ideas?

Are the certificates valid (signed by a certificate authority and all that)? If not maybe Safari is being extra strict about them.

#3829 this issue mentioned ServiceWorker, I tried to replace path and it was fixed, but still output "time limit reached" error.
I found it loads workbench.web.api.js slowly.

Hmm thinking We thought that should fix it but maybe something else is happening. cc @code-asher here too.

I think this is related to #2407. Basically I think we should probably remove the timeout entirely (but show a notification periodically so it doesn't look stuck).

ERR Unable to read file 'vscode-remote:/root/.local/share/code-server/User/settings.json'

Based on this and your screenshots, it seems like the json could be invalid? Have you tried copying and pasting your json file in a validator to double-check it? https://jsonlint.com/

This looks also to be related to the time out. Reading the file will fail if the connection is never established.

@skrenes
Copy link
Author

skrenes commented Jul 31, 2021

@code-asher Yes the keys are valid and work well for all my other docker containers with reverse proxy (I have about a dozen). Even Code Server works in Safari to prompt the password. But fails after entering it with a white page. Also, as mentioned before, Code Server works if I use the built in cert/cert-key and not use a reverse proxy. All settings use FQDN.

As a note, I don't believe the issue that user @fdddf is having is related. No amount of waiting cures the problem I'm having and my logs look different. Thanks!

@code-asher
Copy link
Member

code-asher commented Aug 2, 2021 via email

@skrenes
Copy link
Author

skrenes commented Aug 3, 2021

I don't think it's a key issue at all. They're valid Let's Encrypt Elliptic Curve keys. Also as I said, Chrome is working fine. Even Safari works up to the password prompt. But after I enter the correct password, I get a white page. I assume that is when web sockets are used?

I'm not sure if the other apps use web sockets (Home Assistant, pgAdmin, Pi Hole, Grafana, Hoppscotch, custom Node/React site, etc). I also think I tried connecting through the reverse proxy without HTTPS and it failed. So I think your hunch about it being a web socket issue with Safari on Code-Server may be right. Are the pasted logs above any help?

Also note my custom ports in the original issue statement. I don't know if ports can be funky with Safari and web sockets.

@code-asher
Copy link
Member

code-asher commented Aug 4, 2021 via email

@seizeMx
Copy link

seizeMx commented Aug 22, 2021

One more words, it works fine as I directly visit the code-server in LAN
But it sucks on WAN, with a nginx reverse proxy to local served code-server.

#3829 this issue mentioned ServiceWorker, I tried to replace path and it was fixed, but still output "time limit reached" error.
I found it loads workbench.web.api.js slowly.

BTW, console error:

ERR Unable to read file 'vscode-remote:/root/.local/share/code-server/User/settings.json' (Error: Time limit reached): Error: Unable to read file 'vscode-remote:/root/.local/share/code-server/User/settings.json' (Error: Time limit reached)

image

image

Thanks

same issue, did you find solution?

@VelocityDesign
Copy link

I'm getting this issue when trying to access with my iPhone

@jsjoeio jsjoeio modified the milestones: 3.12.0, 3.12.1, On Deck Sep 9, 2021
@skrenes
Copy link
Author

skrenes commented Oct 12, 2021

@code-asher I'm sorry that I've been so busy these last couple months to check into this issue, but your thorough response was not in vain because you nailed the issue exactly! It seems Apple does not yet support TLS 1.3 on web sockets! So bizarre and strangely behind!

For anyone running an Nginx reverse proxy, I have a default.conf file that doesn't allow anything less than TLS 1.3, but there's a configuration file for each of my applications, including code-server. Within your server {} configuration for your code-server configuration, you could apply the following to allow downgrades to TLS 1.2 for only that service:

ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';

Thanks again @code-asher for your help! I'm going to close this issue now.

@skrenes skrenes closed this as completed Oct 12, 2021
@code-asher
Copy link
Member

code-asher commented Oct 12, 2021 via email

code-asher added a commit to code-asher/code-server that referenced this issue Oct 12, 2021
code-asher added a commit that referenced this issue Oct 18, 2021
* Mention that Safari needs TLS 1.2

#3850

* Delete duplicated guide sections
@code-asher code-asher removed the needs-investigation This issue needs to be further investigated label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-safari Safari related bug Something isn't working high-priority This issue needs to be resolved ASAP
Projects
None yet
Development

No branches or pull requests

7 participants