-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getRatesWithShipmentDetails #63
Comments
Hey @wentao709 ! It looks like you're running the default timeout frame of 5 seconds. In Sandbox, it's common for carriers not to meet this timeframe. You can modify the timeout for the SDK as a configuration variable. 60 seconds will be the maximum. shipengine-dotnet/ShipEngine/Config.cs Line 31 in 9158d24
|
hi, what is the right way to change the timeout? |
@wentao709 You can set For example, if you are instantiating your config object like this: |
sorry I guess my question is how do I import ShipEngineConfig from the node module? not sure how to import ShipEngineConfig to my node.js server |
Hey @AnneOReilly, I'm also working with @wentao709 on this, thanks for the assistance. We have configured shipEngine to have a 60 second timeout now in js:
Below is the ship engine config (JSON stringified) at the time of call to
We are still seeing the same timeout error with that config:
I also confirmed it was not the shipping info used that is causing the problem, as I created and tested the cUrl manually using the same shipping parameters and was able to get a successful response:
Results in Do you have any other ideas what could be causing this issue? |
Hey @brandonraphael I stopped seeing the error without any custom config. can you try that please? |
Hi Devs,
I'm having trouble with this API: getRatesWithShipmentDetails
I'm calling it like this:
const shipEngineResults = await shipengine.getRatesWithShipmentDetails(shippingInfo);
where shippingInfo = {
rateOptions: {
carrierIds: [ 'se-2884143', 'se-2884144', 'se-2884146' ],
serviceCodes: []
},
shipment: {
validateAddress: 'validate_only',
confirmation: 'none',
shipFrom: {
name: 'Tom Hanks',
phone: '7146129169',
postalCode: '93306',
companyName: 'Test Company',
countryCode: 'US',
addressLine1: '3218 Kaibab Avenue',
addressLine2: '',
cityLocality: 'Bakersfield',
stateProvince: 'CA',
addressResidentialIndicator: 'no'
},
shipTo: {
name: 'Nxtlives Dev',
phone: null,
addressLine1: '800 W 6th St',
addressLine2: null,
cityLocality: 'Los Angeles',
stateProvince: 'CA',
countryCode: 'US',
postalCode: '90017'
},
packages: [ [Object] ]
}
}
Sometimes I get the error saying {
err: ShipEngineError: The ShipEngine /v1/rates API timed out.
at sendRequestWithRetry (/Users/wentaozhou/Documents/GitHub/nextsite_server/node_modules/shipengine/cjs/client/index.js:44:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.post (/Users/wentaozhou/Documents/GitHub/nextsite_server/node_modules/shipengine/cjs/client/index.js:14:12)
at async Object.getRatesWithShipmentDetails (/Users/wentaozhou/Documents/GitHub/nextsite_server/node_modules/shipengine/cjs/get-rates-with-shipment-details/index.js:17:22)
at async itemShipping (file:///Users/wentaozhou/Documents/GitHub/nextsite_server/utils/order.js:1109:31)
at async file:///Users/wentaozhou/Documents/GitHub/nextsite_server/controllers/orderController.js:1579:26
at async Promise.all (index 0)
at async get_cart_shipping (file:///Users/wentaozhou/Documents/GitHub/nextsite_server/controllers/orderController.js:1569:23) {
source: 'shipengine',
type: 'system',
code: 'timeout',
requestID: undefined,
url: URL {
href: 'https://www.shipengine.com/docs/errors/codes/',
origin: 'https://www.shipengine.com/',
protocol: 'https:',
username: '',
password: '',
host: 'www.shipengine.com',
hostname: 'www.shipengine.com',
port: '',
pathname: '/docs/errors/codes/',
search: '',
searchParams: URLSearchParams {},
hash: ''
}
}
}
Please note that this error does not happen every time I call it using the same json input. I would say there's a 50% chance that the error occurs, and other times the call is successful. do you know why this occurs?
Thanks,
Wentao Zhou
The text was updated successfully, but these errors were encountered: