2

I dont know why this gives an error but everything looks perfect i have tried so many times but this is not working i even gone through the stackoverflow answers nothing helped.I have another app which works fine with this same procfile and port but this gives an error.

The heroku log looks like this

2018-04-09T08:05:54.000000+00:00 app[api]: Build started by user [email protected]
2018-04-09T08:06:32.244340+00:00 app[api]: Deploy cdc01e38 by user [email protected]
2018-04-09T08:06:32.244340+00:00 app[api]: Release v31 created by user [email protected]
2018-04-09T08:05:54.000000+00:00 app[api]: Build succeeded
2018-04-09T08:09:55.988992+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=infinite-ridge-58576.herokuapp.com request_id=ca935db6-12ed-4332-ad05-4d7957bebece fwd="106.51.27.121" dyno= connect= service= status=503 bytes= protocol=https
2018-04-09T08:09:56.406479+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=infinite-ridge-58576.herokuapp.com request_id=65072529-5e63-4ac1-aa72-990359025bd2 fwd="106.51.27.121" dyno= connect= service= status=503 bytes= protocol=https

app.py

import os
import csv
import pandas as pd
from flask import Flask, render_template, request, send_file
import clearbit
import json
clearbit.key = 'yourkey'
app = Flask(__name__)

APP__ROOT = os.path.dirname(os.path.abspath(__file__))


@app.route("/")
def index():
    return render_template("upload.html")

@app.route("/return-file/")
def return_file():

    return send_file('new.csv', as_attachment=True)

@app.route("/upload", methods=['POST'])
def upload():
    target = os.path.join(APP__ROOT)
    print(target)

    if not os.path.isdir(target):
        os.mkdir(target)

    for file in request.files.getlist("file"):
        filename = file.filename
        print(filename)
        destination = "/".join([target, filename])
        print(destination)
        file.save(destination)
        new_path = os.path.abspath(filename)
        print(new_path)
    df = pd.read_csv(new_path, sep=',', encoding="ISO-8859-1")
    saved_column = df['Company'].dropna()
    i = 0
    res = []
    for data in saved_column:
        n = saved_column.get(i)
        ns = len(n.split())
        if ns > 4:
            n = 'never get a website'
        else:
            print("a")
        i = i + 1
        print(n)
        data = clearbit.NameToDomain.find(name=n)
        print("\n")
        print(data)
        if data != None:
            res.append(data['domain'])
        else:
            res.append('none.com')
    print(res)
    df['Domain'] = res
    print(df['Domain'])
    df.to_csv("new.csv", index=False)
    downloadpath = "new.csv"
    os.remove(os.path.abspath(new_path) )

    return render_template("complete.html", name=downloadpath)

if __name__ == "__main__":
    port = int(os.environ.get("PORT", 5000))
    app.run(host='0.0.0.0', port=port, debug=True)

Procfile

web: python app.py runserver 0.0.0.0:5000

2 Answers 2

2

I did the same as the above answer. I copied and pasted all my files into a new folder and then reinitialised the git repo. then git add and commit. and then continued with the heroku commands.

This also happens when No Procfile is defined. Or Procfile is defined but has typo-named it like procfile instead of Procfile. or Procfile has error code in it.

I added my procfile this way instead of manually creating it.: echo "web: python app:app" > Procfile

When you are trying to deploy you will see this error message:

remote: -----> Discovering process types
remote: 
`Mis-cased procfile detected; ignoring.
remote:  ~     Rename it to Procfile to have it honored.
remote: 
remote:        Procfile declares types -> (none)`

if everything goes well while deploying, then it should look like this :

remote: 
remote: -----> Discovering process types
remote:        Procfile declares types -> web
Sign up to request clarification or add additional context in comments.

Comments

1

I just changed the hosting app and created a new app on heroku and it worked. the error would be the build packs used in it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.