问题
We suddenly get this error from our application, without having changed a thing with our related code.
Line: 23
Error: Unable to get property 'error' of undefined or null reference
And this when debugging in Visual studio.
Unhandled exception at line 23, column 387 in
https://js.api.here.com/ee/2.5.4/routing-nlp.js
When trying to get a response from https://route.nlp.nokia.com/routing/6.2/calculateroute.json?routeattributes=shape&maneuverattributes=direction,shape&jsonAttributes=1&waypoint0=geo!59.61602,16.5143099&waypoint1=geo!59.61213,16.5190899&language=en-US&mode0=fastest;pedestrian;traffic:disabled;&app_id=[APPID]&app_code=[APPCODE]&xnlp=CL_JSMv2.5.4,SID_5C2F5886-805A-4FFF-A11C-021AE0F7586E
(Appcode and ID obfuscated as I'm not sure how bad it'd be to post those from the URI)
Below is a screenshot from the file where the error occurs to show exactly where (the yellow marking). d
is undefined, which is causing the crash. It is set earlier via d=a.response
. But as you can see in the screenshot a
does not contain a response
property.
Trying to run the above call in Fiddler yields the response:
503 Service Unavailable: Back-end server is at capacity
But this has been persisting for several days now so I'm leaning towards that something has changed in the API that we're not aware of, rather than that they have been overworked 24/7 for a week.
I'm going to try and dig around to find the code responsible for this call and add it here as it might be relevant.
回答1:
I guess they are powering down the old nokia domains and outdated services. In the Release Notification from April they explicitly stated the following:
Some of our customers are still using the Nokia domains (...api.nlp.nokia.com) for accessing the HERE Platform for Business services. Since April 2014 our documentations only lead to the HERE domains (...api.here.com). Please be aware that Nokia/NLP domains will not be supported any more by end of 2016. Until than all customers latest have to switch to the HERE domains. The SSL certificates for the Nokia/NLP domains will expire by end of Q1 2016 so after this date SSL connections will create warning messages.
...
Since April 1, 2016, the Enterprise Router 6.2 is no longer supported. No further maintenance and support will be provided, and the service is deprecated. (April and earlier in February)
After some digging for old code samples I tried to redirect the API to the current 7.2 router but the interface is different and it always fails. So there doesn't seem to be a quick-fix solution for this... I guess finally there's no more room but to migrate to the current generation JS API (3.0) and with it to 7.2.
来源:https://stackoverflow.com/questions/38767942/suddenly-api-crashes-in-routing-nlp-js-getting-503-service-unavailable-back-en