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

Node starter failing to build on Windows 10 #74

Open
4 tasks
VidyasagarMSC opened this issue Nov 23, 2018 · 24 comments
Open
4 tasks

Node starter failing to build on Windows 10 #74

VidyasagarMSC opened this issue Nov 23, 2018 · 24 comments

Comments

@VidyasagarMSC
Copy link
Member

Summary
Node Basic Web App starter fails with the following error on Windows as there's no folder called node_modules_linux (defined in cli_config.yml)

C:\lab\myapp>ibmcloud dev build
Getting service credentials for the application.
No service credentials were detected for the application to download.
Validating Docker image name
OK
Checking if Docker container myapp-express-tools is running
OK
Checking Docker image history to see if image already exists
OK
Creating image myapp-express-tools based on Dockerfile-tools ...

Executing docker image build --file Dockerfile-tools --tag myapp-express-tools --rm --pull --build-arg bx_dev_userid=0 --build-arg bx_dev_user=root .

Waiting for Docker image to build...
OK
Creating a container named 'myapp-express-tools' from that image...
FAILED
An error Error response from daemon: Mount denied:
The source path "C:/lab/myapp/node_modules_linux"
doesn't exist and is not known to Docker was encountered while creating Docker container 'myapp-express-tools'.

Steps to reproduce
(include tooling version, platform, etc)

  1. ibmcloud dev create
  2. Choose node > node (web app)
  3. ibmcloud dev build

Operating System
Windows 10

Supporting details

C:\lab\myapp>ibmcloud dev build
Getting service credentials for the application.
No service credentials were detected for the application to download.
Validating Docker image name
OK
Checking if Docker container myapp-express-tools is running
OK
Checking Docker image history to see if image already exists
OK
Creating image myapp-express-tools based on Dockerfile-tools ...

Executing docker image build --file Dockerfile-tools --tag myapp-express-tools --rm --pull --build-arg bx_dev_userid=0 --build-arg bx_dev_user=root .

Waiting for Docker image to build...
OK
Creating a container named 'myapp-express-tools' from that image...
FAILED
An error Error response from daemon: Mount denied:
The source path "C:/lab/myapp/node_modules"
doesn't exist and is not known to Docker was encountered while creating Docker container 'myapp-express-tools'.

Development "done" checklist

  • Test case to verify
  • Public Documentation updated
  • Change added to "release notes" as appropropriate
  • Notification to stakeholders (OM, other squads, etc)
@jkingoliver
Copy link

@steveclay I think this is a duplicate. Can you confirm that you have an issue open?

@briangleeson
Copy link

briangleeson commented Feb 6, 2019

I'm also seeing this on Windows 7. @jkingoliver any update? Or potential workaround?

@briangleeson
Copy link

It's may be related to this: moby/moby#12590 (comment)

@dprosper
Copy link

I am hitting this issue as well, any chance this will be fixed soon? I am happy to offer extra hands in looking at the code/testing or make coffee ....

@dprosper
Copy link

After some digging into this it looks like the sample repo is the culprit:

  1. the cli-config.yml contains the references to node_modules_linux.
  2. once that is modified to point to node_modules instead, there are a few of the modules that don't install (appmetrics-*)
    Cleaning these up seems to fix the issue and the app is deployed successfully.
    @VidyasagarMSC fyi

@esminerva
Copy link

Here's the workaround that works on windows, but yet to completely work on unix:
https://github.com/joyychang/node-windows-workaround/blob/master/cli-config.yml#L21-L24
also see files docker-compose-local.yml and docker-compose.yml

This utilizes volume mounting to a space in docker for the dependencies (which is unix based).

@ejodet
Copy link

ejodet commented Nov 8, 2019

@joyychang the above workaround di not work on my Win 10 laptop
1 - adjusted cli-config.yml with https://github.com/joyychang/node-windows-workaround/blob/master/cli-config.yml#L21-L24
2 - copied docker-compose-local.yml and docker-compose.yml
3 - ibmcloud dev build
ran a bit further but failed with:

Step 18/18 : RUN if [ "$bx_dev_user" != root ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi
 ---> Using cache
 ---> bf95ec58233f
Successfully built bf95ec58233f
Successfully tagged windowsnodeondeck-express-tools:latest
Creating windowsnodeondeck-express-tools ... error

ERROR: for windowsnodeondeck-express-tools  Cannot create container for service web: b'Drive sharing failed for an unknown reason'

ERROR: for web  Cannot create container for service web: b'Drive sharing failed for an unknown reason'
Encountered errors while bringing up the project.
FAILED
exit status 1

exit status 1

@esminerva
Copy link

Try remove that line from Dockerfile

@ejodet
Copy link

ejodet commented Nov 8, 2019

@joyychang line removed.
Still failing

Step 17/17 : RUN BX_DEV_USERID=$bx_dev_userid
 ---> Running in 6fb5e8f5b76b
Removing intermediate container 6fb5e8f5b76b
 ---> 73da8e9d94a9
Successfully built 73da8e9d94a9
Successfully tagged windowsnodeondeck-express-tools:latest
Recreating windowsnodeondeck-express-tools ... done
Starting the 'nodejsmicroservicewithexpressjstutorial-express-tools'
container...
FAILED
The 'nodejsmicroservicewithexpressjstutorial-express-tools' container failed
to start: Error response from daemon: No such container:
nodejsmicroservicewithexpressjstutorial-express-tools

@ejodet
Copy link

ejodet commented Nov 12, 2019

@joyychang - wrt #74 (comment)
the problem is not with the line,
rather with starting the container:

Starting the 'nodejsmicroservicewithexpressjstutorial-express-tools'
container...
FAILED
The 'nodejsmicroservicewithexpressjstutorial-express-tools' container failed
to start: Error response from daemon: No such container:
nodejsmicroservicewithexpressjstutorial-express-tools

Any update on this?
This is pretty blocking...

@esminerva
Copy link

Hey it looks like you need to change the image name in the docker-compose-tools.yml from windowsnodeondeck-express-tools to match nodejsmicroservicewithexpressjstutorial-express-tools

@ejodet
Copy link

ejodet commented Nov 12, 2019

thanks @joyychang - will test this tomorrow and will let you know

@ejodet
Copy link

ejodet commented Nov 13, 2019

@joyychang - it worked - adding detailed steps for the workaround

@ejodet
Copy link

ejodet commented Nov 13, 2019

1 - In your local cli-config.yml, replace these lines:

# The name for the dockerfile for the run container
dockerfile-run : "Dockerfile"
# The name for the dockerfile for the tools container
dockerfile-tools : "Dockerfile-tools"

with https://github.com/joyychang/node-windows-workaround/blob/master/cli-config.yml#L21-L24

2 - copy docker-compose-tools.yml and docker-compose.yml
to your local directory

3 - edit docker-compose-tools.yml
Change:

image: "nodejsmicroservicewithexpressjstutorial-express-tools"
container_name: "nodejsmicroservicewithexpressjstutorial-express-tools"

save your changes.

ibmcloud dev build results in:

Step 18/18 : RUN if [ "$bx_dev_user" != root ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi
 ---> Running in 0bc615f3757a
Removing intermediate container 0bc615f3757a
 ---> 171357ea214f
Successfully built 171357ea214f
Successfully tagged nodejsmicroservicewithexpressjstutorial-express-tools:latest
Recreating windowsnodeondeck-express-tools ... done
Starting the 'nodejsmicroservicewithexpressjstutorial-express-tools'
container...
OK
The 'nodejsmicroservicewithexpressjstutorial-express-tools' container is
already running
Executing npm install command started at Wed Nov 13 08:29:57 2019...
OK
time="2019-11-13T08:30:19+01:00" level=info msg="[0/1] [web]: Stopping "
time="2019-11-13T08:30:19+01:00" level=info msg="[0/1] [web]: Stopped "

@ejodet
Copy link

ejodet commented Nov 13, 2019

so we now have a workaround.
Still, any Win 10 user following this tutorial will face the dev build issue.

And will possibly will have a hard time before discovering the above workaround.
Resulting in bad user experience.

@steveclay - this issue is nearly 1 year old - no assignee and a hard to find workaround
Any way to give this one a high priority?

@steveclay
Copy link
Collaborator

From past discussions and what I see above, the fix needs to be made to the starter kit. The starters determine the contents of the cli-config.yml and that appears to be all that was required for this to work. This is a great discovery and so hopefully we can make this correction to the starter now for Win10 users.

@ejodet
Copy link

ejodet commented Nov 14, 2019

I handed the problem back to the Starter Kit Team - I will follow-up with them to ensure the problem is fixed and we no longer require this workaround.

@1496kapil
Copy link

Successfully built b1813108cc98
Successfully tagged myappbuild-express-tools:latest
Creating myappbuild-express-tools ...
�[1BStarting the 'myapp-express-tools' container...
FAILED
The 'myapp-express-tools' container failed to start: Error response
from daemon: No such container: myapp-express-tools

@ejodet i am facing the above error. Could you please suggest something?

@ejodet
Copy link

ejodet commented Nov 14, 2019

@1496kapil - it looks similar to what I had
#74 (comment)

check the cli-config.yml
search for the value of container-name-tools and image-name-tools
open the docker-compose-tools.yml
ensure the value of image and container_name are the same as those defined in the cli-config.yml

Save your changes
re-build

@1496kapil
Copy link

thanks @ejodet , Got stuck with one more stuff. Suggest something

�[1BStarting the 'myappbuild-express-tools' container...
OK
Executing �[36mnpm install�[0m command started at Thu Nov 14 15:54:44 2019...
FAILED
An unexpected error has occurred:
Error response from daemon: Container
2fe5862c5e69e8773c226a16afe7e94dd5b659d004e8d2359f6dd59231705536 is not running

@ejodet
Copy link

ejodet commented Nov 14, 2019

@1496kapil not sure what can be wrong here
Assming you tried to build multiple times - right?

@1496kapil
Copy link

@1496kapil not sure what can be wrong here
Assming you tried to build multiple times - right?

@ejodet yes.. No other option right... every time build is starting from initial stage.
Is anything wrong there?

@ejodet
Copy link

ejodet commented Nov 14, 2019

@joyychang would you be able to help @1496kapil regarding #74 (comment)
?

@esminerva
Copy link

Try restarting docker?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants