Deploying Dash on Heroku

Hi, I am trying to deploy a dash app on Heroku (my first time) and I obtained an Application Error (Dash App runs fine locally). When I checked the log. I obtained this below, aside installing fsspec package, what other errors is creating the Application Errors.

2022-01-26T23:42:54.565160+00:00 app[web.1]: worker.init_process()
2022-01-26T23:42:54.565160+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py”, line 134, in init_process
2022-01-26T23:42:54.565161+00:00 app[web.1]: self.load_wsgi()
2022-01-26T23:42:54.565161+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py”, line 146, in load_wsgi
2022-01-26T23:42:54.565161+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-01-26T23:42:54.565161+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py”, line 67, in wsgi
2022-01-26T23:42:54.565162+00:00 app[web.1]: self.callable = self.load()
2022-01-26T23:42:54.565162+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py”, line 58, in load
2022-01-26T23:42:54.565162+00:00 app[web.1]: return self.load_wsgiapp()
2022-01-26T23:42:54.565162+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py”, line 48, in load_wsgiapp
2022-01-26T23:42:54.565163+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-01-26T23:42:54.565163+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py”, line 359, in import_app
2022-01-26T23:42:54.565163+00:00 app[web.1]: mod = importlib.import_module(module)
2022-01-26T23:42:54.565163+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/importlib/init.py”, line 127, in import_module
2022-01-26T23:42:54.565163+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-01-26T23:42:54.565164+00:00 app[web.1]: File “”, line 1030, in _gcd_import
2022-01-26T23:42:54.565164+00:00 app[web.1]: File “”, line 1007, in _find_and_load
2022-01-26T23:42:54.565164+00:00 app[web.1]: File “”, line 986, in _find_and_load_unlocked
2022-01-26T23:42:54.565164+00:00 app[web.1]: File “”, line 680, in _load_unlocked
2022-01-26T23:42:54.565164+00:00 app[web.1]: File “”, line 850, in exec_module
2022-01-26T23:42:54.565164+00:00 app[web.1]: File “”, line 228, in _call_with_frames_removed
2022-01-26T23:42:54.565165+00:00 app[web.1]: File “/app/main.py”, line 20, in
2022-01-26T23:42:54.565165+00:00 app[web.1]: production_df=pd.read_excel(‘gs://production-data-storage-bucket/production-data.xlsx’)
2022-01-26T23:42:54.565165+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/util/_decorators.py”, line 311, in wrapper
2022-01-26T23:42:54.565165+00:00 app[web.1]: return func(*args, **kwargs)
2022-01-26T23:42:54.565165+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 457, in read_excel
2022-01-26T23:42:54.565165+00:00 app[web.1]: io = ExcelFile(io, storage_options=storage_options, engine=engine)
2022-01-26T23:42:54.565166+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1376, in init
2022-01-26T23:42:54.565166+00:00 app[web.1]: ext = inspect_excel_format(
2022-01-26T23:42:54.565166+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1250, in inspect_excel_format
2022-01-26T23:42:54.565166+00:00 app[web.1]: with get_handle(
2022-01-26T23:42:54.565166+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/common.py”, line 670, in get_handle
2022-01-26T23:42:54.565166+00:00 app[web.1]: ioargs = _get_filepath_or_buffer(
2022-01-26T23:42:54.565167+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/common.py”, line 364, in _get_filepath_or_buffer
2022-01-26T23:42:54.565167+00:00 app[web.1]: fsspec = import_optional_dependency(“fsspec”)
2022-01-26T23:42:54.565167+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/compat/_optional.py”, line 129, in import_optional_dependency
2022-01-26T23:42:54.565167+00:00 app[web.1]: raise ImportError(msg)
2022-01-26T23:42:54.565168+00:00 app[web.1]: ImportError: Missing optional dependency ‘fsspec’. Use pip or conda to install fsspec.
2022-01-26T23:42:54.565310+00:00 app[web.1]: [2022-01-26 23:42:54 +0000] [9] [INFO] Worker exiting (pid: 9)
2022-01-26T23:42:55.089570+00:00 app[web.1]: [2022-01-26 23:42:54 +0000] [17] [ERROR] Exception in worker process
2022-01-26T23:42:55.089583+00:00 app[web.1]: Traceback (most recent call last):
2022-01-26T23:42:55.089584+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/compat/_optional.py”, line 126, in import_optional_dependency
2022-01-26T23:42:55.089585+00:00 app[web.1]: module = importlib.import_module(name)
2022-01-26T23:42:55.089585+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/importlib/init.py”, line 127, in import_module
2022-01-26T23:42:55.089587+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-01-26T23:42:55.089587+00:00 app[web.1]: File “”, line 1030, in _gcd_import
2022-01-26T23:42:55.089588+00:00 app[web.1]: File “”, line 1007, in _find_and_load
2022-01-26T23:42:55.089588+00:00 app[web.1]: File “”, line 984, in _find_and_load_unlocked
2022-01-26T23:42:55.089588+00:00 app[web.1]: ModuleNotFoundError: No module named ‘fsspec’
2022-01-26T23:42:55.089590+00:00 app[web.1]:
2022-01-26T23:42:55.089590+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2022-01-26T23:42:55.089590+00:00 app[web.1]:
2022-01-26T23:42:55.089591+00:00 app[web.1]: Traceback (most recent call last):
2022-01-26T23:42:55.089592+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 589, in spawn_worker
2022-01-26T23:42:55.089593+00:00 app[web.1]: worker.init_process()
2022-01-26T23:42:55.089593+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py”, line 134, in init_process
2022-01-26T23:42:55.089594+00:00 app[web.1]: self.load_wsgi()
2022-01-26T23:42:55.089594+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py”, line 146, in load_wsgi
2022-01-26T23:42:55.089594+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-01-26T23:42:55.089594+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py”, line 67, in wsgi
2022-01-26T23:42:55.089595+00:00 app[web.1]: self.callable = self.load()
2022-01-26T23:42:55.089595+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py”, line 58, in load
2022-01-26T23:42:55.089595+00:00 app[web.1]: return self.load_wsgiapp()
2022-01-26T23:42:55.089595+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py”, line 48, in load_wsgiapp
2022-01-26T23:42:55.089596+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-01-26T23:42:55.089604+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py”, line 359, in import_app
2022-01-26T23:42:55.089604+00:00 app[web.1]: mod = importlib.import_module(module)
2022-01-26T23:42:55.089605+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/importlib/init.py”, line 127, in import_module
2022-01-26T23:42:55.089605+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-01-26T23:42:55.089605+00:00 app[web.1]: File “”, line 1030, in _gcd_import
2022-01-26T23:42:55.089605+00:00 app[web.1]: File “”, line 1007, in _find_and_load
2022-01-26T23:42:55.089606+00:00 app[web.1]: File “”, line 986, in _find_and_load_unlocked
2022-01-26T23:42:55.089606+00:00 app[web.1]: File “”, line 680, in _load_unlocked
2022-01-26T23:42:55.089606+00:00 app[web.1]: File “”, line 850, in exec_module
2022-01-26T23:42:55.089606+00:00 app[web.1]: File “”, line 228, in _call_with_frames_removed
2022-01-26T23:42:55.089607+00:00 app[web.1]: File “/app/main.py”, line 20, in
2022-01-26T23:42:55.089607+00:00 app[web.1]: production_df=pd.read_excel(‘gs://production-data-storage-bucket/production-data.xlsx’)
2022-01-26T23:42:55.089608+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/util/_decorators.py”, line 311, in wrapper
2022-01-26T23:42:55.089608+00:00 app[web.1]: return func(*args, **kwargs)
2022-01-26T23:42:55.089608+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 457, in read_excel
2022-01-26T23:42:55.089609+00:00 app[web.1]: io = ExcelFile(io, storage_options=storage_options, engine=engine)
2022-01-26T23:42:55.089609+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1376, in init
2022-01-26T23:42:55.089609+00:00 app[web.1]: ext = inspect_excel_format(
2022-01-26T23:42:55.089609+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1250, in inspect_excel_format
2022-01-26T23:42:55.089610+00:00 app[web.1]: with get_handle(
2022-01-26T23:42:55.089611+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/common.py”, line 670, in get_handle
2022-01-26T23:42:55.089611+00:00 app[web.1]: ioargs = _get_filepath_or_buffer(
2022-01-26T23:42:55.089611+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/common.py”, line 364, in _get_filepath_or_buffer
2022-01-26T23:42:55.089611+00:00 app[web.1]: fsspec = import_optional_dependency(“fsspec”)
2022-01-26T23:42:55.089612+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/compat/_optional.py”, line 129, in import_optional_dependency
2022-01-26T23:42:55.089612+00:00 app[web.1]: raise ImportError(msg)
2022-01-26T23:42:55.089612+00:00 app[web.1]: ImportError: Missing optional dependency ‘fsspec’. Use pip or conda to install fsspec.
2022-01-26T23:42:55.089767+00:00 app[web.1]: [2022-01-26 23:42:55 +0000] [17] [INFO] Worker exiting (pid: 17)
2022-01-26T23:42:55.237741+00:00 app[web.1]: [2022-01-26 23:42:55 +0000] [4] [WARNING] Worker with pid 17 was terminated due to signal 15
2022-01-26T23:42:55.332491+00:00 app[web.1]: [2022-01-26 23:42:55 +0000] [4] [INFO] Shutting down: Master
2022-01-26T23:42:55.332525+00:00 app[web.1]: [2022-01-26 23:42:55 +0000] [4] [INFO] Reason: Worker failed to boot.
2022-01-26T23:42:55.476531+00:00 heroku[web.1]: Process exited with status 3
2022-01-26T23:42:55.545480+00:00 heroku[web.1]: State changed from up to crashed
2022-01-26T23:44:05.434062+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=production-dashboard.herokuapp.com request_id=3413c598-a59d-4308-b292-296e6f45892c fwd=“41.190.3.35” dyno= connect= service= status=503 bytes= protocol=https
2022-01-26T23:44:06.997324+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" host=production-dashboard.herokuapp.com request_id=34afa681-7044-4d32-99cb-8ded76dc579f fwd=“41.190.3.35” dyno= connect= service= status=503 bytes= protocol=https

Thank you

This looks like the only one, the workers failed to boot because it’s missing a dependency and can’t do anything so it exits the worker.

Thank you. I will install fsspec and get back to you.

Hi, so I tried again with fsspec module installed and i still obtained an application error. See the logs below;

2022-01-27T09:39:16.221748+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-01-27T09:39:16.221748+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py”, line 359, in import_app
2022-01-27T09:39:16.221748+00:00 app[web.1]: mod = importlib.import_module(module)
2022-01-27T09:39:16.221748+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/importlib/init.py”, line 127, in import_module
2022-01-27T09:39:16.221749+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-01-27T09:39:16.221749+00:00 app[web.1]: File “”, line 1030, in _gcd_import
2022-01-27T09:39:16.221749+00:00 app[web.1]: File “”, line 1007, in _find_and_load
2022-01-27T09:39:16.221749+00:00 app[web.1]: File “”, line 986, in _find_and_load_unlocked
2022-01-27T09:39:16.221750+00:00 app[web.1]: File “”, line 680, in _load_unlocked
2022-01-27T09:39:16.221750+00:00 app[web.1]: File “”, line 850, in exec_module
2022-01-27T09:39:16.221750+00:00 app[web.1]: File “”, line 228, in _call_with_frames_removed
2022-01-27T09:39:16.221750+00:00 app[web.1]: File “/app/main.py”, line 20, in
2022-01-27T09:39:16.221750+00:00 app[web.1]: production_df=pd.read_excel(‘gs://production-data-storage-bucket/production-data.xlsx’)
2022-01-27T09:39:16.221751+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/util/_decorators.py”, line 311, in wrapper
2022-01-27T09:39:16.221751+00:00 app[web.1]: return func(*args, **kwargs)
2022-01-27T09:39:16.221751+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 457, in read_excel
2022-01-27T09:39:16.221760+00:00 app[web.1]: io = ExcelFile(io, storage_options=storage_options, engine=engine)
2022-01-27T09:39:16.221761+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1376, in init
2022-01-27T09:39:16.221761+00:00 app[web.1]: ext = inspect_excel_format(
2022-01-27T09:39:16.221761+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1250, in inspect_excel_format
2022-01-27T09:39:16.221762+00:00 app[web.1]: with get_handle(
2022-01-27T09:39:16.221762+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/common.py”, line 670, in get_handle
2022-01-27T09:39:16.221762+00:00 app[web.1]: ioargs = _get_filepath_or_buffer(
2022-01-27T09:39:16.221763+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/pandas/io/common.py”, line 385, in _get_filepath_or_buffer
2022-01-27T09:39:16.221763+00:00 app[web.1]: file_obj = fsspec.open(
2022-01-27T09:39:16.221764+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/core.py”, line 140, in open
2022-01-27T09:39:16.221764+00:00 app[web.1]: out = self.enter()
2022-01-27T09:39:16.221764+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/core.py”, line 103, in enter
2022-01-27T09:39:16.221764+00:00 app[web.1]: f = self.fs.open(self.path, mode=mode)
2022-01-27T09:39:16.221765+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/spec.py”, line 1009, in open
2022-01-27T09:39:16.221765+00:00 app[web.1]: f = self._open(
2022-01-27T09:39:16.221765+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/core.py”, line 1148, in _open
2022-01-27T09:39:16.221765+00:00 app[web.1]: return GCSFile(
2022-01-27T09:39:16.221765+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/core.py”, line 1268, in init
2022-01-27T09:39:16.221766+00:00 app[web.1]: super().init(
2022-01-27T09:39:16.221766+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/spec.py”, line 1351, in init
2022-01-27T09:39:16.221766+00:00 app[web.1]: self.size = self.details[“size”]
2022-01-27T09:39:16.221766+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/spec.py”, line 1364, in details
2022-01-27T09:39:16.221767+00:00 app[web.1]: self._details = self.fs.info(self.path)
2022-01-27T09:39:16.221767+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/asyn.py”, line 91, in wrapper
2022-01-27T09:39:16.221767+00:00 app[web.1]: return sync(self.loop, func, *args, **kwargs)
2022-01-27T09:39:16.221767+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/asyn.py”, line 71, in sync
2022-01-27T09:39:16.221768+00:00 app[web.1]: raise return_result
2022-01-27T09:39:16.221768+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/fsspec/asyn.py”, line 25, in _runner
2022-01-27T09:39:16.221768+00:00 app[web.1]: result[0] = await coro
2022-01-27T09:39:16.221769+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/core.py”, line 674, in _info
2022-01-27T09:39:16.221769+00:00 app[web.1]: return await self._get_object(path)
2022-01-27T09:39:16.221773+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/core.py”, line 452, in _get_object
2022-01-27T09:39:16.221773+00:00 app[web.1]: res = await self._call(“GET”, “b/{}/o/{}”, bucket, key, json_out=True)
2022-01-27T09:39:16.221773+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/core.py”, line 386, in _call
2022-01-27T09:39:16.221773+00:00 app[web.1]: status, headers, info, contents = await self._request(
2022-01-27T09:39:16.221774+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/decorator.py”, line 221, in fun
2022-01-27T09:39:16.221774+00:00 app[web.1]: return await caller(func, *(extras + args), **kw)
2022-01-27T09:39:16.221774+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/retry.py”, line 152, in retry_request
2022-01-27T09:39:16.221774+00:00 app[web.1]: raise e
2022-01-27T09:39:16.221775+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/retry.py”, line 115, in retry_request
2022-01-27T09:39:16.221775+00:00 app[web.1]: return await func(*args, **kwargs)
2022-01-27T09:39:16.221779+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/core.py”, line 378, in _request
2022-01-27T09:39:16.221779+00:00 app[web.1]: validate_response(status, contents, path, args)
2022-01-27T09:39:16.221780+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gcsfs/retry.py”, line 102, in validate_response
2022-01-27T09:39:16.221780+00:00 app[web.1]: raise HttpError(error)
2022-01-27T09:39:16.221780+00:00 app[web.1]: gcsfs.retry.HttpError: Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object., 401
2022-01-27T09:39:16.222445+00:00 app[web.1]: [2022-01-27 09:39:16 +0000] [10] [INFO] Worker exiting (pid: 10)
2022-01-27T09:39:16.374150+00:00 app[web.1]: Traceback (most recent call last):
2022-01-27T09:39:16.374156+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 209, in run
2022-01-27T09:39:16.374451+00:00 app[web.1]: self.sleep()
2022-01-27T09:39:16.374464+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 357, in sleep
2022-01-27T09:39:16.374643+00:00 app[web.1]: ready = select.select([self.PIPE[0]], , , 1.0)
2022-01-27T09:39:16.374651+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 242, in handle_chld
2022-01-27T09:39:16.374794+00:00 app[web.1]: self.reap_workers()
2022-01-27T09:39:16.374794+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 525, in reap_workers
2022-01-27T09:39:16.374997+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2022-01-27T09:39:16.375053+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer ‘Worker failed to boot.’ 3>
2022-01-27T09:39:16.375054+00:00 app[web.1]:
2022-01-27T09:39:16.375055+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2022-01-27T09:39:16.375055+00:00 app[web.1]:
2022-01-27T09:39:16.375064+00:00 app[web.1]: Traceback (most recent call last):
2022-01-27T09:39:16.375073+00:00 app[web.1]: File “/app/.heroku/python/bin/gunicorn”, line 8, in
2022-01-27T09:39:16.375171+00:00 app[web.1]: sys.exit(run())
2022-01-27T09:39:16.375184+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py”, line 67, in run
2022-01-27T09:39:16.375258+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2022-01-27T09:39:16.375269+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py”, line 231, in run
2022-01-27T09:39:16.375351+00:00 app[web.1]: super().run()
2022-01-27T09:39:16.375352+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py”, line 72, in run
2022-01-27T09:39:16.375413+00:00 app[web.1]: Arbiter(self).run()
2022-01-27T09:39:16.375415+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 229, in run
2022-01-27T09:39:16.375486+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2022-01-27T09:39:16.375494+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 342, in halt
2022-01-27T09:39:16.375642+00:00 app[web.1]: self.stop()
2022-01-27T09:39:16.375644+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 393, in stop
2022-01-27T09:39:16.375735+00:00 app[web.1]: time.sleep(0.1)
2022-01-27T09:39:16.375743+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 242, in handle_chld
2022-01-27T09:39:16.375822+00:00 app[web.1]: self.reap_workers()
2022-01-27T09:39:16.375823+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py”, line 525, in reap_workers
2022-01-27T09:39:16.375935+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2022-01-27T09:39:16.375971+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer ‘Worker failed to boot.’ 3>
2022-01-27T09:39:16.518014+00:00 heroku[web.1]: Process exited with status 1
2022-01-27T09:39:16.570261+00:00 heroku[web.1]: State changed from up to crashed
2022-01-27T09:40:00.990061+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=production-dashboard.herokuapp.com request_id=5a8bea36-2696-474f-bce5-e777c3344c31 fwd=“197.210.47.24” dyno= connect= service= status=503 bytes= protocol=https
2022-01-27T09:40:01.828267+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" host=production-dashboard.herokuapp.com request_id=c264df8f-08b5-4709-b8ac-207579d7e1ea fwd=“197.210.47.24” dyno= connect= service= status=503 bytes= protocol=https

Any idea what the issue is now?

Hi,

It seems that your storage is not public and the app in Heroku does not have permission to get the file from it. Does it work locally? If so, how are you authenticating to GCP? You can find some alternatives here

1 Like

oh… yeah it works locally, I had a json key file I downloaded and added to the environment variable. So I didn’t need to specify my Google Credentials.

Should I just make the bucket public and try again?

Agreed. You perhaps need some kind of API credentials or authentication to allow you to access the Google object you are trying to access.

Try with a public bucket first yes. If that solves it, then this confirms the source of the problem.

EDIT: Forgive me for replying to the wrong post, this should have been a reply to Oladayo.

1 Like

It worked when I enabled the bucket to be public.

So @jlfsjunior and you are right. Now I need to find how to read it from when the permission is set to private.

Thank you so much

Here is an alternative. It is safer to add the json content as an environment variable (eg via the UI) than committing with the application. It is also a good idea to create a service account/credentials with read-only access to the storage in GCP.

Glad it work it out!

Thanks. I will check it out

You might have to “generate” credentials.
Creating and managing service account keys | Cloud IAM Documentation | Google Cloud

It looks like you might have some permission issues. Your program looks like its looking for a file on good cloud storage and it doesn’t have permissions to get it.

Edit: Woops my bad, didn’t see others had responded with this already…need more coffee…

1 Like

Thank you… You are right.

Thank you. I will check it out

So something I read from the link How to authenticate Google Cloud Services on Heroku for Node.js App | by Naz Islam | Medium, you need to set the google credentials after deploying the app.

heroku config:set GOOGLE_APPLICATION_CREDENTIALS =‘config/keyFile.json’

The json file (service account key) has to be in the project directory

Then it worked fine with the bucket returned back to private.

Thank you everyone @jlfsjunior @human42 @tphil10 :slight_smile:

1 Like