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

Crash when API_POLL_FREQUENCY or API_POLL_TIMEOUT is set #140

Open
Fitzsimmons opened this issue Jan 21, 2025 · 3 comments
Open

Crash when API_POLL_FREQUENCY or API_POLL_TIMEOUT is set #140

Fitzsimmons opened this issue Jan 21, 2025 · 3 comments

Comments

@Fitzsimmons
Copy link

Version: 2.17.0

Crashes if API_POLL_FREQUENCY is set as an environment variable:

Traceback (most recent call last):
  File "/opt/venv/bin/edge-proxy-serve", line 8, in <module>
    sys.exit(serve())
             ^^^^^^^
  File "/app/src/edge_proxy/main.py", line 7, in serve
    settings = get_settings()
               ^^^^^^^^^^^^^^
  File "/app/src/edge_proxy/settings.py", line 152, in get_settings
    return AppConfig()
           ^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/pydantic_settings/main.py", line 84, in __init__
    super().__init__(
  File "/opt/venv/lib/python3.12/site-packages/pydantic/main.py", line 176, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for AppConfig
api_poll_frequency
  Extra inputs are not permitted [type=extra_forbidden, input_value='300', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/extra_forbidden

Steps to reproduce:

docker run --rm -e API_POLL_FREQUENCY=300 flagsmith/edge-proxy:2.17.0

or

docker run --rm -e API_POLL_TIMEOUT=300 flagsmith/edge-proxy:2.17.0

Additional information:

@rolodato
Copy link
Member

Hi @Fitzsimmons - just to make sure I understood, this is only an issue with the docs? We can make that correction for sure, thanks for pointing it out.

@matthewelwell
Copy link
Contributor

@rolodato I think there's also a (less important) improvement we can make to the code as per the PR here, although I can't work out why the implementation doesn't work... more pydantic investigation needed.

@rolodato
Copy link
Member

Docs PR created Flagsmith/flagsmith#5034

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

No branches or pull requests

3 participants