Why doesn't Heroku detect my Procfile? - heroku

Heroku does not see my Procfile and begins installing the wrong version of py.
I'm trying to upload an extremely basic flask app using Heroku. As per other suggestions on SO, I've created my Procfile, runtime.txt, and requirements.txt using the command line, rather than through an editor. I've also ensured that they are located in the base git directory. When I enter
$ git push heroku master
I get the following:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: ! Warning: Your application is missing a Procfile. This file tells Heroku how to run your application.
remote: ! Learn more: https://devcenter.heroku.com/articles/procfile
remote: -----> Installing python-2.7.13
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: Invalid requirement: 'Python 3.6.1'
remote: Traceback (most recent call last):
remote: File "/app/.heroku/python/lib/python2.7/site-packages/pip/req/req_install.py", line 82, in __init__
remote: req = Requirement(req)
remote: File "/app/.heroku/python/lib/python2.7/site-package/pip/_vendor/packaging/requirements.py", line 96, in __init__
remote: requirement_string[e.loc:e.loc + 8]))
remote: InvalidRequirement: Invalid requirement, parse error at "u'3.6.1'"
remote:
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to salty-springs-82445.
remote:
To https://git.heroku.com/salty-springs-82445.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/salty-springs 82445.git'
Contents of Procfile:
web: python run.py
Here is the project structure:
▾ Random_world/
▸ __pycache__/
▾ app/
▸ __pycache__/
▸ static/
▸ templates/
__init__.py
main.py*
test.txt
▸ venv/
config.py
d.py*
os
Procfile
randomizer.py
randomizer.pyc
README.md
requirements.txt
run.py*
runtime.txt
test.txt
word_blocks.py
word_blocks.pyc
Thanks.

Figured it out. The Procfile was in my .gitignore, stupidly added by me.
Sidenote: the app wouldn't deploy at all because I was pushing from the wrong branch.

My guess is you forgot to add and commit your Procfile to git.

Related

Push react-flask-redis app to Heroku fails

I ma trying to add a react-flask-redis app to Heroku. How can I find the source of the issue. The structure of files are as follows:
root >
> frontend\
> backend\
> Procfile
However, it gives this error:
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Determining which buildpack to use for this app
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to new-app-9876.
remote:
To https://git.heroku.com/new-app-9876.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/new-app-9876.git'

HEROKU : deploy a symfony 4 app push failed

josh#josh:~/my_projects/la_manne$ git push heroku master
Énumération des objets: 3, fait.
Décompte des objets: 100% (3/3), fait.
Écriture des objets: 100% (3/3), 230 octets | 230.00 Kio/s, fait.
Total 3 (delta 0), réutilisés 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 73ed9a909f2a7e80a0a45f0f5d86aa6c7fdd70c1
remote: !
remote: ! We have detected that you have triggered a build from source code with version 73ed9a909f2a7e80a0a45f0f5d86aa6c7fdd70c1
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to lamanne.
remote:
To https://git.heroku.com/lamanne.git
! [remote rejected] master -> master (pre-receive hook declined)
error: impossible de pousser des références vers 'https://git.heroku.com/lamanne.git'
remote: -----> Building on the Heroku-20 stack
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
https://github.com/heroku/heroku-buildpack-php#usage
You'll need to use at least an empty composer.json in your
application.
$ echo '{}' > composer.json
$ git add composer.json
$ git commit -m "add composer.json for PHP app detection"
If you also have files from other frameworks or languages that could
trigger another buildpack to detect your application as one of its
own, e.g. a package.json which might cause your code to be detected
as a Node.js application even if it is a PHP application, then you
need to manually set your application to use this buildpack:
$ heroku buildpacks:set heroku/php
This will use the officially published version. To use the default
branch from GitHub instead:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-php
Please refer to Dev Center for further usage instructions.

Heroku: django.core.exceptions.ImproperlyConfigured: Could not find the GDAL

I'm trying to run geodjango application on heroku and i added a build pack to make gdal available
https://github.com/cyberdelia/heroku-geo-buildpack.git. During push it's says that gdal and other geotools successfully installed
remote: -----> geos/gdal/proj app detected
remote: Using geos version: 3.6.1
remote: Using gdal version: 2.1.3
remote: Using proj version: 4.9.3
remote: -----> Vendoring geo libraries done
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.4 (you are using python-3.6.2, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.4).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:
remote: -----> $ python manage.py collectstatic --noinput
remote: 1018 static files copied to '/tmp/build_2e0a13e9519778105269a34/test/staticfiles', 1158 post-processed.
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 235.8M
remote: -----> Launching...
remote: Released v60
remote: https://test.herokuapp.com deployed to Heroku
remote:
remote: Verifying deploy... done.
When i request page it says that application error.
from heroku logs
2018-03-19T14:25:00.614100+00:00 app[web.1]: from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi
2018-03-19T14:25:00.614103+00:00 app[web.1]: from django.contrib.gis.gdal.libgdal import GDAL_VERSION, lgdal
2018-03-19T14:25:00.614104+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/contrib/gis/gdal/libgdal.py", line 43, in <module>
2018-03-19T14:25:00.614106+00:00 app[web.1]: % '", "'.join(lib_names)
2018-03-19T14:25:00.614813+00:00 app[web.1]: [2018-03-19 14:25:00 +0000] [9] [INFO] Worker exiting (pid: 9)
2018-03-19T14:25:00.746744+00:00 app[web.1]: [2018-03-19 14:25:00 +0000] [4] [INFO] Shutting down: Master
2018-03-19T14:25:00.746839+00:00 app[web.1]: [2018-03-19 14:25:00 +0000] [4] [INFO] Reason: Worker failed to boot.
2018-03-19T14:25:00.614110+00:00 app[web.1]: django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal", "GDAL", "gdal2.2.0", "gdal2.1.0", "gdal2.0.0", "gdal1.11.0", "gdal1.10.0", "gdal1.9.0"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.>
Should i specify some path in settings or may be i'm using incompatible versions? (i'm using Django==2.0.2)
From Heroku's docs, add the following to your settings.py:
import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis'
GDAL_LIBRARY_PATH = os.getenv('GDAL_LIBRARY_PATH')
GEOS_LIBRARY_PATH = os.getenv('GEOS_LIBRARY_PATH')
Here is the correct Heroku Documentation on how to include gdal in your Heroku app. In brief, in your Django App root:
1. Create an empty file called Aptfile
2. In that file, include the line `gdal-bin` and save
Then:
$ git add Aptfile
$ git commit -m "Add apt dependency"
$ git push heroku master
This should have gdal running and accessible on your dyno.

Not able to push Vapor to Heroku

I made some minor changes in Vapor / Swift code. Trying to push no Heroku, but get an error.
remote: -----> Downloading curl 7.52.1
remote: tar: This does not look like a tar archive
remote:
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote: ! Push rejected, failed to compile curl app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to frozen-sea-46940.
remote:
To https://git.heroku.com/frozen-sea-46940.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/frozen-sea-46940.git'
Completed with errors, see above
I event called an vapor update, regenerated Xcode project but did not helped. Any idea?
Kukoda-MacBook-Pro:frozen-sea-46940 kukodajanos$ heroku buildpacks
=== frozen-sea-46940 Buildpack URLs
1. https://github.com/vzsg/heroku-buildpack-curl-http2.git
2. https://github.com/vapor-community/heroku-buildpack.git
Push your project to Heroku again, it will work now.
The issue was in the curl-http2 buildpack: the version it was trying to download no longer exists on Ubuntu's servers. I have resolved this just now.
Should you run into a similar problem in the future, and it's not a build error in your application code, please open an issue at the GitHub repo of the failing buildpack.

Heroku buildpack for Dart: Pushing app to Heroku

I am using this "Heroku buildpack for Dart" from the following Github repository: https://github.com/igrigorik/heroku-buildpack-dartam .
I followed the set of commands to deploy the HTTP server built with Dart to Heroku and once I try to push the app to Heroku (git push heroku master) I receive the following error:
remote: End-of-central-directory signature not found. Either
remote: this file is not a zipfile, or it constitutes one disk of
remote: a multi-part archive. In the latter case the central
remote: directory and zipfile comment will be found on the last
remote: disk(s) of this archive.
remote: unzip: cannot find zipfile directory in one of dart-
remote: sdk.zip or dart-sdk.zip.zip, and cannot find dart-
remote: sdk.zip.ZIP, period.
remote: ! Push rejected, failed to compile Dart app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to testdartapp.
remote:
To https://git.heroku.com/testdartapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
'https://git.heroku.com/testdartapp.git'
I am attaching a screenshot of my terminal output: Pushing app to Heroku
Any advice is much appreciated! Thanks in advance.

Resources