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/05/23 09:47:38 UTC

[GitHub] [airflow] turbaszek opened a new issue #16009: DagRun triggered via API stuck in running state

turbaszek opened a new issue #16009:
URL: https://github.com/apache/airflow/issues/16009


   **Apache Airflow version**: v2.2.0.dev0 
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   Breeze + postgres
   
   **What happened**:
   
   Originally reported on [StackOverflow](https://stackoverflow.com/questions/67657260/using-airflow-restapi-to-trigger-dag-doesnt-work-but-clicking-in-ui-does).
   
   It seems that triggering a dag run via API when both execution date and dag_run_id are passed results in dag run that is stuck in running state.
   
   **What you expected to happen**:
   
   Triggering dag via API should always result in DAG being executed.
   
   **How to reproduce it**:
   ```py
   import requests
   import json
   from datetime import datetime
   from pprint import pprint
   
   if __name__ == '__main__':
       headers = {
           'accept':'application/json',
           'content-type':'application/json',
       }
       auth = ('admin','admin')
       body = {
           "conf": {},
           "dag_run_id": "testrun01",
           "execution_date":datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ"),
       }
       print(body)
       result = requests.post(
         "http://localhost:28080/api/v1/dags/example_bash_operator/dagRuns",
           headers=headers,
           auth=auth,
         data=json.dumps(body)
       )
       pprint(result.json())
   ```
   
   
   


-- 
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] kaxil commented on issue #16009: DagRun triggered via API stuck in running state

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


   Oh yea expected behaviour


-- 
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 edited a comment on issue #16009: DagRun triggered via API stuck in running state

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


   Ok, it seems that the problem is in fact that I'm triggering a DAG with date other than in UTC timezone, so the execution date is in future:
   <img width="1666" alt="Screenshot 2021-05-23 at 11 58 27" src="https://user-images.githubusercontent.com/9528307/119255859-34443e00-bbbe-11eb-88ec-b13ae55082ed.png">
   
   I'm not sure if this is expected behaviour. WDYT @kaxil @jhtimmins ?
   


-- 
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 #16009: DagRun triggered via API stuck in running state

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


   


-- 
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 commented on issue #16009: DagRun triggered via API stuck in running state

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


   Ok, it seems that the problem is in fact that I'm triggering a DAG with date other than in UTC timezone, so the execution data is in future:
   <img width="1666" alt="Screenshot 2021-05-23 at 11 58 27" src="https://user-images.githubusercontent.com/9528307/119255859-34443e00-bbbe-11eb-88ec-b13ae55082ed.png">
   
   I'm not sure if this is expected behaviour. WDYT @kaxil @jhtimmins ?
   


-- 
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] ashb commented on issue #16009: DagRun triggered via API stuck in running state

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


   Expected behaviour I think.


-- 
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 commented on issue #16009: DagRun triggered via API stuck in running state

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


   Closing as this seems to be an expected behaviour 


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