You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/12 12:43:43 UTC

[GitHub] [airflow] Taragolis opened a new issue #18188: NoResultFound raises in UI when access to Task Instance Details

Taragolis opened a new issue #18188:
URL: https://github.com/apache/airflow/issues/18188


   ### Apache Airflow version
   
   2.2.0b1 (beta snapshot)
   
   ### Operating System
   
   Linux (5.13.13-zen1-1-zen #1 ZEN SMP PREEMPT Thu, 26 Aug 2021 19:14:35 +0000 x86_64 GNU/Linux)
   
   ### Versions of Apache Airflow Providers
   
   <details><summary> pip freeze | grep apache-airflow-providers</summary> 
   apache-airflow-providers-amazon==2.1.0<br>
   apache-airflow-providers-celery==2.0.0<br>
   apache-airflow-providers-cncf-kubernetes==2.0.1<br>
   apache-airflow-providers-docker==2.1.0<br>
   apache-airflow-providers-elasticsearch==2.0.2<br>
   apache-airflow-providers-ftp==2.0.0<br>
   apache-airflow-providers-google==5.0.0<br>
   apache-airflow-providers-grpc==2.0.0<br>
   apache-airflow-providers-hashicorp==2.0.0<br>
   apache-airflow-providers-http==2.0.0<br>
   apache-airflow-providers-imap==2.0.0<br>
   apache-airflow-providers-microsoft-azure==3.1.0<br>
   apache-airflow-providers-mysql==2.1.0<br>
   apache-airflow-providers-postgres==2.0.0<br>
   apache-airflow-providers-redis==2.0.0<br>
   apache-airflow-providers-sendgrid==2.0.0<br>
   apache-airflow-providers-sftp==2.1.0<br>
   apache-airflow-providers-slack==4.0.0<br>
   apache-airflow-providers-sqlite==2.0.0<br>
   apache-airflow-providers-ssh==2.1.0<br>
   </details>
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   Docker Image: apache/airflow:2.2.0b1-python3.8
   
   ```shell
   $ docker version
   Client:
    Version:           20.10.8
    API version:       1.41
    Go version:        go1.16.6
    Git commit:        3967b7d28e
    Built:             Wed Aug  4 10:59:01 2021
    OS/Arch:           linux/amd64
    Context:           default
    Experimental:      true
   
   Server:
    Engine:
     Version:          20.10.8
     API version:      1.41 (minimum version 1.12)
     Go version:       go1.16.6
     Git commit:       75249d88bc
     Built:            Wed Aug  4 10:58:48 2021
     OS/Arch:          linux/amd64
     Experimental:     false
    containerd:
     Version:          v1.5.5
     GitCommit:        72cec4be58a9eb6b2910f5d10f1c01ca47d231c0.m
    runc:
     Version:          1.0.2
     GitCommit:        v1.0.2-0-g52b36a2d
    docker-init:
     Version:          0.19.0
     GitCommit:        de40ad0
   ```
   
   ```shell
   $ docker-compose version
   docker-compose version 1.29.2, build unknown
   docker-py version: 5.0.2
   CPython version: 3.9.6
   OpenSSL version: OpenSSL 1.1.1l  24 Aug 2021
   ```
   
   ### What happened
   
   I've tested current project for compatibility to migrate to 2.2.x in the future.
   
   As soon as i tried to access from UI to Task Instance Details or Rendered Template for DAG _which never started before_ I've got this error
   
   ```
   Python version: 3.8.11
   Airflow version: 2.2.0b1
   Node: e70bca1d41d3
   -------------------------------------------------------------------------------
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
       response = self.full_dispatch_request()
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
       reraise(exc_type, exc_value, tb)
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
       raise value
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
       rv = self.dispatch_request()
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/auth.py", line 51, in decorated
       return func(*args, **kwargs)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/decorators.py", line 72, in wrapper
       return f(*args, **kwargs)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/session.py", line 70, in wrapper
       return func(*args, session=session, **kwargs)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/views.py", line 1368, in task
       session.query(TaskInstance)
     File "/home/airflow/.local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3500, in one
       raise orm_exc.NoResultFound("No row was found for one()")
   sqlalchemy.orm.exc.NoResultFound: No row was found for one()
   ```
   
   ### What you expected to happen
   
   On previous version (Apache Airflow 2.1.2) it show information even if DAG never started.
   If it's new behavior of Airflow for Task Instances in UI it would be nice get information specific to this error rather than generic error
   
   ### How to reproduce
   
   1. Use Apache Airflow: 2.2.0b1
   2. Create new DAG
   3. In web server try to access to Task Instance Details (`/task` entrypoint) or Rendered Template (`rendered-templates` entrypoint)
   
   ### Anything else
   
   As soon as DAG started at least once this kind of errors gone when access Task Instance Details or Rendered Template for this DAG Tasks
   
   Seems like this kind of errors happen after #17719
   
   ### Are you willing to submit PR?
   
   - [ ] 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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #18188:
URL: https://github.com/apache/airflow/issues/18188#issuecomment-918823472


   Again, what would show in the *Task Instance Attributes* fields? Only your first screenshot is related to the question, and unfortunately the fields are cropped so I can’t see what values are there exactly.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr edited a comment on issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
uranusjr edited a comment on issue #18188:
URL: https://github.com/apache/airflow/issues/18188#issuecomment-917952074


   Could you describe what would show in the *Task Instance Attributes* field in that case? (I think I know, but it’d be nice to have someone to confirm this.)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] Taragolis commented on issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
Taragolis commented on issue #18188:
URL: https://github.com/apache/airflow/issues/18188#issuecomment-918104290


   It would be nice if it show the same information that it shows in current stable - `2.1.x`
   In case if no DagRun created before it uses current date-time as execution date (my assumptions)
   
   **Task Instance Attributes - 2.1.2**
   ![image](https://user-images.githubusercontent.com/3998685/133074323-db10a14e-e695-4cb7-882c-87fe551b66cc.png)
   
   However probably it not possible any more and at least it would be nice get same error as we get on access to XCom
   
   ![image](https://user-images.githubusercontent.com/3998685/133075482-5f75e883-6626-4887-b3e7-4b4e8cc1d03d.png)
   
   
   **Rendered Template - 2.1.2** 
   
   Rendered Template also handy for if DagRun not exists, at least it help localize some errors in macros/variables
   
   _Some configuration errors_:
   ![image](https://user-images.githubusercontent.com/3998685/133074947-cdf22fdf-db29-4f24-af0c-32ceb2be015c.png)
   
   _Missing Variables_:
   ![image](https://user-images.githubusercontent.com/3998685/133075001-859f7143-67c9-4470-b024-3e79140c5418.png)
   
   _An finally rendered template_
   ![image](https://user-images.githubusercontent.com/3998685/133075132-195c0971-747e-4ee4-8616-128c03ac4eea.png)
   
   **Rendered Template - 2.2.0b1**
   
   ```
   Python version: 3.8.11
   Airflow version: 2.2.0b1
   Node: e70bca1d41d3
   -------------------------------------------------------------------------------
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
       response = self.full_dispatch_request()
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
       reraise(exc_type, exc_value, tb)
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
       raise value
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
       rv = self.dispatch_request()
     File "/home/airflow/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
       return self.view_functions[rule.endpoint](**req.view_args)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/auth.py", line 51, in decorated
       return func(*args, **kwargs)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/decorators.py", line 72, in wrapper
       return f(*args, **kwargs)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/session.py", line 70, in wrapper
       return func(*args, session=session, **kwargs)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/www/views.py", line 1055, in rendered_templates
       ti = dag_run.get_task_instance(task_id=task.task_id, session=session)
   AttributeError: 'NoneType' object has no attribute 'get_task_instance'
   ```


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #18188:
URL: https://github.com/apache/airflow/issues/18188#issuecomment-917952074


   Coiuld you describe what would show in the *Task Instance Attributes* field in that case? (I think I know, but it’d be nice to have someone to confirm this.)


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #18188:
URL: https://github.com/apache/airflow/issues/18188#issuecomment-917629151


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr commented on issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
uranusjr commented on issue #18188:
URL: https://github.com/apache/airflow/issues/18188#issuecomment-918824179


   Also, what are the links that brought you to the page?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] uranusjr closed issue #18188: NoResultFound raises in UI when access to Task Instance Details

Posted by GitBox <gi...@apache.org>.
uranusjr closed issue #18188:
URL: https://github.com/apache/airflow/issues/18188


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org