You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/04/05 06:16:00 UTC

[jira] [Commented] (AIRFLOW-4236) Operators uploading to GCS needs to handle googleapiclient.errors

    [ https://issues.apache.org/jira/browse/AIRFLOW-4236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810522#comment-16810522 ] 

ASF GitHub Bot commented on AIRFLOW-4236:
-----------------------------------------

ryanyuan commented on pull request #5043: [AIRFLOW-4236] Add num_retries to MySqlToGoogleCloudStorageOperator
URL: https://github.com/apache/airflow/pull/5043
 
 
   Add num_retries to MySqlToGoogleCloudStorageOperator
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [ ] My PR addresses the following [Airflow-4236](https://issues.apache.org/jira/browse/AIRFLOW-4236) issues and references them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
     - https://issues.apache.org/jira/browse/AIRFLOW-XXX
     - In case you are fixing a typo in the documentation you can prepend your commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
     - In case you are proposing a fundamental code change, you need to create an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
     - In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI changes:
   
   ### Tests
   
   - [ ] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   ### Commits
   
   - [ ] My commits all reference Jira issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [ ] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain docstrings that explain what it does
     - If you implement backwards incompatible changes, please leave a note in the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so we can assign it to a appropriate release
   
   ### Code Quality
   
   - [ ] Passes `flake8`
   
 
----------------------------------------------------------------
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


> Operators uploading to GCS needs to handle googleapiclient.errors
> -----------------------------------------------------------------
>
>                 Key: AIRFLOW-4236
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-4236
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: gcp, operators
>    Affects Versions: 1.10.3
>            Reporter: jack
>            Assignee: Ryan Yuan
>            Priority: Major
>              Labels: easy-fix
>
> I got HTTP 500 error when using the MySqlToGoogleCloudStorageOperator this error caused the operator to fail and a 3 hours job were gone to waste.
> This error should not cause the operator to fail immediately. It should first try to retry the upload as suggested : 
> [https://stackoverflow.com/questions/23945784/how-to-manage-google-api-errors-in-python]
> There should be at least 2 attempts to retry before giving up.
> log:
> INFO - Subtask: Traceback (most recent call last):
> INFO - Subtask: File "/usr/local/bin/airflow", line 27, in <module>
> INFO - Subtask: args.func(args)
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/airflow/bin/cli.py", line 392, in run
> INFO - Subtask: pool=args.pool,
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/airflow/utils/db.py", line 50, in wrapper
> INFO - Subtask: result = func(*args, **kwargs)
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 1493, in _run_raw_task
> INFO - Subtask: result = task_copy.execute(context=context)
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/operators/mysql_to_gcs.py", line 99, in execute
> INFO - Subtask: self._upload_to_gcs(files_to_upload)
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/operators/mysql_to_gcs.py", line 184, in _upload_to_gcs
> INFO - Subtask: hook.upload(self.bucket, object, tmp_file_handle.name, 'application/json')
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/airflow/contrib/hooks/gcs_hook.py", line 131, in upload
> INFO - Subtask: .insert(bucket=bucket, name=object, media_body=media) \
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 137, in positional_wrapper
> INFO - Subtask: return wrapped(*args, **kwargs)
> INFO - Subtask: File "/usr/local/lib/python2.7/dist-packages/googleapiclient/http.py", line 842, in execute
> INFO - Subtask: raise HttpError(resp, content, uri=self.uri)
> INFO - Subtask: googleapiclient.errors.HttpError: <HttpError 500 when requesting https://www.googleapis.com/upload/storage/v1/b/.......json returned "Backend Error">



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)