Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on loading a app #82

Open
Hybridhash opened this issue Jan 14, 2023 · 2 comments
Open

Error on loading a app #82

Hybridhash opened this issue Jan 14, 2023 · 2 comments

Comments

@Hybridhash
Copy link

I have attempted to install easy auth in an existing fast API project. There are the following 2 issues encountered:

  1. Pip/Poetry add do not install all dependencies. The following dependencies are getting missed and need to be installed
    using pip or poetry one by one.
  • pydbantic
  • bycrypt
  • fastapi-mail
  • gunicorn
  • eamil-validator
  • google-api-python-client
  1. Secondly, I am getting the below error on starting the server. Not sure what is causing this problem

`ERROR: Traceback (most recent call last):
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/.venv/lib/python3.10/site-packages/starlette/routing.py", line 671, in lifespan
async with self.lifespan_context(app):
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/.venv/lib/python3.10/site-packages/starlette/routing.py", line 566, in aenter
await self._router.startup()
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/.venv/lib/python3.10/site-packages/starlette/routing.py", line 648, in startup
await handler()
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/./blog/main.py", line 26, in startup
app.auth = await EasyAuthServer.create(
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/.venv/lib/python3.10/site-packages/easyauth/server.py", line 225, in create
auth_server = cls(
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/.venv/lib/python3.10/site-packages/easyauth/server.py", line 107, in init
self.load_env_from_file(env_from_file)
File "/Users/ahmad/Library/CloudStorage/OneDrive-Personal/Coding/FastApi/blog-app/.venv/lib/python3.10/site-packages/easyauth/server.py", line 362, in load_env_from_file
env_file = json.load(json_env)
File "/Users/ahmad/.pyenv/versions/3.10.9/lib/python3.10/json/init.py", line 293, in load
return loads(fp.read(),
File "/Users/ahmad/.pyenv/versions/3.10.9/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/Users/ahmad/.pyenv/versions/3.10.9/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/ahmad/.pyenv/versions/3.10.9/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

ERROR: Application startup failed. Exiting.`

Envoirnemnt specification
python: 3.10.9
OS: MacOS

@codemation
Copy link
Owner

Hi @Hybridhash ,

1.) I would make sure that PIP is up to date on your machine, poetry is less tested right now. I expect to clean up a bit of the dependencies with future bumps of DB layer.

  1. It looks like env_from_file was specified when creating the server, but the file was not found. A good candidate for a future improvement / error handling. Thanks for reporting.

@codemation
Copy link
Owner

  • - Provide better error when failing to load json config file via env_from_file argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants