1

We are build an API on Heroku and have been moving pretty quickly until we recently added opencv via https://www.npmjs.com/package/opencv4nodejs

Works fine on development environment and also if we deploy using git push, but if we try to use Heroku CI build fails.

I've tried with and without the OPENCV4NODEJS_DISABLE_AUTOBUILD flag with no success. Also if I change the node/npm versions the deploy also seems to fail (unsure if it's related).

-----> Fetching starkast/cmake buildpack...
       buildpack downloaded
-----> Fetching https://github.com/onboardiq/heroku16-buildpack-opencv3.git buildpack...
       buildpack downloaded
-----> Fetching heroku/nodejs buildpack...
       buildpack downloaded
-----> CMake app detected
-----> Installing CMake version: 3.8.1
       Downloading binary distribution
       Verifying download
gpg: new configuration file `/app/.gnupg/gpg.conf' created
gpg: WARNING: options in `/app/.gnupg/gpg.conf' are not yet active during this run

...

-----> Creating environment variables.
cp: '/app/.heroku/cmake' and '/app/.heroku/cmake' are the same file
cp: '/app/.heroku/vendor' and '/app/.heroku/vendor' are the same file
cp: '/app/.profile.d/opencv.sh' and '/app/.profile.d/opencv.sh' are the same file
cp: '/app/.profile.d/sprettur.sh' and '/app/.profile.d/sprettur.sh' are the same file
-----> Node.js app detected
bash: /tmp/buildpacks/9bc901852117be66dc68068325767a3d2b8ee44665d854d905a7c1524cf353680e0850b0ce15a6f75047288aa1c0ddbec0154cab65cd63fa33e54f02a7b570b6/export: No such file or directory

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=false
       NODE_VERBOSE=false
       NODE_ENV=test
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  8.11.4
       engines.npm (package.json):   5.6.0

       Resolving node version 8.11.4...
       Downloading and installing node 8.11.4...
       npm 5.6.0 already installed with node

-----> Building dependencies
       Installing node modules (package.json + package-lock)

       > opencv-build@0.0.15 install /app/node_modules/opencv-build
       > node ./install.js

       info install if you want to use an own OpenCV installation set OPENCV4NODEJS_DISABLE_AUTOBUILD
       info install library dir does not exist: /app/node_modules/opencv-build/opencv/build/lib
       info install running install script...
       ERR! Error: Command failed: cmake --version
       /bin/sh: 1: cmake: not found

       npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! opencv-build@0.0.15 install: `node ./install.js`
       npm ERR! Exit status 1
       npm ERR! 
       npm ERR! Failed at the opencv-build@0.0.15 install script.
       npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

       npm ERR! A complete log of this run can be found in:
       npm ERR!     /tmp/npmcache.VAgJQ/_logs/2018-10-08T16_13_39_048Z-debug.log
-----> Build failed

Here is my app.json as per https://stackoverflow.com/a/51351494/5028937

{
  "name": "myappname",
  "scripts": {},
  "env": {
    "GOOGLE_MAPS_API_KEY": {
      "required": true
    },
    "DATABASE_URL": {
      "required": true
    },
    "OPENCV4NODEJS_DISABLE_AUTOBUILD": {
      "required": true,
      "value": 1
    },
    "OVERPASS_URL": {
      "required": true
    }
  },
  "formation": {
    "web": {
      "quantity": 1
    }
  },
  "stack": "heroku-16",

  "buildpacks": [{
    "url": "starkast/cmake"
  }, {
    "url": "https://github.com/onboardiq/heroku16-buildpack-opencv3.git"
  }, {
    "url": "heroku/nodejs"
  }]
}
rodcul
  • 23
  • 3

1 Answers1

0

Try to remove the opencv buildpack from app.json and add it via heroku buildpacks:add

Anatolii Suhanov
  • 2,524
  • 1
  • 12
  • 14