Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Display & Video 360 operators fail on POST requests #10076

Closed
echom opened this issue Jul 31, 2020 · 12 comments
Closed

Google Display & Video 360 operators fail on POST requests #10076

echom opened this issue Jul 31, 2020 · 12 comments
Labels
area:providers good first issue kind:bug This is a clearly a bug provider:google Google (including GCP) related issues

Comments

@echom
Copy link

echom commented Jul 31, 2020

Apache Airflow version: airflow-1.10.6

Kubernetes version (if you are using kubernetes) (use kubectl version): 1.18.6

Environment: Google Cloud Composer v1.10.0

  • Others:
    httplib2 >= 0.18
    apache-airflow-backport-providers-google >= 2020.6.24

What happened:

airflow.providers.google.marketing_platform.operators.display_video.GoogleDisplayVideo360RunReportOperator as well as airflow.providers.google.marketing_platform.operators.display_video.GoogleDisplayVideo360CreateReportOperator fail to complete when setting the api_version parameter to the current version v1.1 instead of the default (and now deprecated) v1. In both cases the POST request return a redirect HTTP code (303) without a Location header. Full error message log (note that httplib2 debug output is enabled): log.txt

What you expected to happen: Both operators should execute successfully.

What do you think went wrong?: I believe that there different interpretations of the HTTP 303 code between the DV360 API and httplib2. Httplib2 tries to follow the 303 redirect but fails due to the missing location header. I believe the implementation of httplib2 is correct, however, the DV360 operators need to handle the arguably invalid response and interpret it as a successful operation with no result. I was able to work around it by temporarily disabling follow_redirectson the service object inside the GoogleDisplayVideo360Hook while the POST requests where executed.

How to reproduce it:
Run either of the operators, e.g.:

run = GoogleDisplayVideo360RunReportOperator(
      task_id="test_run",
      dag=dag,
      api_version="v1.1",
      report_id=report_id)

Anything else we need to know:

How often does this problem occur? Once? Every time etc?: Every time

@echom echom added the kind:bug This is a clearly a bug label Jul 31, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 31, 2020

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

@turbaszek turbaszek added area:providers provider:google Google (including GCP) related issues labels Jul 31, 2020
@turbaszek
Copy link
Member

Thanks @echom for the issue! I will take a look at it :)

@echom
Copy link
Author

echom commented Jul 31, 2020

Apologies, I posted the wrong log file from an old Orchestra implementation. Just updated to the correct log file, the error is the same.

@turbaszek
Copy link
Member

@echom if you know how to fix the issue would you like to do this?

@turbaszek
Copy link
Member

Hm, interesting because I run this operator from out example DAG:

    create_report = GoogleDisplayVideo360CreateReportOperator(
        body=REPORT, task_id="create_report", api_version="v1.1"
    )

and it seems to be working

@turbaszek
Copy link
Member

Which version of google libraries do you use?

google-api-core==1.21.0
google-api-python-client==1.9.3

@echom
Copy link
Author

echom commented Jul 31, 2020

I am running on Google Cloud Composer 1.10.6. According to their versioning:

google-api-core==1.16.0
google-api-python-client==1.7.8

Let me try to explicitly install your versions.

@turbaszek
Copy link
Member

I think we were similar issue but I cannot find it. @mik-laj do you remember something more?
#9194

@echom
Copy link
Author

echom commented Jul 31, 2020

Ok, after a bit of a struggle with version issues I now arrived at the following:

httplib2==0.18
apache-airflow-backport-providers-google==2020.6.24
google-api-core==1.21.0
google-api-python-client==1.9.3
google-auth=1.20.0
grpcio=1.30.0

Still the issue persists.

@turbaszek Can you do me a favor and check if the API responds with a 303 for you? You should be able to get the response logged when httplib2.debuglevel = 1

I have a line in my log that looks like this:

{logging_mixin.py:112} INFO - reply: 'HTTP/1.1 303 See Other\r\n'

@turbaszek
Copy link
Member

No 303 on my side. However, this seems to be related:
#8810

@rafalbiegacz
Copy link

#8810 is closed.

Should this item be closed as "no repro"?

@eladkal
Copy link
Contributor

eladkal commented Jan 22, 2023

Closing as can't reproduce. If issue still relevant please open a new issue.

@eladkal eladkal closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers good first issue kind:bug This is a clearly a bug provider:google Google (including GCP) related issues
Projects
None yet
Development

No branches or pull requests

5 participants