shan-zeeshan786 opened a new issue, #65391:
URL: https://github.com/apache/airflow/issues/65391
### Under which category would you file this issue?
Airflow Core
### Apache Airflow version
3.2.0
### What happened and how to reproduce it?
Recently, we changed the Fernet key in our environment. After this change,
we started observing 500 Internal Server Errors when accessing Variables via
the Stable REST API.
API Call:
GET /api/v1/variables/{key}
**Request:**
curl -X GET "http://<- airflow-webserver ->/api/v1/variables/<-
variable_name ->" \
-H "accept: application/json" \
-H "Authorization: Basic <base64-credentials>"
**Response:**
{
"detail": "None is not of type 'string'\n\nFailed validating 'type' in
schema['allOf'][1]['properties']['value']:\n{'type': 'string'}\n\nOn
instance['value']:\n None",
"status": 500,
"title": "Response body does not conform to specification",
"type":
"https://airflow.apache.org/docs/apache-airflow/3.2.0/stable-rest-api-ref.html#section/Errors/Unknown"
}
### What you think should happen instead?
The API should handle undecryptable Variable values gracefully instead of
returning a 500 error.
Possible expected behaviors:
- Return a 200 response with value as null or masked
- OR return a clear 4xx error indicating decryption failure
- OR include a meaningful error message (e.g., "Unable to decrypt variable
with current Fernet key")
At minimum, the response should not violate the OpenAPI schema and should
not result in a 500 Internal Server Error.
### Operating System
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux"
VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian
HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
### Deployment
Official Apache Airflow Helm Chart
### Apache Airflow Provider(s)
_No response_
### Versions of Apache Airflow Providers
_No response_
### Official Helm Chart version
Not Applicable
### Kubernetes Version
Not Applicable
### Helm Chart configuration
Not Applicable
### Docker Image customizations
Not Applicable
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]