You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org> on 2025/05/13 12:33:11 UTC
[I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
OleksandrBrukhalskyi opened a new issue, #50538:
URL: https://github.com/apache/airflow/issues/50538
### Apache Airflow version
3.0.1
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
I upgraded to Airflow version of `3.0.1` because I had some problem with infinite reloading during sign in `3.0.1`
Now, I have a problem with start up process of `airflow-apiserver` in Ubuntu Server and my host machine
It throws this exception.
`airflow-apiserver-1 | INFO: Started server process [1055]
airflow-apiserver-1 | INFO: Waiting for application startup.
airflow-apiserver-1 | ERROR: Traceback (most recent call last):
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/starlette/routing.py", line 692, in lifespan
airflow-apiserver-1 | async with self.lifespan_context(app) as maybe_state:
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
airflow-apiserver-1 | return await anext(self.gen)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/fastapi/routing.py", line 133, in merged_lifespan
airflow-apiserver-1 | async with original_context(app) as maybe_original_state:
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
airflow-apiserver-1 | return await anext(self.gen)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/fastapi/routing.py", line 133, in merged_lifespan
airflow-apiserver-1 | async with original_context(app) as maybe_original_state:
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
airflow-apiserver-1 | return await anext(self.gen)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/airflow/api_fastapi/app.py", line 62, in lifespan
airflow-apiserver-1 | await stack.enter_async_context(
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 650, in enter_async_context
airflow-apiserver-1 | result = await _enter(cm)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
airflow-apiserver-1 | return await anext(self.gen)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/fastapi/routing.py", line 133, in merged_lifespan
airflow-apiserver-1 | async with original_context(app) as maybe_original_state:
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
airflow-apiserver-1 | return await anext(self.gen)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/svcs/fastapi.py", line 66, in __call__
airflow-apiserver-1 | async with self.registry, cm(app, self.registry) as state:
airflow-apiserver-1 | File "/usr/local/lib/python3.11/contextlib.py", line 210, in __aenter__
airflow-apiserver-1 | return await anext(self.gen)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^
airflow-dag-processor-1 | [2025-05-13T12:26:14.926+0000] {dag.py:1895} INFO - Sync 1 DAGs
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/airflow/api_fastapi/execution_api/app.py", line 94, in lifespan
airflow-apiserver-1 | registry.register_value(JWTValidator, _jwt_validator(), ping=JWTValidator.status)
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/airflow/api_fastapi/execution_api/app.py", line 65, in _jwt_validator
airflow-apiserver-1 | **get_sig_validation_args(make_secret_key_if_needed=False),
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/airflow/api_fastapi/auth/tokens.py", line 578, in get_sig_validation_args
airflow-apiserver-1 | return {"secret_key": get_signing_key("api_auth", "jwt_secret", make_secret_key_if_needed)}
airflow-dag-processor-1 | [2025-05-13T12:26:14.955+0000] {dag.py:2509} INFO - Setting next_dagrun for tutorial_dag to None, run_after=None
airflow-apiserver-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
airflow-apiserver-1 | File "/home/airflow/.local/lib/python3.11/site-packages/airflow/api_fastapi/auth/tokens.py", line 535, in get_signing_key
airflow-apiserver-1 | raise ValueError(f"The value {section}/{key} must be set!")
airflow-apiserver-1 | ValueError: The value api_auth/jwt_secret must be set!`
### What you think should happen instead?
_No response_
### How to reproduce
I use this Docker image: [3.0.1-python3.11](https://hub.docker.com/layers/apache/airflow/3.0.1-python3.11/images/sha256-8a13fd54f21e9d0bb5f99e5166b162c16c8402e7b6cc8a043b6a8a7c30f2c59a)
### Operating System
Ubuntu Server/ MacOS Sequoia 15.3.1
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #50538: ValueError: The value api_auth/jwt_secret must be set!
URL: https://github.com/apache/airflow/issues/50538
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-4473193805
This issue has been closed because it has not received response from the issue author.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "dobsontom (via GitHub)" <gi...@apache.org>.
dobsontom commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-3001659949
**Helm 1.17.0 / Airflow 3.0.2**
* **Crash 1**
`Error: couldn't find key jwt_secret in Secret <ns>/airflow-jwt-secret`
* **After renaming**
Same message, but for `jwt-secret`.
| Chart code path | Key it expects |
|-----------------|----------------|
| `templates/secrets/jwt-secret.yaml` (PR #51799 “Always deploy jwt secret”) | **jwt-secret** |
| Env-var helper that mounts the file (PR #49923 “Generate JWT secret during HELM install”) | **jwt_secret** |
Airflow itself looks for the underscore version (`[api_auth] jwt_secret`).
Packaging two copies of the value in the Secret—
```yaml
data:
jwt_secret: <value>
jwt-secret: <same value>
```
—unblocks the cluster, but the chart really needs to normalise on a single name.
Hope this helps triage!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org>.
OleksandrBrukhalskyi closed issue #50538: ValueError: The value api_auth/jwt_secret must be set!
URL: https://github.com/apache/airflow/issues/50538
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-3006188614
Have you tried to create:
```bash
kubectl -n airflow create secret generic airflow-jwt-secret --from-literal="jwt-secret=$(python3 -c 'import secrets; print(secrets.token_hex(16))')"
```
And add in helm chart:
```yaml
jwtSecretName: airflow-jwt-secret
```
The Secret name could be anything but the value MUST BE `jwt-secret` with hyphen not underscore :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "Biigode (via GitHub)" <gi...@apache.org>.
Biigode commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2992428146
Same issue with airflow 3.0.2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2876691434
It will be fixed [here](https://github.com/apache/airflow/pull/49923).
I have the same error than you :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "albundy83 (via GitHub)" <gi...@apache.org>.
albundy83 commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2876771663
Ah sorry, I read too fast, I thought your were under Kubernetes (I have the exact same issue with 3.0.1).
Maybe you could check this issue: https://github.com/apache/airflow/issues/49871
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org>.
OleksandrBrukhalskyi commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2992433592
To fix that I removed the `airflow.cfg` file and created containers by using `docker compose up` and it solved this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org>.
OleksandrBrukhalskyi commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2988568063
I have this issue with jwt_secret again! the token I generated manually using `openssl rand -base64 16` doesn't work in docker compose file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-3404062828
This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2876331304
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org>.
OleksandrBrukhalskyi commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2876494091
Noticed this in logs from `apiserver` container:
`[warning ] api_auth/jwt_secret was empty, using a generated one for now. Please set this in your config [airflow.api_fastapi.auth.tokens]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org>.
OleksandrBrukhalskyi commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2876705676
Thank you, @albundy83 for your response. This is strange, because Airflow runs successfully in my host machine, but it throws this kind of exception in my docker deployment in Ubuntu Server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] ValueError: The value api_auth/jwt_secret must be set! [airflow]
Posted by "OleksandrBrukhalskyi (via GitHub)" <gi...@apache.org>.
OleksandrBrukhalskyi commented on issue #50538:
URL: https://github.com/apache/airflow/issues/50538#issuecomment-2877095994
@albundy83 thank you for your attention. This [#49646](https://github.com/apache/airflow/issues/49646) helped me to resolve my problem in Docker deployment. I'll be waiting for future fix to have this token to be generated during init stage of Airflow components.
Closing the issue and thanks again!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org