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

App does not run: bad parsing of RALPH_BACKENDS__HTTP__LRS__HEADERS #461

Closed
Leobouloc opened this issue Oct 12, 2023 · 0 comments · Fixed by #466
Closed

App does not run: bad parsing of RALPH_BACKENDS__HTTP__LRS__HEADERS #461

Leobouloc opened this issue Oct 12, 2023 · 0 comments · Fixed by #466
Assignees
Milestone

Comments

@Leobouloc
Copy link
Contributor

Bug Report

Expected behavior/code
App should run.

Actual Behavior
As of 7cda560 , the make run does not launch app. App logs indicate an error while parsing RALPH_BACKENDS__HTTP__LRS__HEADERS :

Traceback (most recent call last):
  File "/usr/local/bin/ralph", line 33, in <module>
    sys.exit(load_entry_point('ralph-malph', 'console_scripts', 'ralph')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/ralph", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/app/src/ralph/__main__.py", line 12, in <module>
    from . import __version__, cli
  File "/app/src/ralph/cli.py", line 32, in <module>
    from ralph.backends.conf import backends_settings
  File "/app/src/ralph/backends/conf.py", line 94, in <module>
    backends_settings = BackendSettings()
                        ^^^^^^^^^^^^^^^^^
  File "pydantic/env_settings.py", line 40, in pydantic.env_settings.BaseSettings.__init__
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for BackendSettings
BACKENDS -> HTTP -> LRS -> HEADERS
  value is not a valid dict (type=type_error.dict)

A clear and concise description of the behavior.

Steps to Reproduce

  1. docker compose down --volumes
  2. rm .env
  3. make bootstrap
  4. make run
  5. Docker ralph-app-1 is not running
  6. docker logs ralph-app-1 shows error

Environment

Possible Solution
A temporary fix is to comment the problematic variable in .env and .env.dist

RALPH_BACKENDS__HTTP__LRS__HEADERS={"X-Experience-API-Version": "1.0.3", "content-type": "application/json"}
@wilbrdt wilbrdt added this to the 4.0 milestone Oct 13, 2023
@quitterie-lcs quitterie-lcs self-assigned this Oct 13, 2023
@SergioSim SergioSim linked a pull request Oct 13, 2023 that will close this issue
2 tasks
@SergioSim SergioSim removed a link to a pull request Oct 16, 2023
2 tasks
@SergioSim SergioSim linked a pull request Oct 16, 2023 that will close this issue
2 tasks
@SergioSim SergioSim removed a link to a pull request Oct 16, 2023
2 tasks
@github-project-automation github-project-automation bot moved this from Todo to Closed in Ralph roadmap Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

3 participants