Skip to content

Cannot get/patch/delete a variable if its key contains slash character #50796

@yzhsieh

Description

@yzhsieh

Apache Airflow version

3.0.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

In Airflow 3.0, I can create a variable which key contains slash character '/' .
However, once the variable created, I cannot call API to modify or delete it.
Also I cannot get its value via "get variable" API, but I can get by list all variables using "get variables" API

I think the problem is that the slash in variable key has been treated as URL separator, so the API return error.
Also due to above reason, the APIs which not require variable key in URL still work (like "create variable" and "get variables")

I also tried to escape '/' as %2F when calling API, but still no luck.
In such scenario, api-server log still show '/' instead of '%2F' in visiting log

What you think should happen instead?

No response

How to reproduce

  1. Create an Airflow instance, open browser and go to Variable page.
  2. Create a new variable and put a slash in its key
  3. Save the variable, it will success
  4. Try to modify this variable, it will show error with "405 Method Not Allowed"
  5. Try to delete this variable, it will also show error

Operating System

Ubuntu

Versions of Apache Airflow Providers

No response

Deployment

Virtualenv installation

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

Metadata

Metadata

Labels

area:APIAirflow's REST/HTTP APIarea:corekind:bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yet

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions