fail to run hatch run dev.server.start #204
Replies: 3 comments
-
Hail, @wesleysanjose 👋 Welcome to Fief's kingdom! Our team will get back to you very soon to help. In the meantime, take a minute to star our repository ⭐️ Farewell! |
Beta Was this translation helpful? Give feedback.
-
i am using python 3.10 and on a macbook |
Beta Was this translation helpful? Give feedback.
-
To run in development mode, you need to set the required environment variables, as stated in the error message:
In development, it's easier to manage this through a fief/.devcontainer/post-create.sh Lines 8 to 9 in c871252 To make it run, you'll also need a running Redis server (e.g. in a Docker container). It's worth noting that we've set up a ready-to-use development environment using GitHub Codespaces, which saves you all those steps: https://github.com/fief-dev/fief#development |
Beta Was this translation helpful? Give feedback.
-
clone the github project and trying to run dev.server.start, seeing following error
~/dev/fief main !2 hatch run dev.server.start ✔ fastapi-users 19:34:29
cmd [1] | hatch run translations.compile
compiling catalog fief/locale/en_US/LC_MESSAGES/messages.po to fief/locale/en_US/LC_MESSAGES/messages.mo
compiling catalog fief/locale/pt_BR/LC_MESSAGES/messages.po to fief/locale/pt_BR/LC_MESSAGES/messages.mo
compiling catalog fief/locale/it_IT/LC_MESSAGES/messages.po to fief/locale/it_IT/LC_MESSAGES/messages.mo
compiling catalog fief/locale/pt_PT/LC_MESSAGES/messages.po to fief/locale/pt_PT/LC_MESSAGES/messages.mo
compiling catalog fief/locale/zh_CN/LC_MESSAGES/messages.po to fief/locale/zh_CN/LC_MESSAGES/messages.mo
compiling catalog fief/locale/es_ES/LC_MESSAGES/messages.po to fief/locale/es_ES/LC_MESSAGES/messages.mo
compiling catalog fief/locale/pl_PL/LC_MESSAGES/messages.po to fief/locale/pl_PL/LC_MESSAGES/messages.mo
compiling catalog fief/locale/fr_FR/LC_MESSAGES/messages.po to fief/locale/fr_FR/LC_MESSAGES/messages.mo
compiling catalog fief/locale/de_DE/LC_MESSAGES/messages.po to fief/locale/de_DE/LC_MESSAGES/messages.mo
cmd [2] | hatch run static.build
./styles/globals.scss → ./fief/static/admin.css...
(!) The emitted file "admin.css" overwrites a previously emitted file of the same name.
created ./fief/static/admin.css in 1.5s
./styles/globals.scss → ./fief/static/auth.css...
(!) The emitted file "auth.css" overwrites a previously emitted file of the same name.
created ./fief/static/auth.css in 428ms
./js/code-editor.mjs → ./fief/static/code-editor.bundle.js...
created ./fief/static/code-editor.bundle.js in 6.6s
cmd [3] | uvicorn --host 0.0.0.0 --port 8000 fief.app:app
Traceback (most recent call last):
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/bin/uvicorn", line 10, in
sys.exit(main())
^^^^^^
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/uvicorn/main.py", line 403, in main
run(
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/uvicorn/main.py", line 568, in run
server.run()
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/uvicorn/server.py", line 59, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1517, in uvloop.loop.Loop.run_until_complete
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/uvicorn/server.py", line 66, in serve
config.load()
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/uvicorn/config.py", line 471, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/missa/Library/Application Support/hatch/env/virtual/fief-server/vk1mo804/fief-server/lib/python3.11/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1206, in _gcd_import
File "", line 1178, in _find_and_load
File "", line 1149, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/Users/missa/dev/fief/fief/app.py", line 10, in
from fief.apps import api_app, auth_app, dashboard_app
File "/Users/missa/dev/fief/fief/apps/init.py", line 1, in
from fief.apps.api.app import app as api_app
File "/Users/missa/dev/fief/fief/apps/api/app.py", line 5, in
from fief.apps.api.routers.clients import router as clients_router
File "/Users/missa/dev/fief/fief/apps/api/routers/clients.py", line 5, in
from fief import schemas
File "/Users/missa/dev/fief/fief/schemas/init.py", line 1, in
from fief.schemas import (
File "/Users/missa/dev/fief/fief/schemas/client.py", line 4, in
from fief.models.client import ClientType
File "/Users/missa/dev/fief/fief/models/init.py", line 1, in
from fief.models.admin_api_key import AdminAPIKey
File "/Users/missa/dev/fief/fief/models/admin_api_key.py", line 5, in
from fief.models.base import MainBase
File "/Users/missa/dev/fief/fief/models/base.py", line 3, in
from fief.settings import settings
File "/Users/missa/dev/fief/fief/settings.py", line 196, in
settings = Settings()
^^^^^^^^^^
File "pydantic/env_settings.py", line 39, in pydantic.env_settings.BaseSettings.init
File "pydantic/main.py", line 341, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 4 validation errors for Settings
secret
field required (type=value_error.missing)
encryption_key
field required (type=value_error.missing)
fief_client_id
field required (type=value_error.missing)
fief_client_secret
field required (type=value_error.missing)
Beta Was this translation helpful? Give feedback.
All reactions