Issue 1:
Apache Airflow version

2.5.3

What happened

When trying to view the logs for a task on a manual DAG run I get a nasty error:

Traceback (most recent call last):
File "/venv/lib/python3.9/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/venv/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/venv/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/venv/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/venv/lib/python3.9/site-packages/airflow/www/auth.py", line 47, in decorated
return func(*args, **kwargs)
File "/venv/lib/python3.9/site-packages/airflow/www/decorators.py", line 166, in view_func
return f(*args, **kwargs)
File "/venv/lib/python3.9/site-packages/airflow/www/decorators.py", line 125, in wrapper
return f(*args, **kwargs)
File "/venv/lib/python3.9/site-packages/airflow/utils/session.py", line 75, in wrapper
return func(*args, session=session, **kwargs)
File "/venv/lib/python3.9/site-packages/airflow/www/views.py", line 2823, in graph
dt_nr_dr_data = get_date_time_num_runs_dag_runs_form_data(request, session, dag)
File "/venv/lib/python3.9/site-packages/airflow/www/views.py", line 193, in get_date_time_num_runs_dag_runs_form_data
date_time = dagrun.execution_date
AttributeError: 'NoneType' object has no attribute 'execution_date'

Looking through the code I can see it is failing to find the dag_run. The cause of this is because the run_id is set to the string:

manual__2023-04-26T18:18:28.720589 00:00

but in the db its actually:

manual__2023-04-26T18:18:28.720589+00:00

(notice the absence of the plus for the timezone separator).

As a hack and to prove this was the issue I modified line 1390 in airflow/models/dag.py from:

query = query.filter(DagRun.dag_id == self.dag_id, DagRun.run_id == run_id)

to:

query = query.filter(DagRun.dag_id == self.dag_id, DagRun.run_id == run_id.replace(' 00:00', '+00:00'))

What you think should happen instead

The log files for my task should have been presented to me in their full glory.

How to reproduce

Initiate a manual run of a task. Let it finish.

Click the "success" icon from the home screen for the dag

Click the "run_id" value for the latest run.

Operating System

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"

Deployment

Virtualenv installation

Deployment details

This was upgraded from an unused install of airflow v2.1.2 although there were no previously run DAGs and this happens on new run so I dont think its an issue related to the migration of data.

Python 3.9.9

Anything else

Happens every time.

Are you willing to submit PR?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct

Issue 2:
Apache Airflow version

2.5.3

What happened

When TI has cleared RunID + replace to spacebar

What you think should happen instead

No response

How to reproduce

Filter by RunID

Clear Task Instance

Look at RunID value

Operating System

Ubuntu 22.04.1 LTS

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?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct