Skip to content
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

Cant login to UI in MWAA 2.4.3 #28936

Closed
1 of 2 tasks
manugarri opened this issue Jan 14, 2023 · 2 comments
Closed
1 of 2 tasks

Cant login to UI in MWAA 2.4.3 #28936

manugarri opened this issue Jan 14, 2023 · 2 comments
Labels
area:core kind:bug This is a clearly a bug

Comments

@manugarri
Copy link
Contributor

manugarri commented Jan 14, 2023

Apache Airflow version

Other Airflow 2 version (please specify below)

What happened

Happening on AWS MWAA 2.4.3

I tried logging to the UI (via AWS SSO) and get the error Internal Server Error.

Checking the scheduler logs on Cloudwatch I see the error is afecting the webserver:

 2023-01-14T09:52:41.481+00:00 | [[34m2023-01-14 09:52:40,798[0m] {{[mapp.py:[0m1741}} ERROR[0m -
 Exception on /aws_mwaa/aws-console-sso [GET]
-- | --
  | 2023-01-14T09:52:41.527+00:00 | Traceback (most recent call last):
  | 2023-01-14T09:52:41.535+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/app.py", line 2524, in wsgi_app
  | 2023-01-14T09:52:41.545+00:00 | ctx.push()
  | 2023-01-14T09:52:41.556+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/ctx.py", line 375, in push
  | 2023-01-14T09:52:41.565+00:00 | self.session = session_interface.open_session(self.app, self.request)
  | 2023-01-14T09:52:41.579+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask_session/sessions.py", line 535, in open_session
  | 2023-01-14T09:52:41.587+00:00 | if saved_session and saved_session.expiry <= datetime.utcnow():
  | 2023-01-14T09:52:41.600+00:00 | TypeError: '<=' not supported between instances of 'NoneType' and 'datetime.datetime'
  | 2023-01-14T09:52:41.611+00:00 | [2023-01-14 09:52:40 +0000] [632] [ERROR] Error handling request /aws_mwaa/aws-console-sso?login=true
  | 2023-01-14T09:52:41.621+00:00 | Traceback (most recent call last):
  | 2023-01-14T09:52:41.629+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/app.py", line 2524, in wsgi_app
  | 2023-01-14T09:52:41.638+00:00 | ctx.push()
  | 2023-01-14T09:52:41.648+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/ctx.py", line 375, in push
  | 2023-01-14T09:52:41.659+00:00 | self.session = session_interface.open_session(self.app, self.request)
  | 2023-01-14T09:52:41.670+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask_session/sessions.py", line 535, in open_session
  | 2023-01-14T09:52:41.679+00:00 | if saved_session and saved_session.expiry <= datetime.utcnow():
  | 2023-01-14T09:52:41.689+00:00 | TypeError: '<=' not supported between instances of 'NoneType' and 'datetime.datetime'
  | 2023-01-14T09:52:41.699+00:00 |  
  | 2023-01-14T09:52:41.710+00:00 | During handling of the above exception, another exception occurred:
  | 2023-01-14T09:52:41.722+00:00 |  
  | 2023-01-14T09:52:41.733+00:00 | Traceback (most recent call last):
  | 2023-01-14T09:52:41.742+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 136, in handle
  | 2023-01-14T09:52:41.754+00:00 | self.handle_request(listener, req, client, addr)
  | 2023-01-14T09:52:41.764+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/gunicorn/workers/sync.py", line 179, in handle_request
  | 2023-01-14T09:52:41.776+00:00 | respiter = self.wsgi(environ, resp.start_response)
  | 2023-01-14T09:52:41.788+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/app.py", line 2548, in __call__
  | 2023-01-14T09:52:41.797+00:00 | return self.wsgi_app(environ, start_response)
  | 2023-01-14T09:52:41.808+00:00 | File "/usr/local/airflow/plugins/aws_mwaa/iam.py", line 30, in __call__
  | 2023-01-14T09:52:41.822+00:00 | return self.app(environ, start_response)
  | 2023-01-14T09:52:41.834+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/werkzeug/middleware/proxy_fix.py", line 187, in __call__
  | 2023-01-14T09:52:41.844+00:00 | return self.app(environ, start_response)
  | 2023-01-14T09:52:41.853+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
  | 2023-01-14T09:52:41.862+00:00 | response = self.handle_exception(e)
  | 2023-01-14T09:52:41.871+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/app.py", line 1724, in handle_exception
  | 2023-01-14T09:52:41.881+00:00 | server_error = self.ensure_sync(handler)(server_error)
  | 2023-01-14T09:52:41.892+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/airflow/www/views.py", line 508, in show_traceback
  | 2023-01-14T09:52:41.900+00:00 | render_template(
  | 2023-01-14T09:52:41.909+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/templating.py", line 147, in render_template
  | 2023-01-14T09:52:41.919+00:00 | return _render(app, template, context)
  | 2023-01-14T09:52:41.930+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/templating.py", line 128, in _render
  | 2023-01-14T09:52:41.939+00:00 | app.update_template_context(context)
  | 2023-01-14T09:52:41.950+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask/app.py", line 994, in update_template_context
  | 2023-01-14T09:52:41.964+00:00 | context.update(func())
  | 2023-01-14T09:52:41.977+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask_login/utils.py", line 407, in _user_context_processor
  | 2023-01-14T09:52:41.991+00:00 | return dict(current_user=_get_user())
  | 2023-01-14T09:52:42.000+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask_login/utils.py", line 372, in _get_user
  | 2023-01-14T09:52:42.009+00:00 | current_app.login_manager._load_user()
  | 2023-01-14T09:52:42.020+00:00 | File "/usr/local/airflow/.local/lib/python3.10/site-packages/flask_login/login_manager.py", line 362, in _load_user
  | 2023-01-14T09:52:42.030+00:00 | user_id = session.get("_user_id")
  | 2023-01-14T09:52:42.041+00:00 | AttributeError: 'NoneType' object has no attribute 'get'

This issue seems to be tied to this flask-session active bug

What you think should happen instead

I should be able to login to the Airflow UI

How to reproduce

I have no idea unfortunately, seems to be an issue when a user logs again after having a successful login

Operating System

AWS MWAA

Versions of Apache Airflow Providers

i think is non applicable.

Deployment

MWAA

Deployment details

We had just added a new config variable to the MWAA via terraform idealo module

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@manugarri manugarri added area:core kind:bug This is a clearly a bug labels Jan 14, 2023
@Taragolis
Copy link
Contributor

@manugarri OSS Airflow Community nothing can't do with potential issues in managed services, for us it is black box.

You need to open Support Ticket/Case within AWS Console

@Taragolis Taragolis closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2023
@manugarri
Copy link
Contributor Author

@Taragolis i wasnt aware of that, my apologies. For the record in case someone else experiences the issue, clearing browsing data "fixed" the session issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

2 participants