You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following situation, you will end up with a wicked portal-api container which is not stable:
Imagine you are deploying a new infrastructure which will replace (by DNS switch) an old installation
During startup, everything is running in a non-exposed way, i.e. the FQDN which is stated in the globals.json is not (yet) valid
If the old DNS entry now points to something which actually responds, and does NOT respond with a JSON (but e.g. with an HTML page), the health check will fail like this:
Thu, 14 Dec 2017 10:39:39 GMT portal-api:webhooks loadEvents(): kong-adapter
Thu, 14 Dec 2017 10:39:39 GMT portal-api:systemhealth makeHealthEntry()
undefined:1
<!DOCTYPE html>
^
SyntaxError: Unexpected token < in JSON at position 0
at Object.parse (native)
at Function.utils.getJson (/usr/src/app/routes/utils.js:35:21)
at makeHealthEntry (/usr/src/app/routes/systemhealth.js:195:30)
at Request._callback (/usr/src/app/routes/systemhealth.js:70:32)
at Request.self.callback (/usr/src/app/node_modules/request/request.js:187:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.<anonymous> (/usr/src/app/node_modules/request/request.js:1044:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
Possible fixes:
Do not use the external FQDN apiHost, but the internal port of the Kong Gateway to retrieve the /ping-portal response (to see whether Kong is correctly wired)
(Additionally) wrap the getJson(apiResponse) in a try-catch block to make sure it never completely crashes the application (in systemhealth.js: makeHealthEntry()):
var pingResponse = utils.getJson(apiBody);
This line causes the issue.
The text was updated successfully, but these errors were encountered:
In the following situation, you will end up with a wicked portal-api container which is not stable:
Possible fixes:
apiHost
, but the internal port of the Kong Gateway to retrieve the/ping-portal
response (to see whether Kong is correctly wired)getJson(apiResponse)
in atry-catch
block to make sure it never completely crashes the application (insystemhealth.js: makeHealthEntry()
):This line causes the issue.
The text was updated successfully, but these errors were encountered: