Repository navigation
Description
Apache Airflow version
3.0.3
If "Other Airflow 2 version" selected, which one?
No response
What happened?
When using Docker with a self-signed certificate all appears to initially be well from the front end but DAGS will never run and eventually get marked as failed. The message in the run log is:
ERROR - Executor reports task instance <...> finished (failed) although the task says it's queued. (Info: None) Was the task killed externally?
Checking container logs shows that the worker is unable to communicate with the API server due to an SSL certificate verification error:
airflow-worker-1 | 2025-07-18 09:21:32.543021 [error] Task execute_workload[73ed6338-5c59-450c-8e6a-284d52e0cf60] raised unexpected: ConnectError('[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1010)') [celery.app.trace]
#50726 mentions this and a possible workaround by assigning alternative names localhost and airflow-apiserver to the self-signed certificate then adding it into the container. I tried this and was unable to get it to work with the same error message.
What you think should happen instead?
I think not working immediately is sensible but there should be a config parameter to disable certificate verification with suitable warning against doing so.
The setup should still work without needing to import the self-signed certificate to get it verified.
How to reproduce
Setup Airflow as per https://airflow.apache.org/docs/apache-airflow/stable/howto/docker-compose/index.html then add SSL with:
AIRFLOW__WEBSERVER__WEB_SERVER_SSL_CERT: <cert>
AIRFLOW__WEBSERVER__WEB_SERVER_SSL_KEY: <key>
Or their equivalent new API versions. Set the below to HTTPS and add -k flag for healthcheck:
AIRFLOW__CORE__EXECUTION_API_SERVER_URL: 'https://airflow-apiserver:8080/execution/'
test: ["CMD", "curl", "--fail", "-k", "https://localhost:8080/api/v2/version"]
Start up Airflow, try to run a DAG and check airflow-worker-1 logs.
Operating System
Ubuntu 22.04.5 LTS
Versions of Apache Airflow Providers
Not relevant.
Deployment
Docker-Compose
Deployment details
Compose file as provided with amendments already give. Docker version 28.3.2, build 578ccf6. Nothing else relevant.
Anything else?
Nothing else to add.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
boring-cyborg commentedon Jul 18, 2025
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.
Subham-KRLX commentedon Jul 20, 2025
Hi, i would like to work on this issue.
danieldean commentedon Jul 20, 2025
I took a look at this and see that httpx is used. This issue on httpx is relevant:
encode/httpx#302
As it stands there is no way to alter anything via environment variables as httpx uses certifi. It looks like a cert can be added using the verify arguement which would involve code change to the API SDK.
I managed to get a self-signed certificate working by customising the image and appending it to the certifi bundle.
I think a good solution would be to have the certificate used for the api-server added to the trust store. This could be done regardless of whether it is self-signed or not and would require no extra config options.
potiuk commentedon Jul 20, 2025
Assigned you @Subham-KRLX .
Yep. An easy way to add the actual self-signed certificate you use would be the best approach. Any setting to "disable" security is a bad idea, and explicitly marking "this certificate is secure" is way better from security point of view.
Subham-KRLX commentedon Jul 20, 2025
I am currently working on this issue and looking into the best way to address the certificate verification problem. I will need a bit more time to properly investigate and identify the best solution. Once I pinpoint the root cause i will raise a pr here.
danieldean commentedon Jul 20, 2025
@Subham-KRLX appologies if I am stepping on your toes. I did not initially think I would be able to fix this otherwise I would have indicated I could do so.
I think both methods would work but I have gone with a way that it more succinct and fetches only existing config options.
Subham-KRLX commentedon Jul 21, 2025
No problem at all @danieldean! Happy to collaborate or combine ideas if needed.
danieldean commentedon Jul 21, 2025
@Subham-KRLX as suggested you could do a unit test for the PR? I am unsure how to do this.
Subham-KRLX commentedon Jul 21, 2025
Hi @danieldean I had like to help with this issue and assist in adding unit tests for your PR. Let me know how I can contribute!
Subham-KRLX commentedon Jul 25, 2025
I am facing a persistent pre-commit failure in PR #53589 during UI build with error: “packages field missing or empty” when running pnpm config set store-dir .pnpm-store in airflow-core/src/airflow/ui. I have removed the workspaces field from package.json, cleaned node_modules and lockfiles, reinstalled deps, and approved build scripts, but the issue remains locally and in CI. Could you please advise on any other workspace or pnpm configs I should adjust to fix this?
potiuk commentedon Jul 26, 2025