karrioapi / karrio

Programmable Shipping APIs (self-hosted)
https://karrio.io
Apache License 2.0
562 stars 104 forks source link

UPS Too Many Values To Unpack #710

Closed welpak closed 4 weeks ago

welpak commented 1 month ago

Describe the bug Seems the python code is causing an issue with too many values per too few entries.

Error When Sending API Call:

424 - "{\"messages\":[{\"carrier_id\":\"ups\",\"carrier_name\":\"ups\",\"code\":\"SHIPPING_SDK_INTERNAL_ERROR\",\"message\":\"too many values to unpack (expected 2)\"}]}"

To Reproduce Steps to reproduce the behavior:

  1. Send POST call for creating a shipment.

Expected behavior To create a shipment

Screenshots image

Desktop (please complete the following information):

minchaminder commented 1 month ago

having same issue

danh91 commented 1 month ago

Hi guys, I will need more logs to reproduce this as I couldn't reproduce it. Can your share the logs of the responses you received from UPS when you check the developers > Logs section.

My only hint seem to be affecting US to US local shipments. Which I can't reproduce with my canadian accounts.

danh91 commented 1 month ago

I got a US account and did some tests but could not reproduce it. Could you share the requests as well changing any personal info.

Thanks

minchaminder commented 1 month ago

I got a US account and did some tests but could not reproduce it. Could you share the requests as well changing any personal info.

Thanks

@danh91 please see my PM

welpak commented 1 month ago

Here is the information with sensitive data removed. I can grab the log from karrio if needed. But, this is from the API I have calling karrio, then karrio passing it through (the request) to this response.

Error code: 424

Message: 424 - "MESSAGE:

[ { "carrier_id": "ups", "carrier_name": "ups", "code": "SHIPPING_SDK_INTERNAL_ERROR", "message": "too many values to unpack (expected 2)" } ]"

Request: { "headers": { "accept": "application/json", "authorization": "Bearer " }, "method": "POST", "uri": "https://api.welship.cc/v1/shipments", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "maxRedirects": 21, "timeout": 300000, "body": { "recipient": { "postal_code": "60139-2080", "city": "Glendale Heights", "person_name": "", "company_name": "", "country_code": "US", "email": "false", "state_code": "IL", "residential": false, "address_line1": "", "address_line2": "evtn:3cmn7w4 3CMN7W4", "validate_location": false }, "shipper": { "postal_code": "27549", "city": "Louisburg", "person_name": "WELPAK", "company_name": "", "country_code": "US", "email": "", "phone_number": "", "state_code": "NC", "residential": false, "address_line1": "101 Industrial Dr.", "address_line2": "", "validate_location": false }, "parcels": [ { "weight": 3, "width": 6, "height": 2, "length": 8, "description": "Standard Package", "is_document": false, "weight_unit": "LB", "dimension_unit": "IN" } ], "options": { "negotiated_rate": false }, "payment": { "paid_by": "sender", "currency": "USD", "account_number": "<ACC#>" }, "service": "ups_ground", "carrier_ids": [ "ups" ], "reference": "WEL S10024", "label_type": "PDF" }, "encoding": null, "json": false, "useStream": true }

welpak commented 1 month ago

Logs from karrio today:

RESPONSE: { "messages": [ { "carrier_id": "ups", "carrier_name": "ups", "code": "SHIPPING_SDK_INTERNAL_ERROR", "message": "too many values to unpack (expected 2)" } ]}

REQUEST: { "label_type": "PDF", "options": { "shipping_date": "2024-10-17T09:18" }, "parcels": [ { "dimension_unit": "IN", "height": 5, "is_document": false, "length": 10, "packaging_type": "your_packaging", "weight": 2, "weight_unit": "LB", "width": 4 } ], "payment": { "paid_by": "sender" }, "recipient": { "address_line1": "788 Alto Pl", "city": "Lake Mary", "country_code": "US", "person_name": "Yamila Orsini", "postal_code": "32746", "state_code": "FL" }, "shipper": { "address_line1": "101 Industrial Dr.", "city": "Louisburg", "company_name": "Welpak", "country_code": "US", "email": "customerservice@welpakco.com", "person_name": "Welpak", "phone_number": "+1 984-235-4905", "postal_code": "27549", "residential": false, "state_code": "NC" }}

TIMELINE: { "RateRequest": { "Request": { "RequestOption": "Shoptimeintransit", "SubVersion": "2205", "TransactionReference": { "CustomerContext": "fetch rates" } }, "Shipment": { "DeliveryTimeInformation": { "PackageBillType": "03", "Pickup": { "Date": "20241017" } }, "InvoiceLineTotal": { "CurrencyCode": "USD", "MonetaryValue": "1.0" }, "Package": [ { "Dimensions": { "Height": "5.0", "Length": "10.0", "UnitOfMeasurement": { "Code": "IN", "Description": "Dimension" }, "Width": "4.0" }, "PackageWeight": { "UnitOfMeasurement": { "Code": "LBS", "Description": "Weight" }, "Weight": "2.0" }, "PackagingType": { "Code": "02", "Description": "Packaging Type" } } ], "PaymentDetails": { "ShipmentCharge": { "BillShipper": { "AccountNumber": "58919Y" }, "Type": "01" } }, "RatingMethodRequestedIndicator": "Y", "Service": { "Code": "11", "Description": "Weight" }, "ShipFrom": { "Address": { "AddressLine": "101 Industrial Dr.", "City": "Louisburg", "CountryCode": "US", "PostalCode": "27549", "StateProvinceCode": "NC" }, "AttentionName": "Welpak" }, "ShipTo": { "Address": { "AddressLine": "788 Alto Pl", "City": "Lake Mary", "CountryCode": "US", "PostalCode": "32746", "StateProvinceCode": "FL" }, "AttentionName": "Yamila Orsini" }, "ShipmentRatingOptions": { "NegotiatedRatesIndicator": "Y" }, "ShipmentTotalWeight": { "UnitOfMeasurement": { "Code": "LBS", "Description": "Dimension" }, "Weight": "2.0" }, "Shipper": { "Address": { "AddressLine": "101 Industrial Dr.", "City": "Louisburg", "CountryCode": "US", "PostalCode": "27549", "StateProvinceCode": "NC" }, "AttentionName": "Welpak", "ShipperNumber": "<ACC#>" }, "TaxInformationIndicator": "Y" } }}

welpak commented 1 month ago

Just upgraded to 9.9

Seems to be working. I will do more shipments through the day to see if it continues to work.

I appreciate the hard work!

welpak commented 1 month ago

I haven't seen any errors since the update. This can be closed for me. Let me know @minchaminder

danh91 commented 1 month ago

Hi @welpak , Thanks for the feedback, I was hoping for you to test on your end before closing the issue.

I got the logs from @minchaminder , that's how I was able to reproduce and fix the issue on patch 2024.9.9.

I would say you can close it 👍🏿