1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Cloud Composer(Airflow version1.10系)で Task Duration を開こうとすると TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'

Posted at

背景

  • Airflowで DAG指定 -> Task Durationを開こうとすると以下のような画面になる
  • エラー内容は TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType'
    スクリーンショット 2019-11-07 11.16.30.png

原因

対応

  • UPDATE task_fail SET duration=0 WHERE duration IS NULL をしてあげればいい
  • 今回はCloud Composerを使っているので、手順としては、worker container とかに入って、mysqlに繋いでコマンドを実行する
    • Airflowを独自で立てている場合は、直接DBにコマンド叩けばok

手順

GKEクラスタに接続

gcloud container clusters get-credentials ${GKE_CLUSTER} --zone ${GKE_LOCATION}

podsを表示する

kubectl get pods --all-namespaces

workerにログイン

kubectl -n ${NAME_SPACE} exec -it ${CONTAINER_NAME} -c airflow-worker -- /bin/bash
  • mysqlに接続
mysql -h airflow-sqlproxy-service.default -u root
  • update実行
use some_db
UPDATE task_fail SET duration=0 WHERE duration IS NULL

参考: https://cloud.google.com/composer/docs/how-to/using/testing-dags#checking_for_pypi_package_errors

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?