coder / code-server

VS Code in the browser
https://coder.com
MIT License
67.87k stars 5.58k forks source link

Error: no such file or directory, '/src/packages/server/build/web/favicon.ico' #647

Closed BeckettOBrien closed 4 years ago

BeckettOBrien commented 5 years ago

Description

When I run code server, everything works and I can connect, but after about 2 minutes (I haven't done anything in this time) I get this error:

Error: ENOENT: no such file or directory, open '/src/packages/server/build/web/favicon.ico'
INFO  WebSocket opened / {"client":1,"ip":"172.17.0.1"}
internal/child_process.js:366
    throw errnoException(err, 'spawn');
    ^

Error: spawn ENOMEM
    at ChildProcess.spawn (internal/child_process.js:366:11)
    at Object.spawn [as _spawn] (child_process.js:538:9)
    at t.async (/src/packages/server/out/cli.js:504:34598)
    at e.exports (/src/packages/server/out/cli.js:504:34099)
    at e (/src/packages/server/out/cli.js:504:32722)
    at Timeout.u [as _onTimeout] (/src/packages/server/out/cli.js:504:33015)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

Steps to Reproduce

  1. Start code server using docker command
  2. Wait
  3. After about 2 minutes, the following error appears
YouSysAdmin commented 5 years ago

I only get error Error: ENOENT: no such file or directory, open '/home/travis/build/codercom/code-server/packages/server/build/web/favicon.ico' I have no problem after 2 minutes, a test lasting 15 minutes

Run code-server in Docker, my Dockerfile is below

# We deploy with ubuntu so that devs have a familiar environment.
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
    openssl \
    net-tools \
    git \
    locales \
    sudo \
    dumb-init \
    vim \
    curl \
    wget && \
    rm -rf /var/lib/apt/lists/* && \
    wget -P /tmp https://github.com/cdr/code-server/releases/download/1.939-vsc1.33.1/code-server1.939-vsc1.33.1-linux-x64.tar.gz && \
    cd /tmp && \
    tar -xzf code-server1.939-vsc1.33.1-linux-x64.tar.gz && \
    cp code-server1.939-vsc1.33.1-linux-x64/code-server /usr/local/sbin/ && \
    rm -rf /tmp/* 

RUN locale-gen en_US.UTF-8
# We unfortunately cannot use update-locale because docker will not use the env variables
# configured in /etc/default/locale so we need to set it manually.
ENV LC_ALL=en_US.UTF-8

RUN adduser --gecos '' --disabled-password coder && \
    echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd

USER coder
# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root.
RUN mkdir -p /home/coder/project

WORKDIR /home/coder/project

# This assures we have a volume mounted even if the user forgot to do bind mount.
# So that they do not lose their data if they delete the container.
VOLUME [ "/home/coder/project" ]

EXPOSE 8443

ENTRYPOINT ["dumb-init", "code-server"]
alberthk43 commented 5 years ago

Maybe helpful

$ code-server --version 1.939-vsc1.33.1

$ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.2 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.2 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic

$ code-server ~ -p 12307 --password= (node:9173) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. INFO code-server v1.939-vsc1.33.1 INFO Additional documentation: http://github.com/codercom/code-server INFO Initializing {"data-dir":"/home/caskeep/.local/share/code-server","extensions-dir":"/home/caskeep/.local/share/code-server/extensions","working-dir":"/home/caskeep","log-dir":"/home/caskeep/.cache/code-server/logs/20190514045909585"} WARN "--password" is deprecated. Use the PASSWORD environment variable instead. INFO Starting webserver... {"host":"0.0.0.0","port":"12307"} WARN No certificate specified. This could be insecure. WARN Documentation on securing your setup: https://github.com/codercom/code-server/blob/master/doc/security/ssl.md INFO INFO Password: INFO INFO Started (click the link below to open): INFO http://localhost:12307/ INFO INFO Starting shared process [1/5]... WARN stderr {"data":"(node:9185) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.\n"} INFO Connected to shared process internal/child_process.js:366 throw errnoException(err, 'spawn'); ^

Error: spawn ENOMEM at ChildProcess.spawn (internal/child_process.js:366:11) at Object.spawn [as _spawn] (child_process.js:538:9) at t.async (/home/travis/build/codercom/code-server/packages/server/out/cli.js:504:34598) at e.exports (/home/travis/build/codercom/code-server/packages/server/out/cli.js:504:34099) at e (/home/travis/build/codercom/code-server/packages/server/out/cli.js:504:32722) at Timeout.u [as _onTimeout] (/home/travis/build/codercom/code-server/packages/server/out/cli.js:504:33015) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10)

sr229 commented 5 years ago

@caskeep this is a OOM. Not related.

@BeckettOBrien I know how to solve this, this is sending a 204 via the code-server's server for the favicon request if it can't find it. I might do a PR for that.

BeckettOBrien commented 5 years ago

@sr229 So what can I do to make sure that I do not get this error in the future? Should I try to manually add an icon under that path?

sr229 commented 5 years ago

nope, this will be solved in our end, just wait for the next release. This is a minor error, so don't worry.

BeckettOBrien commented 5 years ago

@sr229 Thanks for the help!

EnKrypt commented 5 years ago

Any update? Has the fix been integrated yet?

I'm using the latest stable release and this problem remains.

BeckettOBrien commented 5 years ago

@EnKrypt I haven’t tested in a while, but last time I checked this problem still happened. Are you running through docker?

EnKrypt commented 5 years ago

Nope, I've been running the binaries directly.

However, I've since updated to the v2 pre-release builds and I can confirm that this has been fixed. From what I can tell, the problem remains only in the latest stable release, i.e. 1.1156-vsc1.33.1

sr229 commented 5 years ago

v1 is a deprecated release so I encourage using preview builds going forward - they're pretty much production ready with a few hiccups.

EnKrypt commented 5 years ago

A bit off topic with respect to this issue, but I have to strongly disagree there.

In the 12 hours of using the latest preview build I've had a whole spectrum of issues, to name a few :

Not to mention one of the maintainers unpublished a release while testing, causing the AUR package to remain broken until I stumbled across it. Read the comments here

I'm not getting the vibe that this is production ready, and if you're saying that v1 is deprecated in favor of this, then I'm not sure that's a good thing.

BeckettOBrien commented 5 years ago

I haven’t tried using V2 yet, but you should use whichever build has the least errors at the moment, or continue to use the buggy version and report issues which would get V2 ready faster.

sr229 commented 5 years ago

I only speak in upstream terms, not in the AUR side. If its within the AUR side then you should open it up to them.

  • Opening a folder is a big mess. I have to manually type out the path in the url, because the folder picker simply won't open the folder I select or type.

Already fixed. I have tried v2 Preview since its early days this is no longer the case.

  • The integrated terminal tends to glitch. Either doesn't load at all, or gets stuck.

This is a open area of investigation, however, based on my testing on its early revisions only the first terminal is problematic. Simply respawning the terminal should fix this. I only have encountered this on throttled bandwidth however. This is a VSCode Upstream problem, not us.

  • Random crashes every hour or so when someone is using it. (I've yet to check logs to figure out if something specific is causing this)

You seem the only odd one out. We have a lot of people using it already and its been reported to work fine.

I'm not getting the vibe that this is production ready, and if you're saying that v1 is deprecated in favor of this, then I'm not sure that's a good thing.

Personal opinion, the thing is you use Arch, which isn't considered a best-practice distribution either.

Please do report issues if you encounter them, but most of what you're encountering are either edge cases or we haven't released fixes yet. Feel free to try out some Dailies I'm building so you can see which works best.

EnKrypt commented 5 years ago

I'm running the release binaries directly and not via AUR so I guess these remain relevant.

I guess I should add that it's still very usable in its current state. The bugs I'm facing are more of an inconvenience than a deal breaker, but I would like to help solve them. If I can get more closure on some of these, I'd like to chip in and write up PRs myself.

The folder opening issue is rather strange. I thought I saw an issue earlier about it, but I was wrong and those were different. I hope you don't mind if I open another issue documenting that bug.

The crashes are rather strange, setting to verbose and inspecting will help. If it's not something that I can fix in my env, I'll open an issue for that too.

The terminal glitching is rather rare, but it does happen. I don't think it's a bandwidth issue since I'm running off my local network. As you say however, this is an upstream issue not relating to code-server.

In all honestly, I've never quite heard of Arch in the context of a best-practice distro. It's part of Linux mainstream and if some of these bugs are indeed Arch specific, then I think it's in our interest to address them as well.

Anyway, I apologize for completely derailing this. I will open new issues as I investigate and help figure out how we can solve them.

sr229 commented 4 years ago

Closing as fixed. Favicon works as intended now.