Skip to content

[Bug]: Failed to load resource: the server responded with a status of 404 (Not Found) #6421

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

Closed
4 tasks done
qjaden opened this issue Sep 6, 2023 · 14 comments
Closed
4 tasks done
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer

Comments

@qjaden
Copy link

qjaden commented Sep 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser:
    • Microsoft Edge 115.0.1901.200 (x86_64)
    • Google Chrome 116.0.5845.140 (x86_64)
    • Safari 16.5.2 (18615.2.9.11.10)
  • Local OS: MACos 13.4.1 (c) (22F770820d)
  • Remote OS: Ubuntu 12.04
  • Remote Architecture: AMD64
  • code-server --version: 4.16.1 94ef377

Steps to Reproduce

Steps to Reproduce

  1. docker-compose.yml
version: "3"

services:
  code-server:
    container_name: code-server
    image: codercom/code-server
    ports:
      - "8080:8080"
    volumes:
      - ./project:/home/coder/project:rw
      - ./config:/home/coder/.config:rw
    environment:
      PASSWORD: 123456789
    restart: always

  1. Nginx
server {
    listen       20005 ssl;
    server_name  control.xxxxx.xxx;
    # server_tokens off;

    ssl_certificate      /etc/letsencrypt/control.xxx.xxx_nginx/control.xxxx.xxx_bundle.crt;
    ssl_certificate_key  /etc/letsencrypt/control.xxx.xxx_nginx/control.xxxx.xxx.key;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

    location / {
        proxy_pass http://127.0.0.1:8080/;
        # proxy_set_header      Host                $host;
        # proxy_set_header      X-Real-IP           $remote_addr;
        # proxy_set_header      X-Forwarded-For     $proxy_add_x_forwarded_for;
        # proxy_set_header      X-Forwarded-Host    $host;
        # proxy_set_header      X-Forwarded-Proto   $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
        proxy_set_header Accept-Encoding gzip;
        proxy_set_header Origin https://$host;
        proxy_set_header Host $host;
        # proxy_set_header X-Forwarded-Host $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
    }

}

Expected

No error reported

Actual

image image

Logs

code-server | [15:10:18] RequestStore#acceptReply was called without receiving a matching request 59
code-server | [15:10:18] RequestStore#acceptReply was called without receiving a matching request 60
code-server | File not found: /usr/lib/code-server/lib/vscode/out/vsda.js
code-server | File not found: /usr/lib/code-server/lib/vscode/out/vsda_bg.wasm
code-server | [15:12:19] [172.24.0.1][f6e5d897][ManagementConnection] New connection established.
code-server | [15:12:21] [172.24.0.1][f3f857a7][ExtensionHostConnection] New connection established.
code-server | [15:12:21] [172.24.0.1][f3f857a7][ExtensionHostConnection] <6276> Launched Extension Host Process.
code-server | [15:12:21] RequestStore#acceptReply was called without receiving a matching request 61
code-server | [15:12:21] RequestStore#acceptReply was called without receiving a matching request 62

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

No response

@qjaden qjaden added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Sep 6, 2023
@ircasillase
Copy link

I have a similar issue using a nginx server pointing to my code-server machine to add HTTPS, its supposed just enabling web socket support should fix it, but not work for me.

@qjaden
Copy link
Author

qjaden commented Sep 7, 2023

code-server | File not found: /usr/lib/code-server/lib/vscode/out/vsda.js
code-server | File not found: /usr/lib/code-server/lib/vscode/out/vsda_bg.wasm

I couldn't find any relevant static resources in the server either.

code-server | File not found: /usr/lib/code-server/lib/vscode/out/vsda.js
code-server | File not found: /usr/lib/code-server/lib/vscode/out/vsda_bg.wasm

@code-asher
Copy link
Member

The vsda resources do not appear to be included in the OSS build of VS Code, and they appear to be optional, so I think it is something we can safely ignore. Are you running into a bug or is it just the 404s?

@ircasillase
Copy link

@code-asher in my case throws this error and don't let me do anything else, it just reload and throws the error again.
image

@code-asher
Copy link
Member

Got it, this looks like something else. Usually 1006 closures on web sockets are caused by incorrectly configured reverse proxies but your configuration looks OK to me. You might try running with --log debug just to make sure it is not an issue with the origin (if it is then there will be a debug log saying blocking request), although I am not sure how it could be since your config overrides the origin to always match the host.

I will try to reproduce with your config later today.

@code-asher
Copy link
Member

I experimented with your config although I changed NGINX to listen without TLS since I have no certificates to use, and I am accessing it via the port (http://localhost:20005) rather than a name. It worked for me so I am not sure what is going on.

@ircasillase
Copy link

Is possible to share your configuration? to compare with mine.

@ircasillase
Copy link

In my case looks like I was missing whit two instructions:

  • proxy_set_header Origin https://$host;
  • proxy_set_header Host $host;

I set it up in my nginx and the error is gone, thanks!!

@qjaden
Copy link
Author

qjaden commented Sep 8, 2023

just the 404s

just the 404s

@qjaden qjaden mentioned this issue Sep 8, 2023
2 tasks
@code-asher
Copy link
Member

code-asher commented Sep 8, 2023

@ircasillase Oh oops sorry my bad, I got confused and thought you were the issue author so I thought the above config was yours. Glad you got it fixed! It sounds like the origin check was the source of your problem.

@ZhengHui-Z Awesome, I think there is nothing more we can do here then. The 404s are expected, for now.

Please keep in mind though that by setting Origin you bypass the security of the check. That header is meant to be sent by the browser. If you remove the Origin line and still have problems, you might need proxy_set_header Host $http_host; instead.

@qjaden qjaden closed this as completed Sep 12, 2023
@sathia-musso
Copy link

i stumbled on this error as well, but it seems I can't fix it:

I tried several browsers but no luck, I've also tried without proxy and it works fine.

image

map $http_upgrade $connection_upgrade {
    default upgrade;
    ''      close;
}

server {

    server_name ha.*******.***;

    include /etc/nginx/gz.conf;
    include /etc/nginx/common.conf;
    access_log /var/log/nginx/ha.access.log;
    error_log /var/log/nginx/ha.error.log error;
    proxy_buffering off;

    location / {
        proxy_set_header Origin https://$host;
        proxy_pass http://192.168.69.210:8123;
        proxy_set_header Host $host;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }


    listen 192.168.1.121:80;
}

@code-asher
Copy link
Member

Have you tried proxy_set_header Host $http_host; instead?

@sathia-musso
Copy link

sathia-musso commented Jan 27, 2024

no, it doesn't work, if it's of any help it is installed on Home Assistant. All requests work except for those little images

@code-asher
Copy link
Member

code-asher commented Jan 31, 2024

Oh sorry I misread your post and thought we were talking about the web socket. Yeah $http_host will not do anything for the icons.

I believe the icons are provided by a font. The default is codicon. If you open the browser dev tools and reload do you see a network request like this? Is it for sure a 404?

https://[url]/stable-e76afa4a2bf4667a3c9f71bf56ef34b8ad365fbe/static/out/vs/base/browser/ui/codicons/codicon/codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6

You could check to see if you can open the URL in a separate tab. Maybe something is preventing that request from loading. A browser extension maybe, or something in Home Assistant.

Also check the browser console logs and see if there are any other errors or warnings, like about content security policy or cross-origin stuff for example.

If you are using an extension that changes the icons, it might be different, so let me know if that is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants