Could not parse SQLAlchemy URL from string '' au démarrage du container en mode FAKE
Hello,
J'essaie d'embarquer le dimail dans la Régie. J'arrive à faire fonctionner le tout mais quand je démarre mon container en mode FAKE, le container commence toujours par cette erreur :
2024-08-29 11:56:53 Traceback (most recent call last):
2024-08-29 11:56:53 File "/usr/local/bin/alembic", line 8, in <module>
2024-08-29 11:56:53 sys.exit(main())
2024-08-29 11:56:53 ^^^^^^
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/config.py", line 636, in main
2024-08-29 11:56:53 CommandLine(prog=prog).main(argv=argv)
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/config.py", line 626, in main
2024-08-29 11:56:53 self.run_cmd(cfg, options)
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/config.py", line 603, in run_cmd
2024-08-29 11:56:53 fn(
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/command.py", line 406, in upgrade
2024-08-29 11:56:53 script.run_env()
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/script/base.py", line 582, in run_env
2024-08-29 11:56:53 util.load_python_file(self.dir, "env.py")
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/util/pyfiles.py", line 95, in load_python_file
2024-08-29 11:56:53 module = load_module_py(module_id, path)
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/alembic/util/pyfiles.py", line 113, in load_module_py
2024-08-29 11:56:53 spec.loader.exec_module(module) # type: ignore
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "<frozen importlib._bootstrap_external>", line 940, in exec_module
2024-08-29 11:56:53 File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2024-08-29 11:56:53 File "/opt/dimail-api/src/alembic/env.py", line 163, in <module>
2024-08-29 11:56:53 run_migrations_online()
2024-08-29 11:56:53 File "/opt/dimail-api/src/alembic/env.py", line 119, in run_migrations_online
2024-08-29 11:56:53 rec["engine"] = engine_from_config(
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/create.py", line 820, in engine_from_config
2024-08-29 11:56:53 return create_engine(url, **options)
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "<string>", line 2, in create_engine
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/util/deprecations.py", line 281, in warned
2024-08-29 11:56:53 return fn(*args, **kwargs) # type: ignore[no-any-return]
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/create.py", line 546, in create_engine
2024-08-29 11:56:53 u = _url.make_url(url)
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/url.py", line 842, in make_url
2024-08-29 11:56:53 return _parse_url(name_or_url)
2024-08-29 11:56:53 ^^^^^^^^^^^^^^^^^^^^^^^
2024-08-29 11:56:53 File "/usr/local/lib/python3.11/dist-packages/sqlalchemy/engine/url.py", line 908, in _parse_url
2024-08-29 11:56:53 raise exc.ArgumentError(
2024-08-29 11:56:53 sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from string ''
Il semblerait qu'il y ait une string vide quelque part dans ma config et que run_migrations_online
n'apprécie pas.
J'ai renseigné les trois DIMAIL_****_DB_URL
, sans amélioration.
Ensuite, le container a l'air lancé normalement
Edited by Marie PUPO JEAMMET