Ошибки при развертывании веб-сайта с использованием Heroku/Flask Server
Я пытаюсь развернуть веб-сайт с помощью Flask/SQLAlchemy для размещения базы данных с помощью официантки. Я пытался перейти по этой ссылке, но я не думаю, что моя файловая структура имеет ту же ошибку Heroku + node.js (веб-процессу не удалось привязаться к $PORT в течение 60 секунд после запуска)
Вот моя файловая структура
Server
->BarBeerDrinker
->__pycache__
->static
->__init__.py
->configt.py
->database.py
->app.py
->Procfile
->requirements.txt
Когда после попытки получить доступ к моему сайту я набираю это в своей консоли heroku log --tail
и это то, что я получаю.
2018-11-18T22:55:29.243807+00:00 heroku[web.1]: State changed from starting to crashed
2018-11-18T22:55:29.245456+00:00 heroku[web.1]: State changed from crashed to starting
2018-11-18T22:55:29.216028+00:00 heroku[web.1]: Process exited with status 1
2018-11-18T22:55:32.860988+00:00 heroku[web.1]: Starting process with command `waitress-serve --port=$8080 app:app`
2018-11-18T22:55:35.124713+00:00 app[web.1]: Traceback (most recent call last):
2018-11-18T22:55:35.124735+00:00 app[web.1]: File "/app/.heroku/python/bin/waitress-serve", line 11, in <module>
2018-11-18T22:55:35.124898+00:00 app[web.1]: sys.exit(run())
2018-11-18T22:55:35.124904+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/runner.py", line 274, in run
2018-11-18T22:55:35.125138+00:00 app[web.1]: _serve(app, **kw)
2018-11-18T22:55:35.125140+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/__init__.py", line 11, in serve
2018-11-18T22:55:35.125264+00:00 app[web.1]: server = _server(app, **kw)
2018-11-18T22:55:35.125270+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/server.py", line 85, in create_server
2018-11-18T22:55:35.125426+00:00 app[web.1]: sockinfo=sockinfo)
2018-11-18T22:55:35.125432+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/server.py", line 182, in __init__
2018-11-18T22:55:35.125614+00:00 app[web.1]: self.bind_server_socket()
2018-11-18T22:55:35.125616+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/waitress/server.py", line 294, in bind_server_socket
2018-11-18T22:55:35.125854+00:00 app[web.1]: self.bind(sockaddr)
2018-11-18T22:55:35.125857+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/asyncore.py", line 329, in bind
2018-11-18T22:55:35.126090+00:00 app[web.1]: return self.socket.bind(addr)
2018-11-18T22:55:35.126120+00:00 app[web.1]: PermissionError: [Errno 13] Permission denied
2018-11-18T22:55:35.308901+00:00 heroku[web.1]: State changed from starting to crashed
2018-11-18T22:55:35.259026+00:00 heroku[web.1]: Process exited with status 1
2018-11-18T22:55:53.439739+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=safe-sea-95736.herokuapp.com request_id=9afddc5b-75fe-4437-bd85-8ec0abf6dbb3 fwd="128.6.37.227" dyno= connect= service= status=503 bytes= protocol=https
2018-11-18T22:55:53.925888+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=safe-sea-95736.herokuapp.com request_id=29b560a2-e0d3-4814-afdd-51e767c375f9 fwd="128.6.37.227" dyno= connect= service= status=503 bytes= protocol=https
2018-11-18T22:59:39.925553+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=safe-sea-95736.herokuapp.com request_id=3633f1d0-3961-453d-b62f-8d9ba9790bfa fwd="128.6.37.227" dyno= connect= service= status=503 bytes= protocol=https
2018-11-18T22:59:40.329280+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=safe-sea-95736.herokuapp.com request_id=c1b91fc0-e2b9-41d6-9ad7-9c02033b16a2 fwd="128.6.37.227" dyno= connect= service= status=503 bytes= protocol=https
Я очень новичок в попытке развернуть веб-сайт, и я, честно говоря, просто следовал основной инструкции, которую мой профессор дал нам здесь https://drive.google.com/file/d/1dltcKrigTvtJk3hHvl7I_y0KnlGuy3V9/view?usp=sharing
1 ответ
PermissionError
указывает, что вам, вероятно, нужно дать исполняемый файл разрешений. Попробуйте дать разрешения runner.py
и / или server.py
,
chmod 777 /path/to/runner.py
chmod 777 /path/to/server.py
777
предоставит широкие права на чтение / запись / выполнение владельцу / группе / другим. Вы можете хотеть что-то более конкретное, как chmod 755 path/to/file.py
, Смотрите справочную страницу для chmod
здесь