codecombat: DOCKER ERR with Error: ENOENT: no such file or directory, stat '/coco/public/images/favicon.ico'

proxy_1 | > node-sass@4.13.1 postinstall /coco/node_modules/node-sass proxy_1 | > node scripts/build.js proxy_1 | proxy_1 | Binary found at /coco/node_modules/node-sass/vendor/linux-x64-57/binding.node proxy_1 | Testing binary proxy_1 | Binary is fine proxy_1 | npm WARN lifecycle codecombat@1.0.0~postinstall: cannot run in wd codecombat@1.0.0 bower install && npm run build-aether && node ./runWebpack.js (wd=/coco) proxy_1 | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents): proxy_1 | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”}) proxy_1 | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: webworker-threads@0.6.4 (node_modules/webworker-threads): proxy_1 | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: webworker-threads@0.6.4 install: node-gyp rebuild proxy_1 | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1 proxy_1 | proxy_1 | added 2419 packages from 2886 contributors and audited 2499 packages in 496.292s proxy_1 | found 1761 vulnerabilities (1022 low, 37 moderate, 687 high, 15 critical) proxy_1 | run npm audit fix to fix them, or npm audit for details proxy_1 | proxy_1 | > codecombat@1.0.0 proxy /coco proxy_1 | > COCO_PROXY=‘true’ nodemon proxy_1 | proxy_1 | 4 Sep 09:47:34 - [nodemon] v1.6.1 proxy_1 | 4 Sep 09:47:35 - [nodemon] reading config /coco/nodemon.json proxy_1 | 4 Sep 09:47:35 - [nodemon] to restart at any time, enter rs proxy_1 | 4 Sep 09:47:35 - [nodemon] ignoring: .git /coco/node_modules//* bower_components .sass-cache proxy_1 | 4 Sep 09:47:35 - [nodemon] watching: server_config.js server_setup.coffee /coco/app/schemas//* ./server app/assets/main.html proxy_1 | 4 Sep 09:47:35 - [nodemon] watching extensions: js,coffee proxy_1 | 4 Sep 09:47:35 - [nodemon] starting node index.js proxy_1 | 4 Sep 09:47:35 - [nodemon] child pid: 840 proxy_1 | 4 Sep 09:47:35 - [nodemon] watching 171 files proxy_1 | info: Using dev proxy server proxy_1 | fs.js:948 proxy_1 | binding.stat(pathModule._makeLong(path)); proxy_1 | ^ proxy_1 | proxy_1 | Error: ENOENT: no such file or directory, stat ‘/coco/public/images/favicon.ico’ proxy_1 | at Object.fs.statSync (fs.js:948:11) proxy_1 | at resolveSync (/coco/node_modules/serve-favicon/index.js:187:17) proxy_1 | at favicon (/coco/node_modules/serve-favicon/index.js:61:12) proxy_1 | at setupExpressMiddleware (/coco/server_setup.coffee:91:11) proxy_1 | at Object.exports.setupMiddleware (/coco/server_setup.coffee:227:3) proxy_1 | at module.exports.createAndConfigureApp (/coco/server.coffee:27:15) proxy_1 | at Object.module.exports.startServer (/coco/server.coffee:15:9) proxy_1 | at Object.<anonymous> (/coco/index.js:12:8) proxy_1 | at Module._compile (module.js:653:30) proxy_1 | at Object.Module._extensions…js (module.js:664:10) proxy_1 | at Module.load (module.js:566:32) proxy_1 | at tryModuleLoad (module.js:506:12) proxy_1 | at Function.Module._load (module.js:498:3) proxy_1 | at Function.Module.runMain (module.js:694:10) proxy_1 | at startup (bootstrap_node.js:204:16) proxy_1 | at bootstrap_node.js:625:3 proxy_1 | proxy_1 | 4 Sep 09:47:36 - [nodemon] app crashed - waiting for file changes before starting…

i have try both three solutions, but all do not work please help me solve this, thanks!

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 13
  • Comments: 16 (6 by maintainers)

Most upvoted comments

Please find below a list of steps that could work for running codecombat on Windows10 v19043. Both procedures described below worked successfully with this version of codecombat.

Procedure A (updating the Dockerfile)

  • Install Docker Desktop for Windows (use Docker in Windows directly, using wsl2 seems to fail with this version of codecombat and dockerd)
  • Install git for windows
  • Open a powershell commandline as administrator
  • Execute git clone https://github.com/codecombat/codecombat.git
  • Change directory into the cloned repository: cd codecombat
  • Change the Dockerfile in codecombat/development/docker/Dockerfile to the content listed below
  • Execute docker-compose build
  • Execute docker-compose up
  • Open localhost:7777 in the browser (Chrome v95.0.4638.69 works well)

The changed dockerfile shown below adds a few steps related to bower and preparing assets. Without the additional steps docker-compose up results in an empty webpage.

Procedure B (manually updating the running Docker container)

An alternative way to the procedure described before is logging in to the running docker container of codecombat and manually executing the commands to install bower etc. So, after executing docker-compose up in a powershell commandline with the original Dockerfile continue with the following steps in a separate powershell commandline:

  • Change directory to the cloned codecombat repository: cd path/to/codecombat
  • Find out the ID of the container process: docker ps
  • Start an interactive shell inside the running container: docker exec -it the-container-id /bin/bash (Replace the-container-id with the ID provided by the previous command)
  • Execute npm install bower -g
  • Add bower to the PATH: export PATH=/npm/lib/node_modules/bower/bin/:$PATH
  • Execute bower install --allow-root
  • Execute npm run build-aether
  • Execute npm install
  • Open localhost:7777 in the browser (Chrome v95.0.4638.69 works well)

Dockerfile

FROM node:8.15.1-jessie

ARG RUBY_VERSION=2.6.1
ENV NPM_GLOBAL_PREFIX=/npm

WORKDIR /coco

ENV PATH $PATH:/root/.rbenv/bin:/root/.rbenv/shims
RUN apt-get update && \
    apt-get install -y git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison \
                       build-essential libyaml-dev libncurses5-dev \
                       libffi-dev libgdbm-dev && \
    curl -sL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-installer | bash -

RUN rbenv install ${RUBY_VERSION} && \
    rbenv global ${RUBY_VERSION}

RUN mkdir $NPM_GLOBAL_PREFIX && \
    npm config set prefix $NPM_GLOBAL_PREFIX --global

RUN npm install bower -g
ENV PATH="/npm/lib/node_modules/bower/bin/:${PATH}"
RUN git clone https://github.com/codecombat/codecombat.git
RUN cp -r codecombat/* .
RUN bower install /coco/bower.json --allow-root
RUN npm install

COPY . .

Thank You!

Hopefully, the steps above can help other windows users as well to save some time for more important topics i.e. using this awesome educational platform.

Thank you for this great tool! It is outstanding.

This error message is what you see if the build fails (favicon.ico is just the first build output file that it checks for). So, if the public directory hasn’t been built by the build process, you’ll run into this.

To diagnose what is going on, it’s helpful to look for earlier error messages in the process, and potentially trying to rerun build steps in isolation to see which fail:

npm install
npm run bower install
npm run build-aether
npm run dev

I am having the same issues.