-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix: Webserver returns 500 for POST requests to api/dag/*/dagrun from anonymous user #36275
Bugfix: Webserver returns 500 for POST requests to api/dag/*/dagrun from anonymous user #36275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can only disable authentication for the experimental REST API not the stable REST API so this is not an issue. See: https://airflow.apache.org/docs/apache-airflow/stable/security/api.html#disable-authentication
Oh, my bad, this is for the experimental REST API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test for this change?
@hussein-awala |
97fb3d8
to
63b2253
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
293045f
to
713f503
Compare
b53e2bb
to
5ca2ca6
Compare
5ca2ca6
to
837f36a
Compare
Rebased. Likely some intermittent issue or smth connected with FAB changes being merged. |
837f36a
to
74dd475
Compare
Nope. Looks like real test failure that you need to fix - likely coming from recent changes in FAB structure. |
I think the change I pushed is not isolated, and it impacts the application context for other tests, I will take a second look this evening. |
74dd475
to
b6f9154
Compare
I fixed it by updating the configuration after initializing the flask application: 826f4e9 |
…rom anonymous user (#36275) * airflow#36110 - bugfix * return type fixed * airflow#36110 - bugfix * airflow#36110 - fixes * airflow#36110 - fixes * airflow#36110 - adding test * airflow#36110 - adding test * Fix unit test * Don't call get_id twice * Update app configuration after initialization --------- Co-authored-by: hussein-awala <[email protected]> Co-authored-by: Tzu-ping Chung <[email protected]> (cherry picked from commit 71bc871)
…rom anonymous user (apache#36275) * airflow#36110 - bugfix * return type fixed * airflow#36110 - bugfix * airflow#36110 - fixes * airflow#36110 - fixes * airflow#36110 - adding test * airflow#36110 - adding test * Fix unit test * Don't call get_id twice * Update app configuration after initialization --------- Co-authored-by: hussein-awala <[email protected]> Co-authored-by: Tzu-ping Chung <[email protected]>
closes: #36110
related: #36206
Description
While creating a dag_note in anonymous mode ( API auth set to backend default )
export AIRFLOW__API__AUTH_BACKENDS= airflow.api.auth.backend.default
user_id is coming as 'None' as userContext is not available.
which is invalid for an integer field in the database and causing SQL alchemy Exception.
Proposed Solution
Check if the user_id is None, we will not cast it into string type which will resolve the issue.