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

EROFS: read-only file system, access '/usr/local/bin' #468

Closed
hakunin opened this issue Sep 6, 2017 · 19 comments
Closed

EROFS: read-only file system, access '/usr/local/bin' #468

hakunin opened this issue Sep 6, 2017 · 19 comments

Comments

@hakunin
Copy link

hakunin commented Sep 6, 2017

Nothing in the app config changed and I am no longer able to deploy it this morning.

Tried making a new PR and the problem persists.

       [1/4] Resolving packages...
       [2/4] Fetching packages...
       [3/4] Linking dependencies...
       [4/4] Building fresh packages...
       success Saved lockfile.
       $ cd client && yarn install
       error An unexpected error occurred: "EROFS: read-only file system, access '/usr/local/bin'".
       info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_511123d1db02c066ab30d1896704c2f5/<app>-13232ff7a068a478f642efc19a08bed3440fcfc9/yarn-error.log".
       info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-----> Build failed
       
       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys
       
       Some possible problems:
       
       - This project was built with yarn, which is new and under development. Some projects can still be built more reliably with npm
       https://devcenter.heroku.com/articles/nodejs-support#build-behavior
       
       Love,
       Heroku
       
 !     Push rejected, failed to compile Node.js app.
 !     Push failed
@zharikovpro
Copy link

We have the same issue. And here's another guy.

@idabmat
Copy link

idabmat commented Sep 6, 2017

Same issue. Noticed previous deploys were using yarn 0.28.4. New ones are using yarn 1.0.0 and causing the issue above

@edmorley
Copy link
Member

edmorley commented Sep 6, 2017

There's yarnpkg/yarn#4320 filed for this on Yarn's side, which points to the regression being caused by yarnpkg/yarn#3721. The yarn team has opened yarnpkg/yarn#4322 to fix.

In the meantime an older version of yarn can be specified in the engines section of package.json, similar to the guide here for npm:
https://devcenter.heroku.com/articles/nodejs-support#specifying-an-npm-version

I wonder whether the nodejs buildpack should not use latest yarn when there is no engines entry for yarn, but instead have a hardcoded "known safe" version that is periodically incremented? (Particularly now that it's reached v1)

@edmorley
Copy link
Member

edmorley commented Sep 6, 2017

I wonder whether the nodejs buildpack should not use latest yarn when there is no engines.yarn entry, but instead have a hardcoded "known safe" version that is periodically incremented?

Or at least only use the stable release rather then release candidates. The Yarn homepage currently says:

Stable: v0.27.5 • Release Candidate v1.0.0

@hakunin
Copy link
Author

hakunin commented Sep 6, 2017

@edmorley thanks for the solution!
For copy-pasters, add this to your package.json:

  "engines": {
    "yarn": "0.28.4"
  },

@ericnograles
Copy link

Just parroting here, but also experienced this issue and thanks for the snippet @hakunin 👍

Definitely lock down your versions of everything using engines!

@hunterloftis
Copy link
Contributor

Would someone running into this issue mind testing against the patch branch?

$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#manual-yarn-version
$ git push heroku master

@edmorley
Copy link
Member

edmorley commented Sep 6, 2017

Using that branch fixed the issue for us, with the compile log showing yarn 0.28.4 being used as intended:

-----> Installing binaries
       ...
       Resolving yarn version 0.28.4...
       Downloading and installing yarn (0.28.4)...
       Installed yarn 0.28.4

For those with Heroku build log access, see:

@hunterloftis
Copy link
Contributor

Thanks @edmorley!

@ericnograles
Copy link

@hunterloftis all good here too, thanks for the prompt fix!

image

@hunterloftis
Copy link
Contributor

Resolved by #469 (released ~30s ago). Please let us know if you still run into this issue.

Manual testing & version bumping hasn't been a popular choice in node (since the versions change so quickly), but I agree we should try to lock to something other than "latest." Is a scrape of the yarn homepage the best data source, or does someone know of a good way to get metadata like "latest stable version of yarn?"

@edmorley
Copy link
Member

edmorley commented Sep 6, 2017

Is a scrape of the yarn homepage the best data source, or does someone know of a good way to get metadata like "latest stable version of yarn?"

I was hoping it would be possible to just refer to what the website uses, however it's static and is updated by a bot whose data source is unknown:
yarnpkg/website@c23f92e

The yarn maintainers might have a better suggestion, but one option would be to use the GitHub releases metadata, since it seems to consistently use the pre-release attribute correctly.

In fact, the GitHub API docs suggest that this endpoint would do exactly that (return latest excluding pre-release):
https://developer.github.com/v3/repos/releases/#get-the-latest-release

...though you'd need to watch out for API rate limiting, if this were performed at compile time (rather than by nodebin.herokai.com and then cached).

@edmorley
Copy link
Member

edmorley commented Sep 6, 2017

Sorry for the double post - but a reminder for anyone who switched to the manual-yarn-version buildpack branch above to test the fix... Now that it's merged, switch back the the stable release (or master) to avoid later breakage due to the PR branch being deleted. To do this, use:
heroku buildpacks:set heroku/nodejs

@hunterloftis
Copy link
Contributor

👍 for heroku buildpacks:set heroku/nodejs

The nodebin service will be responsible for resolution, so rate limiting shouldn't be an issue. What do you think @jmorrell?

@Daniel15
Copy link

Daniel15 commented Sep 8, 2017

Hey @edmorley and @hunterloftis, you can use https://yarnpkg.com/latest-version to get the version number. This uses the exact same data source as the website, and is what the Yarn installation script uses along with all the other automation relating to Yarn releases (eg. the Chocolatey and Homebrew packages are updated as soon as this number is bumped).

https://yarnpkg.com/latest.tar.gz will also give you the tarball of the latest stable release.

Similarly, you can use https://yarnpkg.com/latest-rc-version and /latest-rc.tar.gz to get the latest RC, and https://nightly.yarnpkg.com/latest-version to get the latest nightly version number (if you like to live dangerously).

@edmorley
Copy link
Member

edmorley commented Sep 8, 2017

https://yarnpkg.com/latest.tar.gz will also give you the tarball of the latest stable release.

I checked this file at the time, but I'm pretty sure it was giving me the release candidate (1.0.0) rather than what the website was reporting was the latest stable (0.27.5).

@Daniel15
Copy link

Daniel15 commented Sep 8, 2017 via email

@mutuadavid93
Copy link

Have done everything even followed heroku's guide but can't resolve my issue.
Here is my log.

Counting objects: 100% (205/205), done.
Delta compression using up to 4 threads
Compressing objects: 100% (180/180), done.
Writing objects: 100% (205/205), 6.70 MiB | 1.50 MiB/s, done.
Total 205 (delta 36), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):  10.17.0
remote:        engines.npm (package.json):   6.11.3
remote:        engines.yarn (package.json):  1.19.2
remote:        
remote:        Resolving node version 10.17.0...
remote:        Downloading and installing node 10.17.0...
remote:        npm 6.11.3 already installed with node
remote:        Resolving yarn version 1.19.2...
remote:        Downloading and installing yarn (1.19.2)...
remote:        Installed yarn 1.19.2
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.19.2
remote:        error An unexpected error occurred: "EROFS: read-only file system, mkdir '/home'".
remote:        info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_950fd3a95fa3a5890ea1e883942b9a0d/yarn-error.log".
remote:        info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:        
remote:        If you're stuck, please submit a ticket so we can help:
remote:        https://help.heroku.com/
remote:        
remote:        Love,
remote:        Heroku
remote:        
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to safaricomplane.
remote: 
To https://git.heroku.com/safaricomplane.git
 ! [remote rejected] master -> master (pre-receive hook declined)```

@kjaisingh
Copy link

Similar issue! Cannot be solved by any of the provided suggestions.

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

9 participants