Got three errors, e.g., '[Errno 104] Connection reset by peer', '(502, u'Bad Gateway')', 'DatabaseError.CONCURRENT_MODIFICATION' when uploading audience list

69 views
Skip to first unread message

xwan...@gmail.com

unread,
Jun 6, 2018, 6:04:27 AM6/6/18
to AdWords API and Google Ads API Forum
Hi,

I am trying to upload a file containing around 110M mobile device IDs for the campaign to target. I used CrmBasedUserList to upload. 
I found it was too large to upload. Then I split my large file to tens of files to upload concurrently and let those jobs retry for at most 3 times. It turned out that part of them are able to be uploaded, while others got one of 3 errors randomly. Most of times, it would be 'socket.error: [Errno 104] Connection reset by peer'. 3 errors are as follows:
1) 
Traceback (most recent call last):
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "__main__.py", line 983, in <module>
  File "__main__.py", line 980, in __invoke_main
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "bi/internet_marketing/sem/adwords_api/scripts/upload_audience_list.py", line 93, in <module>
  File "bi/internet_marketing/sem/adwords_api/scripts/upload_audience_list.py", line 65, in upload_audience_list
  File "googleads/common.py", line 1043, in MakeSoapRequest
  File "suds/client.py", line 521, in __call__
  File "suds/client.py", line 581, in invoke
  File "suds/client.py", line 619, in send
  File "suds/client.py", line 677, in process_reply
Exception: (502, u'Bad Gateway') 
2)
Traceback (most recent call last):
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "__main__.py", line 983, in <module>
  File "__main__.py", line 980, in __invoke_main
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "bi/internet_marketing/sem/adwords_api/scripts/upload_audience_list.py", line 93, in <module>
  File "bi/internet_marketing/sem/adwords_api/scripts/upload_audience_list.py", line 65, in upload_audience_list
  File "googleads/common.py", line 1043, in MakeSoapRequest
  File "suds/client.py", line 521, in __call__
  File "suds/client.py", line 581, in invoke
  File "suds/client.py", line 613, in send
  File "googleads/util.py", line 127, in PatchedHttpTransportSend
  File "suds/transport/http.py", line 132, in u2open
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/urllib2.py", line 1240, in https_open
    context=self._context)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/urllib2.py", line 1200, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/httplib.py", line 1136, in getresponse
    response.begin()
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/httplib.py", line 409, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/ssl.py", line 734, in recv
    return self.read(buflen)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/ssl.py", line 621, in read
    v = self._sslobj.read(len or 1024)
socket.error: [Errno 104] Connection reset by peer
3)
Traceback (most recent call last):
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "__main__.py", line 983, in <module>
  File "__main__.py", line 980, in __invoke_main
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/local/fbcode/gcc-5-glibc-2.23/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "bi/internet_marketing/sem/adwords_api/scripts/upload_audience_list.py", line 93, in <module>
  File "bi/internet_marketing/sem/adwords_api/scripts/upload_audience_list.py", line 65, in upload_audience_list
  File "googleads/common.py", line 1070, in MakeSoapRequest
googleads.errors.GoogleAdsServerFault: [DatabaseError.CONCURRENT_MODIFICATION @ com.google.ads.api.services.campaignmgmt.common.error.DatabaseError.<init>(Datab]

Looking forward to hearing back from you. Thanks.

Dhanya Sundararaju (AdWords API Team)

unread,
Jun 6, 2018, 3:16:28 PM6/6/18
to AdWords API and Google Ads API Forum
Hi,

The maximum size of the membersList collection is 1M. So, you will need to split the list into appropriate sized files and try uploading one by one. The bad gateway and socket error could be due to network issues from uploading large lists. The error DatabaseError.CONCURRENT_MODIFICATION you are getting may be due to multiple processes trying to update same entity at the same time. Please refer this section of guide for better clarity. Could you retry pausing for a short period and then resubmitting the file one by one? Please let me know if you still face issues.

Regards,
Dhanya, AdWords API Team
Reply all
Reply to author
Forward
0 new messages