Heroku Buildpack Multi - no Cedar-supported app detected - node.js

I am trying to use PhantomJS with NodeJS in a worker process in Heroku, but when I switched to buildpack-multi, Heroku gives me this when I push:
-----> Fetching custom git buildpack... done
! Heroku push rejected, no Cedar-supported app detected
Here is my .buildpack:
http://github.com/heroku/heroku-buildpack-nodejs.git
http://github.com/stomita/heroku-buildpack-phantomjs.git
I also have a package.json in my root directory.

Your buildpacks file should be called .buildpacks, not .buildpack. See the detect script in ddollar/heroku-buildpack-multi to see what is needed for successful detection.

Related

error code=H14 desc="No web processes running" after trying to deploy Puppeteer app Heroku

I am trying to deploy a simple app to Heroku that performs Web Scraping using Puppeteer.
Since there's a problem using Puppeteer in Heroku, I needed to define a buildpack to support Puppeteer, following these articles:
Puppeteer unable to run on heroku
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-on-heroku
https://github.com/jontewks/puppeteer-heroku-buildpack
Following these steps gave me the following error:
code=H14 desc="No web processes running"
after a bit of searching online, I found the following articles:
H14 error in heroku - "no web processes running"
saying that I have no web dynos running, and I have tried to set some up using the suggested command:
heroku ps:scale web=1
But that just gave me this error:
Scaling dynos... ! ▸ Couldn't find that process type (web).
I am running a Node.js app, using Yarn as the package manager.
What should I do?
I'll describe the process I've been through to solve this problem, which required a good amount of time.
First, I made sure that the problem is not caused by using Yarn instead of npm, according to Heroku documentation, if the root folder of your app contains yarn.lock file, then it automatically should use Yarn to build the app. But then they also say that you need to add to your package.json file a description of the version of Yarn your using, so I did:
"engines": {
"yarn": "1.x"
},
That was to make sure the problem is not yarn. which it wasn't.
Next, I have tried to understand exactly what the problem is with the web dynos, after a lot of searching I came across this:
https://help.heroku.com/W23OAFGK/why-am-i-seeing-couldn-t-find-that-process-type-when-trying-to-scale-dynos
This article also suggested using the heroku buildpacks:clear as the previous suggestion in the StackOverflow issue, but it said one more thing, super important:
Remove the existing Buildpacks...and add them again in the right order
What order? well... apparently that when I followed the previous StackOverflow issue, I have removed all the Buildpacks that came with the Heroku setup, including a very important one the heroku/nodejs build pack.
So I figured I have to re-add it to my Buildpack list. I also figured that if that is the default Buildpack that should be number one in the list, and the Buildpack for puppeteer should come after that (can be done by using the --index flag).
Finally, I solved the problems by running the following commands:
$ heroku buildpacks:clear
$ heroku buildpacks:add heroku/nodejs
$ heroku buildpacks:add --index=2 jontewks/puppeteer
$ git commit --allow-empty -m "Adjust buildpacks on Heroku"
$ git push heroku master
Running $ heroku buildpacks to confirm, returned the following:
=== workday-jobs Buildpack URLs
1. heroku/nodejs
2. jontewks/puppeteer
Now I know I have the necessary Buildpacks, in the right order, and it works!

Error pushing nodejs(express) app to heroku

I'm trying to push my nodejs(express) app to heroku using heroku push master.
I keep getting the following error:
App not compatible with buildpack:
https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz
when I participated at Node Knockout last year, I ran into the same problem.
Turned out I forgot to add a Procfile.
Do you have one? If so, could you share its content?

'Couldn't find that process type' heroku node deployment

I'm getting 'Couldn't find that process type' when I try to do $ heroku ps:scale web=1. I looked at some other solutions that suggested to make sure my Procfile is spelled correctly and pushed correctly, which is.
This is the exact error I get:
heroku ps:scale web=1
Scaling dynos... !
▸ Couldn't find that process type.
Error: ENOENT: no such file or directory, open '/Users/XXXXXX/.cache/heroku/error.log'
at Object.fs.openSync (fs.js:584:18)
at Object.fs.writeFileSync (fs.js:1316:33)
at Object.fs.appendFileSync (fs.js:1362:6)
at log (/usr/local/Cellar/heroku/6.6.7/libexec/node_modules/heroku-cli-util/lib/errors.js:87:6)
at handleErr (/usr/local/Cellar/heroku/6.6.7/libexec/node_modules/heroku-cli-util/lib/errors.js:102:9)
at process._tickCallback (internal/process/next_tick.js:109:7)
I found out what the problem was, in my project, I wasn't pushing to the master branch, and I was performing the wrong git code. So the correct way to push to Heroku if you are working on a different branch is the following:
git push heroku <branch_name>:master
Although the following answer is for Rails, it can certainly apply to any framework.
The app deployment logs are supposed to list these default types:
Default types for buildpack -> console, rake, web, worker
(this log is displayed when you run git push, you can also find them in the Activity feed of your Heroku dashboard)
If this line (or something similar) is not present, this might be due to the buildpacks of your app. You can list them with:
$ heroku buildpacks --app myapp
=== myapp Buildpack URLs
1. heroku/ruby
2. https://github.com/some/buildpack.git
In this example, heroku/ruby comes first, which might sounds legit. But it seems that the last buildpack cancels the types created by heroku/ruby. To fix this, make sure this buildpack comes last. You can achieve this with buildpacks:remove and buildpacks:add --index:
$ heroku buildpacks:remove https://github.com/some/buildpack.git --app myapp
$ heroku buildpacks:add --index 1 https://github.com/some/buildpack.git --app myapp
$ heroku buildpacks --app myapp
=== myapp Buildpack URLs
1. https://github.com/some/buildpack.git
2. heroku/ruby
Deploy the app again with git push, and it is now possible to start web and worker processes.
As Philippe mentioned heroku has many resource types, e.g. console, rake, web, worker.
My Procfile was
web: gunicorn mysite.wsgi --log-file -
so
heroku ps:scale web=0 worked for me

heroku, node, express generator (error: Push rejected, failed to detect set buildpack ...)

I am new to node and ran across this problem while trying to push to Heroku. I used the express generator to generate the file structure and am unsure of the right way to set things up, any help is appreciated!
/MyAppRoot
>MyAppDir
- package.json
- app.js
- etc.
>node_modules
-.git
I followed one of the answers in This question and get the following error:
> heroku buildpacks
=== damp-forest-32070 Buildpack URL
> git push heroku master
Counting objects: 580, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (208/208), done.
Writing objects: 100% (580/580), 1.63 MiB | 623.00 KiB/s, done.
Total 580 (delta 345), reused 564 (delta 337)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Using set buildpack heroku/nodejs
remote:
remote: ! Push rejected, failed to detect set buildpack heroku/nodejs
The answer given by Heroku's support staff when I created a ticket:
All those files should be in the repository's root directory of the application, by the sounds of it, it's one level deeper. The buildpack will only pick up the package.json file located in the root directory, and not in any sub-directory.
I re-ran the express app_name command, did a cd command into the directory, did an npm install and then git init, followed Heroku's node getting started guide and it's all good.
You have not set nodejs buildpack. try this
$ heroku buildpacks:set heroku/nodejs
and the try again $ git push heroku master
for more information on how buildpacks works click here

Is it possible to upgrade a Heroku app's buildpack after the app has been created?

I have an existing node.js app on heroku and I want to upgrade the node.js version by supplying a 0.6.7 buildpack.
Is it possible to update the buildpack a Heroku app is assigned?
If not, what is the suggested path for upgrading the builpack an app uses?
If I have to deploy a new app, how do I made sure the addons don't die?
Thanks,
Matt
This should be possible if you have a public git repo (e.g. a fork of https://github.com/heroku/heroku-buildpack-nodejs).
To update the buildpack you're using, set the BUILDPACK_URL config using the Heroku CLI:
heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-nodejs.git
(Note: replace the git URL with the URL of your buildpack.
heroku create myapp --buildpack https://github.com/heroku/heroku-buildpack-ruby
Previously you could set a config var for BUILDPACK_URL, this value will still be used if set, though a buildpack value set through the CLI will take precedence. BUILDPACK_URL as a config var is now deprecated in favor of the buildpack value on the API and in the future will be migrated.
Source: Heroku
From the Setting a Buildpack section of Heroku's buildpack documentation (June 2021)
Setting a buildpack on an application
You can change the buildpack used by an application by setting the buildpack value. When the application is next pushed, the new buildpack will be used.
$ heroku buildpacks:set heroku/php
Buildpack set. Next release on random-app-1234 will use heroku/php.
Run `git push heroku master` to create a new release using this buildpack.
You can also change it to a specific, unofficial one like this:
heroku buildpacks:set https://github.com/some/buildpack.git -a myapp
more details available on the linked page, which also includes information on how to set it when creating an app.

Resources