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/01/12 17:10:35 UTC

[GitHub] [airflow] Hartorn opened a new issue #13638: Stable API task logs

Hartorn opened a new issue #13638:
URL: https://github.com/apache/airflow/issues/13638


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the context.
   
   -->
   
   **Apache Airflow version**: 2.0.0
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`): NA
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**: PC (docker-compose)
   - **OS** (e.g. from /etc/os-release): Linux mint 20 (for PC), Debian Buster in container
   - **Kernel** (e.g. `uname -a`): Linux 607a1bfeebd2 5.4.0-60-generic #67-Ubuntu SMP Tue Jan 5 18:31:36 UTC 2021 x86_64 GNU/Linux
   - **Install tools**: Poetry (so pipy)
   - **Others**:
   Using python 3.8.6, with Celery Executor, one worker
   Task did run properly
   
   **What happened**:
   I tried to get the logs of a task instance using the stable Rest API through the Swagger UI included in Airflow, and it crashed (got a stack trace)
   I got 500 error
   ```
   engine-webserver_1     | 2021-01-12T16:45:18.465370280Z [2021-01-12 16:45:18,464] {app.py:1891} ERROR - Exception on /api/v1/dags/insert/dagRuns/manual__2021-01-12T15:05:59.560500+00:00/taskInstances/insert-db/logs/0 [GET]
   engine-webserver_1     | 2021-01-12T16:45:18.465391147Z Traceback (most recent call last):
   engine-webserver_1     | 2021-01-12T16:45:18.465394643Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
   engine-webserver_1     | 2021-01-12T16:45:18.465397709Z     response = self.full_dispatch_request()
   engine-webserver_1     | 2021-01-12T16:45:18.465400161Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
   engine-webserver_1     | 2021-01-12T16:45:18.465402912Z     rv = self.handle_user_exception(e)
   engine-webserver_1     | 2021-01-12T16:45:18.465405405Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
   engine-webserver_1     | 2021-01-12T16:45:18.465407715Z     reraise(exc_type, exc_value, tb)
   engine-webserver_1     | 2021-01-12T16:45:18.465409739Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
   engine-webserver_1     | 2021-01-12T16:45:18.465412258Z     raise value
   engine-webserver_1     | 2021-01-12T16:45:18.465414560Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
   engine-webserver_1     | 2021-01-12T16:45:18.465425555Z     rv = self.dispatch_request()
   engine-webserver_1     | 2021-01-12T16:45:18.465427999Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
   engine-webserver_1     | 2021-01-12T16:45:18.465429697Z     return self.view_functions[rule.endpoint](**req.view_args)
   engine-webserver_1     | 2021-01-12T16:45:18.465431146Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/connexion/decorators/decorator.py", line 48, in wrapper
   engine-webserver_1     | 2021-01-12T16:45:18.465433001Z     response = function(request)
   engine-webserver_1     | 2021-01-12T16:45:18.465434308Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/connexion/decorators/uri_parsing.py", line 144, in wrapper
   engine-webserver_1     | 2021-01-12T16:45:18.465435841Z     response = function(request)
   engine-webserver_1     | 2021-01-12T16:45:18.465437122Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/connexion/decorators/validation.py", line 384, in wrapper
   engine-webserver_1     | 2021-01-12T16:45:18.465438620Z     return function(request)
   engine-webserver_1     | 2021-01-12T16:45:18.465440074Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/connexion/decorators/response.py", line 103, in wrapper
   engine-webserver_1     | 2021-01-12T16:45:18.465441667Z     response = function(request)
   engine-webserver_1     | 2021-01-12T16:45:18.465443086Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/connexion/decorators/parameter.py", line 121, in wrapper
   engine-webserver_1     | 2021-01-12T16:45:18.465445345Z     return function(**kwargs)
   engine-webserver_1     | 2021-01-12T16:45:18.465446713Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/airflow/api_connexion/security.py", line 47, in decorated
   engine-webserver_1     | 2021-01-12T16:45:18.465448202Z     return func(*args, **kwargs)
   engine-webserver_1     | 2021-01-12T16:45:18.465449538Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/airflow/utils/session.py", line 65, in wrapper
   engine-webserver_1     | 2021-01-12T16:45:18.465451032Z     return func(*args, session=session, **kwargs)
   engine-webserver_1     | 2021-01-12T16:45:18.465452504Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/airflow/api_connexion/endpoints/log_endpoint.py", line 81, in get_log
   engine-webserver_1     | 2021-01-12T16:45:18.465454135Z     logs, metadata = task_log_reader.read_log_chunks(ti, task_try_number, metadata)
   engine-webserver_1     | 2021-01-12T16:45:18.465455658Z   File "/brain/engine/.cache/poetry/meta-vSi4r4R8-py3.8/lib/python3.8/site-packages/airflow/utils/log/log_reader.py", line 58, in read_log_chunks
   engine-webserver_1     | 2021-01-12T16:45:18.465457226Z     logs, metadatas = self.log_handler.read(ti, try_number, metadata=metadata)
   engine-webserver_1     | 2021-01-12T16:45:18.465458632Z ValueError: not enough values to unpack (expected 2, got 1)
   ```
   
   <!-- (please include exact error messages if you can) -->
   
   **What you expected to happen**:
   I expected to get the logs of my task
   <!-- What do you think went wrong? -->
   
   **How to reproduce it**:
   I think it's everytime (at least on my side)
   
   <!---
   
   As minimally and precisely as possible. Keep in mind we do not have access to your cluster or dags.
   
   If you are using kubernetes, please attempt to recreate the issue using minikube or kind.
   
   ## Install minikube/kind
   
   - Minikube https://minikube.sigs.k8s.io/docs/start/
   - Kind https://kind.sigs.k8s.io/docs/user/quick-start/
   
   If this is a UI bug, please provide a screenshot of the bug or a link to a youtube video of the bug in action
   
   You can include images using the .md style of
   ![alt text](http://url/to/img.png)
   
   To record a screencast, mac users can use QuickTime and then create an unlisted youtube video with the resulting .mov file.
   
   --->
   
   
   **Anything else we need to know**:
   Other stable API call, such as getting list of dags runs, task instance, etc worked well.
   Logs is appearing well if I go to 
   <!--
   
   How often does this problem occur? Once? Every time etc?
   
   Any relevant logs to include? Put them here in side a detail tag:
   
   
   -->
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] vikramcse commented on issue #13638: Stable API task logs

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


   @potiuk I would love to work on this issue as a first time contributor on airflow. @Hartorn is it fine if I take this issue?


----------------------------------------------------------------
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.

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



[GitHub] [airflow] potiuk commented on issue #13638: Stable API task logs

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


   > Am I on right path? and do I have to add unit test for this scenario?
   
   Definitely looks like you are :)
   
   > and do I have to add unit test for this scenario?
   
   It would be great to add them indeed  calling a `read` method with different `try_numbers` and expecting tuple with two elements would be great


----------------------------------------------------------------
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.

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



[GitHub] [airflow] vikramcse commented on issue #13638: Stable API task logs

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


   @potiuk I would love to work on this issue as a first time contributor on airflow. @Hartorn is it fine if I take this issue?


----------------------------------------------------------------
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.

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



[GitHub] [airflow] ephraimbuddy commented on issue #13638: Stable API task logs

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


   Hey @vikramcse where are you currently on 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.

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



[GitHub] [airflow] potiuk commented on issue #13638: Stable API task logs

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


   Let's keep it open. I marked it as low-priority and  added good-first-issue label.
   
   BTW @Hartorn maybe that is a 'good-first-issue' that you would like to fix and become contributor :)


----------------------------------------------------------------
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.

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



[GitHub] [airflow] turbaszek closed issue #13638: Stable API task logs

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


   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] Hartorn commented on issue #13638: Stable API task logs

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


   @vikramcse sure, at the moment I'm struggling with airflow 2.0 and kubernetes, so I had no time with 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.

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



[GitHub] [airflow] vikramcse commented on issue #13638: Stable API task logs

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


   Hi @potiuk 
   I am able to reproduce the issue.
   while debugging I noticed that when the `try_number < 1` the `read` function from `FileTaskHandler` has only one return parameter which is logs, where there should be two return parameters logs and metadata.
   
   To fix this issue I have added a fix, which returns two parameters instead of one
   
   ![image](https://user-images.githubusercontent.com/1611331/106350285-805f3000-62fa-11eb-88c2-e753126b83bc.png)
   
   the output of above modification is
   
   ![image](https://user-images.githubusercontent.com/1611331/106350292-8e14b580-62fa-11eb-99c6-a549a82278fd.png)
   
   Am I on right path? and do I have to add unit test for this scenario?
   
   thank you
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] potiuk commented on issue #13638: Stable API task logs

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


   Assigned you @vikramcse !


----------------------------------------------------------------
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.

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



[GitHub] [airflow] vikramcse commented on issue #13638: Stable API task logs

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


   @ephraimbuddy 
   currently I am using a windows PC. 
   It took me some time to get wsl2 and docker installed on my machine
   Now I am following the steps mentioned in https://github.com/apache/airflow/blob/master/CONTRIBUTORS_QUICK_START.rst


----------------------------------------------------------------
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.

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



[GitHub] [airflow] Hartorn commented on issue #13638: Stable API task logs

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


   Sure, will have a look! 


----------------------------------------------------------------
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.

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



[GitHub] [airflow] potiuk commented on issue #13638: Stable API task logs

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


   Assigned you @vikramcse !


----------------------------------------------------------------
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.

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



[GitHub] [airflow] potiuk edited a comment on issue #13638: Stable API task logs

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


   Let's keep it open. I marked it as low-priority and  added good-first-issue label.
   
   BTW @Hartorn maybe that is a 'good-first-issue' that you would like to fix and become contributor :) ?


----------------------------------------------------------------
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.

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