BingAds / BingAds-Python-SDK

Other
118 stars 164 forks source link

When using bulk_offline_conversions.py receiving 500 error. #166

Closed msaparito closed 4 years ago

msaparito commented 4 years ago

Hello:

When attempting to use the sandbox setup and all default code I am receiving a 500 error after logging in and receiving the URL to post back to the terminal. Any idea what this might be from?

example:

python3 examples/v13/bulk_offline_conversions.py

Output:

Loading the web service client proxies...
You need to provide consent for the application to access your Bing Ads accounts. After you have granted consent in the web browser for the application to access your Bing Ads accounts, please enter the response URI that includes the authorization 'code' parameter: 
https://login.live-int.com/oauth20_desktop.srf?code=M.R0_CD1.b1fae04e-272f-5b11-1703-e1cf3430eb65&state=ClientStateGoesHere&lc=1033

Results in failure instead of expected result and output is:

<suds.sax.document.Document object at 0x11534a410>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/suds/transport/http.py", line 82, in send
    fp = self.u2open(u2request)
  File "/usr/local/lib/python3.7/site-packages/suds/transport/http.py", line 132, in u2open
    return url.open(u2request, timeout=tm)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/suds/client.py", line 613, in send
    reply = self.options.transport.send(request)
  File "/usr/local/lib/python3.7/site-packages/suds/transport/https.py", line 66, in send
    return HttpTransport.send(self, request)
  File "/usr/local/lib/python3.7/site-packages/suds/transport/http.py", line 94, in send
    raise TransportError(e.msg, e.code, e.fp)
suds.transport.TransportError: Internal Server Error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "examples/v13/bulk_offline_conversions.py", line 77, in <module>
    authenticate(authorization_data)
  File "/Users/msaparito/Desktop/Projects/NotepadZone/sdk_repos/BingAds-Python-SDK/examples/v13/auth_helper.py", line 50, in authenticate
    UserId=None
  File "/usr/local/lib/python3.7/site-packages/bingads/service_client.py", line 273, in __call__
    raise ex
  File "/usr/local/lib/python3.7/site-packages/bingads/service_client.py", line 265, in __call__
    response = self.service_client.soap_client.service.__getattr__(self.name)(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/suds/client.py", line 521, in __call__
    return client.invoke(args, kwargs)
  File "/usr/local/lib/python3.7/site-packages/suds/client.py", line 581, in invoke
    result = self.send(soapenv)
  File "/usr/local/lib/python3.7/site-packages/suds/client.py", line 619, in send
    description=tostr(e), original_soapenv=original_soapenv)
  File "/usr/local/lib/python3.7/site-packages/suds/client.py", line 670, in process_reply
    raise WebFault(fault, replyroot)
suds.WebFault: Server raised fault: 'Invalid client data. Check the SOAP fault details for more information. TrackingId: 78f37f14-8bed-43bc-bf7b-4052caa86c4c.'
qitia commented 4 years ago

we see "UserError: Authenticate failed for username" from log for tracking id: 78f37f14-8bed-43bc-bf7b-4052caa86c4c. Maybe you want to reach support team for further help if you are sure there is no issue with your login account.

msaparito commented 4 years ago

Thanks for the response!

msaparito commented 4 years ago

we see "UserError: Authenticate failed for username" from log for tracking id: 78f37f14-8bed-43bc-bf7b-4052caa86c4c. Maybe you want to reach support team for further help if you are sure there is no issue with your login account.

Is there some way that I can see this type of output? Regarding the real error associated with the tracking id, @qitia .

qitia commented 4 years ago

oh no, this is internal log and do not have public interface to access. You should see similar in the response, dont you?

msaparito commented 4 years ago

The stack output only explains it's an InternalServerError as well as a Soap fault. So this information was very enlightening. Thanks!