No handlers could be found for logger "suds.client" , Exception: (401, u'Unauthorized')

2,417 views
Skip to first unread message

Subash Selvaraj

unread,
Sep 8, 2016, 10:16:19 PM9/8/16
to Google's DoubleClick for Publishers API Forum
Hi,

I am getting the following error when I try to download data from DFP API. The issue has started happening from 8-Sep-2016. 
Could you please let me know how to resolve this?

Error:
--------
No handlers could be found for logger "suds.client"
Traceback (most recent call last):
  File "/u01/processes/prod/script/python/10043_SRCI_Google-DFP-AU.py", line 127, in <module>
    response = line_item_service.getLineItemsByStatement(statement.ToStatement())
  File "/u01/processes/prod/pyve/dfp201602/lib/python2.7/site-packages/googleads/common.py", line 323, in MakeSoapRequest
    for arg in args])
  File "/u01/processes/prod/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 521, in __call__
    return client.invoke(args, kwargs)
  File "/u01/processes/prod/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 581, in invoke
    result = self.send(soapenv)
  File "/u01/processes/prod/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 619, in send
    description=tostr(e), original_soapenv=original_soapenv)
  File "/u01/processes/prod/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 677, in process_reply
    raise Exception((status, description))
Exception: (401, u'Unauthorized')

cheers,
Subash

Vincent Tsao (DFP API Team)

unread,
Sep 9, 2016, 10:28:28 AM9/9/16
to Google's DoubleClick for Publishers API Forum
Hi Subash:

This should be fixed now. Please let me know if you continue to run into this.

Thanks,
Vincent Tsao, DFP API Team

Vincent Tsao (DFP API Team)

unread,
Sep 12, 2016, 4:06:24 PM9/12/16
to Google's DoubleClick for Publishers API Forum
Hi Subash:

To help us debug this issue, two questions:
  1. What is the email address of the user you used to generate an OAuth2 refresh token with?
  2. What OAuth2 scopes are you using?
Thanks,
Vincent Tsao, DFP API Team

Subash Selvaraj

unread,
Sep 15, 2016, 12:29:38 AM9/15/16
to Google's DoubleClick for Publishers API Forum
Hi Vincent,

Thanks for your response. 

The client ID we are using was created with a person's dfp account who has since moved out of our organisation.
So we do not have much information on it. 

But we generated new refresh token for this client ID and secret key. Using this new refresh token we are getting the below error.

Traceback (most recent call last):
 File "/u01/processes/sit6/script/python/10043_SRCI_Google-DFP-AU.py", line 132, in <module>
   response = line_item_service.getLineItemsByStatement(statement.ToStatement())
 File "/u01/processes/sit6/pyve/dfp201602/lib/python2.7/site-packages/googleads/common.py", line 323, in MakeSoapRequest

   for arg in args])
 File "/u01/processes/sit6/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 521, in __call__
   return client.invoke(args, kwargs)
 File "/u01/processes/sit6/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 581, in invoke
   result = self.send(soapenv)
 File "/u01/processes/sit6/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 619, in send
   description=tostr(e), original_soapenv=original_soapenv)
 File "/u01/processes/sit6/pyve/dfp201602/lib/python2.7/site-packages/suds/client.py", line 670, in process_reply
   raise WebFault(fault, replyroot)
suds.WebFault: Server raised fault: '[AuthenticationError.NO_NETWORKS_TO_ACCESS @ ]'
2016-09-14 15:22:54 DEBUG Function exitIfError called with parameters 1 Python DFP Orders extract


Could you please help us resolve this issue. Thanks!

Subash

Chris Seeley (DFP API Team)

unread,
Sep 15, 2016, 1:49:02 PM9/15/16
to Google's DoubleClick for Publishers API Forum
Hi Subash,

I believe there's another thread about this issue that I already replied to, but I'll post here as well. When you generate a refresh token, it's tied to the Google account you are currently logged in to. Based on your description, I suspect the refresh token is tied to an account not in the network.

To handle situations like users leaving the organization, you can share projects on the developer console. If the project owner leaves the organization, you can transfer ownership of the project:

Alternatively, you can use a service account for authentication. The service account flow eliminates refresh tokens and uses a key pair to generate access tokens:

Thanks,
Chris Seeley, DFP API Team

Subash Selvaraj

unread,
Sep 15, 2016, 7:26:45 PM9/15/16
to Google's DoubleClick for Publishers API Forum
Thanks Chris. 

I will try to get the ownership of the project transferred.

Regards,
Subash

Christopher Cooper

unread,
Sep 22, 2016, 11:46:56 PM9/22/16
to Google's DoubleClick for Publishers API Forum

Hi All,

Has this been fixed?  I seem to running into the same error response when I run get_all_line_items.py script from the test examples. I am new to the DFP api and wanted to just try this out on Python before I port it over to my project in .NET.

The YAML file is all set up and I just generated fresh token's this morning in response to this error to check if that was the problem.

Regards,

Christopher Cooper

unread,
Sep 23, 2016, 1:16:13 AM9/23/16
to Google's DoubleClick for Publishers API Forum
Hi All, 

I back tracked through everything and realised that the error was being caused because:

1. I was updating the wrong YAML file........ I didn't realise but the YAML file I had opened was actual the one in the python example folder and not the one I moved to my User folder.
2. After I corrected the YAML issue, I was now getting a '[AuthenticationError.NETWORK_CODE_REQUIRED @ ]' error. So I looked back at the YAML file and realised that the DFP config has the network_code commented out.  Since I hadn't directly set up the DfpClient Object.. So I just commented it, added in the network code and Presto! Data is pulling through!

Silly errors, but hopefully this helps anyone else facing the same issues.

Regards,
Reply all
Reply to author
Forward
0 new messages