Running into some issues I can't figure out

Hey all, I’m very new to render. My project works outside of render but when I build it here I basically run into a whole wall of issues.

Could someone point me in the right direction? I may need some step-by-step if you could.

Code:

INFO==> Running 'gunicorn app:app'

May 15 01:00:39 AMINFOTraceback (most recent call last):

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/bin/gunicorn", line 8, in <module>

May 15 01:00:39 AMINFO sys.exit(run())

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 67, in run

May 15 01:00:39 AMINFO WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]", prog=prog).run()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 236, in run

May 15 01:00:39 AMINFO super().run()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 72, in run

May 15 01:00:39 AMINFO Arbiter(self).run()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 58, in __init__

May 15 01:00:39 AMINFO self.setup(app)

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/arbiter.py", line 118, in setup

May 15 01:00:39 AMINFO self.app.wsgi()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi

May 15 01:00:39 AMINFO self.callable = self.load()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load

May 15 01:00:39 AMINFO return self.load_wsgiapp()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp

May 15 01:00:39 AMINFO return util.import_app(self.app_uri)

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/gunicorn/util.py", line 371, in import_app

May 15 01:00:39 AMINFO mod = importlib.import_module(module)

May 15 01:00:39 AMINFO File "/opt/render/project/python/Python-3.10.12/lib/python3.10/importlib/__init__.py", line 126, in import_module

May 15 01:00:39 AMINFO return _bootstrap._gcd_import(name[level:], package, level)

May 15 01:00:39 AMINFO File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

May 15 01:00:39 AMINFO File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

May 15 01:00:39 AMINFO File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked

May 15 01:00:39 AMINFO File "<frozen importlib._bootstrap>", line 688, in _load_unlocked

May 15 01:00:39 AMINFO File "<frozen importlib._bootstrap_external>", line 883, in exec_module

May 15 01:00:39 AMINFO File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

May 15 01:00:39 AMINFO File "/opt/render/project/src/app.py", line 17, in <module>

May 15 01:00:39 AMINFO client = APIClient(TOKEN, client_secret=CLIENT_SECRET)

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/client.py", line 57, in __init__

May 15 01:00:39 AMINFO self._validate_token()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/client.py", line 61, in _validate_token

May 15 01:00:39 AMINFO self.users.get_current_user()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/impl/userapi.py", line 55, in get_current_user

May 15 01:00:39 AMINFO payload = Request.make_request(self._token, url, "GET")

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/request.py", line 83, in make_request

May 15 01:00:39 AMINFO return req.execute()

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/request.py", line 74, in execute

May 15 01:00:39 AMINFO return raise_error_or_return(r) # type: ignore[return-value]

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/errors.py", line 72, in raise_error_or_return

May 15 01:00:39 AMINFO _handle_other_err(json_data)

May 15 01:00:39 AMINFO File "/opt/render/project/src/.venv/lib/python3.10/site-packages/zenora/errors.py", line 49, in _handle_other_err

May 15 01:00:39 AMINFO for x in data["errors"]:

May 15 01:00:39 AMINFOKeyError: 'errors'

Hi there,

From the logs you’ve provided, the problem appears to be coming from your application:

May 15 01:00:39 AMINFO for x in data["errors"]:May 15 01:00:39 AMINFO KeyError: 'errors'

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

Understood. My issue is I have no idea what’s going on. This code works flawlessly on two other machines. So what happened in Render to make this NOT work.

So it turned out to be that in Render, it could not pull my config.py file.

I had:

from config import *

and I got all of those errors. Now that I’ve taken my entire config.py and pasted it into the top of my app.py the errors are gone, the application runs and I now have a database error I can probably troubleshoot but the web app itself is functional.

This may be a good thing for the Render team to look into, in case it’s something that Render is not capable of yet.

Best,

Mikey

Hi there,

Render typically takes a very hands-off approach to service configuration, leaving it to the user for the most flexibility possible.

Appreciate the feedback nonetheless!

Regards,
Mike


Render Support Engineer, MT (UTC-6, UTC-7 in Winter)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.