node-sdk: DiscoveryV1.query() failed with error "BXNIM0408E: Provided refresh token is expired"

Overview DiscoveryV1.query() failed with error “BXNIM0408E: Provided refresh token is expired”

Expected behavior The request should get processed successfully even if refresh token is expired. SDK should handle OAuth flow to get a new access token using API keys behind the scenes without emitting the error back to the app.

Actual behavior The promise returned got rejected with the following error.

{
	"context": {
		"requestId": "bcaef5b6a33e477f90ffd275ee5d2453",
		"requestType": "incoming.Identity_Token",
		"userAgent": "watson-developer-cloud-nodejs-3.9.1;",
		"clientIp":"xx.xx.xx.xx",
		"url":"https://iam.bluemix.net",
		"instanceId":"iamid-4.3-6234-7b03afd-cb7bb68f6-xxxxx",
		"threadId":"15654f",
		"host":"iamid-4.3-6234-7b03afd-cb7bb68f6-xxxxx",
		"startTime":"12.08.2019 12:37:11:756 UTC",
		"endTime":"12.08.2019 12:37:11:757 UTC",
		"elapsedTime":"1",
		"locale":"en_US",
		"clusterName":"iam-id-prtok04-m9sc"
	},
	"errorCode": "BXNIM0408E",
	"errorMessage": "Provided refresh token is expired"
} 

How to reproduce We have multiple servers running the same application that runs queries on the same Discovery instance, but the issue happened only on one specific server. The issue could be reproduced solidly on the failing server regardless of the query, but it went away after restarting the process on the failing server. The procedure that brought the server to the failing state is unknown. We have been running the same application for months, but this was the first time we experienced the issue.

Screenshots N/A

SDK Version 3.9.1

Additional information:

  • OS: Linux version 3.10.0-862.6.3.el7.x86_64
  • Node: v8.12.0

Additional context (See “How to reproduce” section)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

@dpopp07 Sorry for my delayed response. We have experienced the same issue one more time with the old version of Watson SDK (3.9.1). We upgraded the SDK to the latest version yesterday as suggested, and we have not experienced the issue since then. We still cannot tell for sure if the issue has gone away because the issue seems to happen only once in a few months, but we are OK to close this ticket for now. We will reopen it should we experience the issue again. Thank you for your support.