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

Yarn causing to fail to build Docker container (ENOENT lstat) #3727

Closed
icarito opened this issue Oct 21, 2018 · 20 comments
Closed

Yarn causing to fail to build Docker container (ENOENT lstat) #3727

icarito opened this issue Oct 21, 2018 · 20 comments
Assignees

Comments

@icarito
Copy link
Member

icarito commented Oct 21, 2018

Issue appears to be intermittent...

Step 18/19 : RUN yarn --ignore-engines --ignore-scripts --modules-folder ./public/lib && yarn postinstall
 ---> Running in bc98ea39dc08
yarn install v1.10.1
[1/4] Resolving packages...
�[91mwarning image-sequencer > ndarray-gaussian-filter > cwise > static-module > through2 > xtend > [email protected]: 
�[0m[2/4] Fetching packages...
[3/4] Linking dependencies...
�[91merror An unexpected error occurred: "ENOENT: no such file or directory, lstat '/app/public/lib/acorn'".
�[0minfo If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Service 'web' failed to build: The command '/bin/sh -c yarn --ignore-engines --ignore-scripts --modules-folder ./public/lib && yarn postinstall' returned a non-zero code: 1
Makefile:2: recipe for target 'build' failed
make: *** [build] Error 1
Build step 'Execute shell' marked build as failure
@jywarren
Copy link
Member

Lot of similar looking errors in yarn repo yarnpkg/yarn#4563

@icarito
Copy link
Member Author

icarito commented Oct 24, 2018

Yes I read them! And also tried a couple workarounds found there at https://github.com/publiclab/plots2/pull/3728/files

@jywarren
Copy link
Member

Sorry, yeah, just wanting to document what we've tried, thanks!

@icarito icarito changed the title Failing to build Docker container Yarn causing to fail to build Docker container (ENOENT lstat) Oct 24, 2018
@icarito
Copy link
Member Author

icarito commented Oct 24, 2018

Perhaps we can improve our Yarn deployment strategy taking some ideas from https://hackernoon.com/using-yarn-with-docker-c116ad289d56 - not sure if some version locking could help prevent issues like this.

@jywarren
Copy link
Member

Hm, like including a yarn.lock?

@jywarren
Copy link
Member

Oh, like the section on Wait! Now Yarn is executed at each container build?

Is this an intermittent issue or does the process always fail?

@jywarren
Copy link
Member

Wondering if @Souravirus would be able to help figure this out, as he originally helped complete the Yarn transition work in #2659 ?

@Souravirus
Copy link
Member

Yeah sure @jywarren, I would try my best to help

@Souravirus
Copy link
Member

@jywarren yarn.lock is already included in our code

@icarito
Copy link
Member Author

icarito commented Oct 25, 2018

Here's another report from a similar issue with npm. I guess this is a permissions issue, possibly coming from an npm package, and arising from mounting the /app directory as a volume. Perhaps it can be solved by adding a chmod or chown to Makefile.

@Radhikadua123
Copy link
Contributor

Radhikadua123 commented Oct 25, 2018

While I was creating this fix: #3775, I realised this issue. I'm able to reproduce it locally very well. I believe it's because of old yarn.lock file. After the new yarn.lock file, even if I delete modules directory, it doesn't give me this error. May be we should commit that file with latest changes ?

@Souravirus
Copy link
Member

How did you reproduce this error locally @Radhikadua123?

@Radhikadua123
Copy link
Contributor

Radhikadua123 commented Oct 25, 2018

@Souravirus

rm -rf public (basically remove all the changes by yarn install)
git checkout public 
yarn parameters (it would give same error but there would be changes in the yarn.lock)
yarn parameters (Run it again and it won't give error. I think due to yarn.lock changes)

@jywarren
Copy link
Member

jywarren commented Oct 25, 2018 via email

@Souravirus
Copy link
Member

Yeah sure. @Radhikadua123 please update your changes in one of your branches and share it here, so that I can try pushing it in unstable branch.

@Radhikadua123
Copy link
Contributor

@jywarren @Souravirus Let me push them to #3775

@Souravirus
Copy link
Member

@jywarren updating the yarn.lock worked. Here is the link to the Jenkins result https://jenkins.laboratoriopublico.org/job/Plots-Unstable/322/console. Please see #3775.

@icarito
Copy link
Member Author

icarito commented Oct 25, 2018 via email

@icarito
Copy link
Member Author

icarito commented Oct 25, 2018 via email

@Radhikadua123
Copy link
Contributor

Fixed with #3775

@ghost ghost removed the in progress label Nov 1, 2018
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

4 participants