You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bmanan7 (via GitHub)" <gi...@apache.org> on 2025/11/05 13:49:37 UTC

[I] Secrets with slashed IDs return AirflowNotFoundException [airflow]

bmanan7 opened a new issue, #57864:
URL: https://github.com/apache/airflow/issues/57864

   ### Apache Airflow version
   
   3.1.1
   
   ### If "Other Airflow 2/3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   In Airflow 3.x the execution API route GET `/execution/connections/{conn_id}` treats the connection ID as a FastAPI path segment. Conn IDs containing / (e.g., dev-env/project-name) are not URL encoded before the request, so Starlette splits them into multiple segments and returns 404 even though the connection exists. 
   
   airflow connections get (CLI) still works because it bypasses the execution API, causing a mismatch between CLI and Task SDK behaviour.
   
   Apart from this one will also get`AirflowNotFoundException` when the secret value is defined as `{"username":"uname@somedomain.com", "password":"****"}` however we don't get the error if we define secret value as show below:
   ```
   {
    "conn_type": "http",
    "login": "uname@somedomain.com",
    "password": "***",
    "host": "https://api.somedomain.com",
    "port": 443,
    "extra": "{\"verify_ssl\": false}"
   }
   ```
   it looks like without `conn_type` defined it doesn't work in Airflow3?
   
   ### What you think should happen instead?
   
   - `/` in secret name should be accepted. 
   - Either `conn_type` should be marked as compulsory and documentation should be updated to reflect this or airflow should accept a secret without `conn_type`
   
   ### How to reproduce
   
   - Start an Airflow 3.x environment.
   
   - Inside the scheduler container, create a connection whose ID contains /. Example script:
   ```
   python3 - <<'PY'
   from airflow import settings
   from airflow.models.connection import Connection
   
   conn = Connection(conn_id="dev-env/project-name", conn_type="http", host="example.com")
   session = settings.Session()
   session.merge(conn)
   session.commit()
   PY
   ```
   
   - Add a DAG with a task that calls BaseHook.get_connection("dev-env/project-name") .
   
   - Trigger the DAG. The task fails and worker logs show a 404 from GET /execution/connections/dev-env/project-name.
   
   - (Optional sanity check) Running airflow connections get `dev-env/project-name` -oyaml still works because it bypasses the execution API.
   
   
   ### Operating System
   
   macOS 15.6.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?
   
   - [x] 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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "justinpakzad (via GitHub)" <gi...@apache.org>.
justinpakzad commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-5847360243

   I think this can be closed now that #69228 and #69780 have been merged. 


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "diligejy (via GitHub)" <gi...@apache.org>.
diligejy commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-4018460720

   I'd like to work on this issue. I previously commented but deleted it to ensure I follow all project guidelines and perform complete verification (including Breeze/Docker tests) before officially claiming the issue. I have now verified the fix locally using Breeze.


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "rawwar (via GitHub) via commits" <co...@airflow.apache.org>.
rawwar closed issue #57864: Secrets with slashed IDs return AirflowNotFoundException
URL: https://github.com/apache/airflow/issues/57864


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "HarshXAI (via GitHub)" <gi...@apache.org>.
HarshXAI commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-5895456658

   I will open a PR for this (Airflow no-assignment).
   
   Secrets whose IDs contain `/` are being mishandled on the API path and surface as `AirflowNotFoundException` instead of a successful lookup or a clean validation error. I will find the encode/decode path for secret IDs, fix slash handling to match how other Airflow resource IDs with separators are treated, and add an API test covering a slashed secret id.
   
   Keeping it to the secrets API unless the same bug shows up in the shared ID helpers.


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "rawwar (via GitHub) via commits" <co...@airflow.apache.org>.
rawwar commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-6872222547

   This issue is fixed with  #69228 and #69780 merged. If required, we can create a new issue for #74475 to track


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "diligejy (via GitHub)" <gi...@apache.org>.
diligejy commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-4015339376

   I'd like to work on this issue. I noticed the previous PR #58122 was closed as stale, so I'd like to take a fresh approach.


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-3491322200

   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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-3492342012

   @bmanan7 will you work on this?


-- 
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] Secrets with slashed IDs return AirflowNotFoundException [airflow]

Posted by "Samin061 (via GitHub)" <gi...@apache.org>.
Samin061 commented on issue #57864:
URL: https://github.com/apache/airflow/issues/57864#issuecomment-4911482906

   Opened #69585 for the slashed conn_id part. The execution API connections route used the default string path converter, so a conn_id with a `/` never matched and the task got a 404. Switched it to the `:path` converter, same as the variables route already does for slashed keys. The `conn_type` question looks like a separate secrets-backend issue, so I left it out of this PR.


-- 
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