timotheus / ebaysdk-python

eBay API SDK for Python
https://developer.ebay.com/tools/sdks
Other
808 stars 326 forks source link

AttributeError: 'Response' object has no attribute '_dom' #306

Open Bearcharlemagne opened 4 years ago

Bearcharlemagne commented 4 years ago

Hello, I am using this eBaysdk with the findingAPI, specifically the findItemsByKeywords module. My code works about 97% of the time, but every once in awhile, I run into the below error. Has anyone else encountered it or know of a fix? I did see that someone else posted about it on here, but that was in the context of the Shopping API and I couldn't deduce any information from it relevant to my code.

Thanks

2020-04-15 15:32:14,841 ebaysdk [DEBUG]:execute: verb=findItemsByKeywords data={'keywords': 'lego 10179', 'itemFilter': [{'name': 'Condition', 'value': 'Ne
w'}, {'name': 'Currency', 'value': 'USD'}, {'name': 'AvailableTo', 'value': 'US'}, {'name': 'MaxPrice', 'value': '1086'}, {'name': 'StartTimeFrom', 'value': '2020-04-15T15:25:28.628Z'}], 'sortOrder': 'PricePlusShippingLowest'}
2020-04-15 15:32:14,841 ebaysdk [DEBUG]:REQUEST (0693ec1d-f8ab-49b1-99c8-ba7282a93e5a): POST https://svcs.ebay.com/services/search/FindingService/v1
2020-04-15 15:32:14,841 ebaysdk [DEBUG]:headers={'X-EBAY-SOA-SERVICE-NAME': 'FindingService', 'X-EBAY-SOA-SERVICE-VERSION': '1.0.0', 'X-EBAY-SOA-SECURITY-APPNAME': 'INSERTAPIKEYHERE', 'X-EBAY-SOA-GLOBAL-ID': 'EBAY-US', 'X-EBAY-SOA-OPERATION-NAME': 'findItemsByKeywords', 'X-EBAY-SOA-REQUEST-DATA-FORMAT': 'XML', 'X-EBAY-SOA-RESPONSE-DATA-FORMAT': 'XML', 'Content-Type': 'text/xml', 'User-Agent': 'eBaySDK/2.1.5 Python/3.7.5 Linux/4.4.0-1100-aws', 'X-EBAY-SDK-REQUEST-ID': '0693ec1d-f8ab-49b1-99c8-ba7282a93e5a', 'Content-Length': '581'}
2020-04-15 15:32:14,841 ebaysdk [DEBUG]:body=b'<?xml version=\'1.0\' encoding=\'utf-8\'?><findItemsByKeywordsRequest xmlns="http://www.ebay.com/marketplace/search/v1/services"><itemFilter><name>Condition</name><value>New</value></itemFilter><itemFilter><name>Currency</name><value>USD</value></itemFilter><itemFilter><name>AvailableTo</name><value>US</value></itemFilter><itemFilter><name>MaxPrice</name><value>1086</value></itemFilter><itemFilter><name>StartTimeFrom</name><value>2020-04-15T15:25:28.628Z</value></itemFilter><keywords>lego 10179</keywords><sortOrder>PricePlusShippingLowest</sortOrder></findItemsByKeywordsRequest>'
2020-04-15 15:32:15,071 ebaysdk [DEBUG]:RESPONSE (0693ec1d-f8ab-49b1-99c8-ba7282a93e5a):
2020-04-15 15:32:15,071 ebaysdk [DEBUG]:elapsed time=0:00:00.229091
2020-04-15 15:32:15,071 ebaysdk [DEBUG]:status code=404
2020-04-15 15:32:15,071 ebaysdk [DEBUG]:headers={'x-ebay-client-tls-version': '771, 10.68.114.59', 'x-ebay-request-id': 'null]', 'rlogid': 't6bv%7Fi%60utn%60lh%609%3Fuk%60du%7Emfvujfoid%2852237%3E4-1717e78243b-0x2427', 'content-length': '245', 'date': 'Wed, 15 Apr 2020 15:32:15 GMT', 'server': 'ebay-proxy-server', 'x-envoy-upstream-service-time': '14', 'x-ebay-pop-id': 'UFES2-RNOAZ03-svcs'}
2020-04-15 15:32:15,071 ebaysdk [DEBUG]:content={"errors":[{"errorId":2002,"domain":"ACCESS","category":"REQUEST","message":"Resource not found","longMessage":"A resource (URI) associated with the request could not be resolved.","parameters":[{"name":"reason","value":"HTTP 404 Not Found"}]}]}
2020-04-15 15:32:15,071 ebaysdk [DEBUG]:response parse failed: Start tag expected, '<' not found, line 1, column 1 (<string>, line 1)
Traceback (most recent call last):
  File "ebayhunt.py", line 131, in <module>
    main()
  File "ebayhunt.py", line 37, in main
    response = api.execute('findItemsByKeywords', request)
  File "/home/Bearcharlemagne/.local/lib/python3.7/site-packages/ebaysdk/connection.py", line 127, in execute
    self.error_check()
  File "/home/Bearcharlemagne/.local/lib/python3.7/site-packages/ebaysdk/connection.py", line 218, in error_check
    estr = self.error()
  File "/home/Bearcharlemagne/.local/lib/python3.7/site-packages/ebaysdk/connection.py", line 334, in error
    error_array.extend(self._get_resp_body_errors())
  File "/home/Bearcharlemagne/.local/lib/python3.7/site-packages/ebaysdk/finding/__init__.py", line 227, in _get_resp_body_errors
    dom = self.response.dom()
  File "/home/Bearcharlemagne/.local/lib/python3.7/site-packages/ebaysdk/response.py", line 239, in dom
    return self._dom
  File "/home/Bearcharlemagne/.local/lib/python3.7/site-packages/ebaysdk/response.py", line 226, in __getattr__
    return getattr(self._obj, name)
AttributeError: 'Response' object has no attribute '_dom'
fsmosca commented 4 years ago

I have not done massive calls, I have not encountered such an issue so far. Perhaps just some server downtime for maintenance or so.

timotheus commented 4 years ago

Bearcharlemagne - could you post this to the eBay developer support forums? This is an issue that eBay needs to be aware of.

On Sun, Apr 19, 2020 at 11:07 PM fsmosca notifications@github.com wrote:

I have not done massive calls, I have not encountered such an issue so far. Perhaps just some server downtime for maintenance or so.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/timotheus/ebaysdk-python/issues/306#issuecomment-616331548, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2QX63UNVBSU3HUGXVDKTRNPRD5ANCNFSM4MIZMS5A .

Bearcharlemagne commented 4 years ago

Yes -- This has been posted to the eBay dev support forums. The link is below for those who run into this issue in the future. Hopefully it can get resolved.

https://forums.developer.ebay.com/questions/35498/attributeerror-response-object-has-no-attribute-do.html