-
Notifications
You must be signed in to change notification settings - Fork 17
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #31
Comments
Hi @arun21, thank you for choosing AfterShip. The Python SDK seems to have received an unexpected response from the API server. Let me contact our back-end engineer and get back to you later. |
Hi @arun21, this error may be 5xx from the gateway layer. Because 5xx error is not in json format, so it causes JSONDecodeError. We have recently released a fix, the current 5xx error should be reduced a lot. If you still encounter JSONDecodeError, please re-request to solve it. We will continue to optimize to completely solve this problem. |
Hi @alviezhang @1415003719, Thanks for looking into it. @1415003719: Can you tell me which version of aftership-sdk-python library is stable and I can use it with Python 3.8.6 and wont come across above error in library. Thanks. |
@arun21 I've release version |
Thanks @alviezhang |
Versions
Python version: Python 3.8.6
SDK version:
OS type: Linux
OS version: CentOS
OS architecture:
Describe the bug
I am using aftership-sdk-python library (aftership==1.0.post2) api create tracking api for posting orders to aftership since a month ago. I am using it as a batch process, processing around 10k records per day. since 2 days back, for few records I am getting this error below.. I tested my code, the argument I pass has no error but I get this error in the python module
I get this error while using below code in loop
aftership.tracking.create_tracking(tracking=dict)
Could you please let me know how can I tackle this error, what happens sometimes is that even if I get this error, the record sometimes still gets posted to aftership, so if it tries to run second time I get BadRequest: Tracking already exists. as this outcome is related to another piece in my code, so I might need this error handled.
Please let me know if you need more details about this error.
Update:
If I add content-type in headers, will that solve my problem ? something like below: Please let me know
tracking = aftership.tracking.create_tracking(tracking=track_dict, headers={"Content-Type": "application/json"})
Thanks
The text was updated successfully, but these errors were encountered: