heroku-buildpack-nodejs: Error "/usr/bin/jq: Permission denied"

I did have a error today when was deploying using this package in the latest version(v176):

=====> Downloading Buildpack: https://github.com/gaffneyc/heroku-buildpack-jemalloc.git
=====> Detected Framework: jemalloc
-----> jemalloc: Vendoring 5.2.1
-----> jemalloc: Building runtime environment
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js
remote: /tmp/buildpackySeuL/lib/json.sh: line 5: /usr/bin/jq: Permission denied
remote: /tmp/buildpackySeuL/lib/json.sh: line 52: /usr/bin/jq: No such file or directory
remote:  !     Unable to parse package.json


-----> Build failed

Then I changed my buildpack url to use v174(https://github.com/heroku/heroku-buildpack-nodejs.git#v174) and it worked fine.

I did not tried v175 because was recently as well.

Just reporting to give a solution to others that might have the same error.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 36
  • Comments: 22 (12 by maintainers)

Commits related to this issue

Most upvoted comments

For anyone coming here because they are using either Herokuish or Dokku, I’ve released a new version of those.

That aside, these buildpacks are - very graciously! - provided by Heroku/Salesforce. As such, here is a bit of food for thought:

  • Heroku customers: Ya’ll should be all set, the Heroku folks make a best-in-breed platform and work real hard to make sure your use cases are taken care of.
  • Gitlab customers: Go complain to Gitlab. I don’t think they contribute back to the upstream projects (CNB, Herokuish, or Heroku’s buildpacks) in any meaningful fashion (money, time, etc.).
  • Dokku users: I actually caught this issue a while back but didn’t have time to release a new version of Herokuish. v0.5.20 was just released and should have an updated base image that pulls in JQ (our tests pass at least). Feel free to comment on gliderlabs/herokuish#617 if you still see issues.
  • Herokuish users: If you’re using Herokuish directly as part of your platform and making money from it, it probably makes sense for you all to contribute to either Herokuish or the underlying Buildpacks in some way. I’ll leave you to sort out how you want to handle that, but OSS doesn’t mean free labor.

Apologies to the NodeJS buildpack maintainers for the noise from Herokuish. Thank you for continuing your work, it is very much appreciated.

Same as @EyeCode, I am using Dokku with .buildpacks file.

Would it be possible to wait until herokuish has jq added before removing it here? Many users at Gigalixir are running into this issue as we use herokuish.

We are granting executable access to the binary when it’s installed, so I need to be able to understand why that doesn’t seem to be working.

The /usr/bin directory is not user-writable unless the compile is run as root. I’ve added some possible solutions to: https://github.com/heroku/heroku-buildpack-nodejs/pull/854/files#r519781365

To anyone hitting this issue – the underlying cause is that your Dokku base images don’t have jq installed, and whilst the buildpack could choose to download jq as a temporary stop-gap (which it tries to do at present, but fails since /usr/bin is not writeable), the better long term solution would be to update the Dokku base images to include jq for parity with the Heroku stack images.

Is anyone experiencing this on Heroku? If not, which platform? Which operating system? I am unable to produce this issue on Heroku, so I need steps to reproduce so that I can see what’s going on. We are granting executable access to the binary when it’s installed, so I need to be able to understand why that doesn’t seem to be working.

Dunno for heroku, but im using dokku with .buildpacks file to list this buildpack and got the error if i dont put the version number at the end of github url

same for me! yesterday i started seeing this issue downgraded to v175 and that worked fine for me.

-----> Cleaning up...
-----> Building jeep from herokuish...
-----> Adding BUILD_ENV to build environment...
-----> Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
       Detected buildpacks: multi nodejs php
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs
=====> Detected Framework: Node.js
remote: /tmp/buildpackwk1xz/lib/json.sh: line 5: /usr/bin/jq: Permission denied
remote: /tmp/buildpackwk1xz/lib/json.sh: line 52: /usr/bin/jq: No such file or directory
remote:  !     Unable to parse package.json


-----> Build failed

       We're sorry this build is failing! You can troubleshoot common issues here:
       https://devcenter.heroku.com/articles/troubleshooting-node-deploys

       If you're stuck, please submit a ticket so we can help:
       https://help.heroku.com/

       Love,
       Heroku

For us we are using the buildpack_url in gitlab, so its pointing right to the github as well. Downgrading to v175 worked for us

in my case is because im using dokku for testing my projects, when you’re using multiple buildpacks you should list them on a .buildpacks file. i got the node-js buildpack url from their docs, thats why im using the github url.

Sure… I’ll see how the issue progresses

A few things to note here:

  1. I’ve created a latest tag. Please use this when referencing this buildpack if you want the most up-to-date releases when using the GitHub url.
  2. @edmorley is correct, this seems like an issue with the Dokku platform. Heroku stack images provide jq, so per https://github.com/heroku/heroku-buildpack-nodejs/pull/854 we removed the dependency from the buildpack. Since Dokku seems to use a “herokuish” stack image, the stack image of the build probably needs to be updated.

Going to leave this open for a bit to give folks an opportunity to report if this resolves the issue.

@overallduka I hope you don’t mind, but I renamed your Issue because it was misleading. The issue is on master, not on v176 (as I explained above).