question

scivizguy avatar image
0 Likes"
scivizguy asked ·

Finding API sometimes has blank fields for sellerName with verb=findItemsByCategory. Possible database error

Attached are a more detailed debugger traceback and the JSON with ebaysdk DEBUG= true for verbose API call check,.


On-line documentation states that the sellerName field is “conditionally” but does not explain what the conditions are.


https://developer.ebay.com/Devzone/finding/CallRef/findItemsByCategory.html#outputSelector


Attached is some debugger info using the ebaysdk version 1.13.0 at the point of failure. Note that the itemId is 202290400892 and if you search for it on the US eBay shopping site, it finds the item and it appears that the storeName and sellerName are the same from the item’s listing and Seller details pages.


Python raises a TypeError because it expects a str but gets a None.


The XML/JSON tags are there, just empty in between them. I use the EBAY-US as the siteid in the API request call yet this lot appears to originate from Hong Kong; could that be part of the issue?


Is MySQL the DB, and is the sellerName field NULLable?


Debugger traceback.txtpagenumber _86_JSON.txt

finding apisellerinfoebaysdk-pythondatabase_errorsellername
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered ·

The problem surfaces when I tried downstream to do a string operation on the None object which raises the exception.

So don't do that.

The point was, it happens, and they clearly aren't going to fix it, so code around it. Either check for null and replace it with an empty string, or retry.

· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

scivizguy avatar image
0 Likes"
scivizguy answered ·

Thanks for this information @clickimusprime

The XML tag is there but void in between like this: <sellerUserName></sellerUserName>

or JSON: "sellerInfo": {"sellerUserName": null, "feedbackScore": "15076", ...


I do check for missing nodes with try-except blocks. For example, this is needed in the odd cases where a shipper only does local pickups. The handling node is missing in those cases.


The problem surfaces when I tried downstream to do a string operation on the None object which raises the exception.


Just like the anonymous user from 2012 stated, further testing showed that the missing seller names occur for ALL entries in the bad page number, even if the max is set at 100 entries and all sellers are different. So the issue is not related to it being from Hong Kong in that one case; that listing just happened to be the 1st entry on pagenumber 86 which is when I stopped debugging at the time.


· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

clickimusprime avatar image
0 Likes"
clickimusprime answered ·

This occurs sometimes in the JSON and XML responses. You have to retry if you need the info. Also happens with findItemsAdvanced. It's a long standing bug going back to at least 2012.

https://forums.developer.ebay.com/questions/1106/bug-finditemsadvanced-intermittently-missing-selle.html

Blank values should be returned as empty strings, unless the entire node is missing. You need to check for the existence of the node before using it.

· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.