IBM / ibm-cos-sdk-js

ibm-cos-sdk-js
Apache License 2.0
38 stars 19 forks source link

Error connecting to ICOS #47

Closed pushkale closed 5 years ago

pushkale commented 5 years ago

Getting below error while connecting to ICOS : {"message":"read ECONNRESET","stack":"Error: read ECONNRESET\n at _errnoException (util.js:1022:11)\n at TLSWrap.onread (net.js:615:25)","code":"NetworkingError","errno":"ECONNRESET","syscall":"read","region":"us-east-1","hostname":"diabos-logo-storage1.s3.eu-gb.cloud-object-storage.appdomain.cloud","retryable":true,"time":"2019-05-16T13:29:07.458Z"}

This works well from local and cloud foundry app but fails when app is deployed on the Kubernetes cluster.

kellerbr-ibm commented 5 years ago

https://cloud.ibm.com/status?selected=status has the status for public cloud issues. It looks like COS hasn't had any recent network issues come up.

Are you on an IBM Cloud Kubernetes cluster? If so, you may want to check https://cloud.ibm.com/docs/containers?topic=containers-object_storage for setting up connectivity to COS and also IAM for authentication.

Let me know if you have any more issues.

pushkale commented 5 years ago

Yes the services are on Kubernetes and we have the secret created for the object storage service. Also, i forgot to mention that the issue is being seen only for node js based services which used this sdk. The Spring boot and Python implementations are working fine. Issue seems to be with the config object params may be . Config Object details for your reference :

Config Object : ICOS CONFIG : Service { config: Config { credentials: Credentials { expired: false, expireTime: null, serviceInstanceId: 'crn:v1:bluemix:public:cloud-object-storage:global:a/f5ff61f69c044fa6bXXXXXXXXXX7c6d1ac4df575b-1343-488e-8734-7d27625fcc55::', authCallback: undefined, tokenManager: undefined, ibmAuthEndpoint: 'https://iam.ng.bluemix.net/oidc/token', accessKeyId: undefined, sessionToken: undefined, httpOptions: undefined }, credentialProvider: CredentialProviderChain { providers: [Array], resolveCallbacks: [] }, region: 'us-east-1', logger: null, apiVersions: {}, apiVersion: null, endpoint: 's3.eu-gb.cloud-object-storage.appdomain.cloud', httpOptions: { timeout: 120000 }, maxRetries: undefined, maxRedirects: 10, paramValidation: true, sslEnabled: true, s3ForcePathStyle: false, s3BucketEndpoint: false, s3DisableBodySigning: true, computeChecksums: true, convertResponseTypes: true, correctClockSkew: false, customUserAgent: null, dynamoDbCrc32: true, systemClockOffset: 0, signatureVersion: null, signatureCache: true, retryDelayOptions: { base: 100 }, useAccelerateEndpoint: false, apiKeyId: 'Wg_GVf4L8WXXXXXXXXXXXX9HpzaILDn7eV0', ibmAuthEndpoint: 'https://iam.ng.bluemix.net/oidc/token', serviceInstanceId: 'crn:v1:bluemix:public:cloud-object-storage:global:a/f5ff61f69c044XXXXXXXXXXXX75b-1343-488e-8734-7d27625fcc55::' }, endpoint: Endpoint { protocol: 'https:', host: 's3.eu-gb.cloud-object-storage.appdomain.cloud', port: 443, hostname: 's3.eu-gb.cloud-object-storage.appdomain.cloud', pathname: '/', path: '/', href: 'https://s3.eu-gb.cloud-object-storage.appdomain.cloud/' }, _clientId: 1 }

kellerbr-ibm commented 5 years ago

Your configuration looks correct to me. I would go through and double-check your Kubernetes connection settings.

We'll see if we can find anything in the meantime.

pushkale commented 5 years ago

Thanks! Bryan..Probably comparing with what is done in Java/Python SDK might help. Error mentions TLS wrap, so may be related to SSL or something ?

pushkale commented 5 years ago

With node version 10.15.1 and npm version 6.8.0 iam now getting the below error - [2019-05-17T06:02:37.517] [ERROR] ContentManagement-API-Logger - error uploading logo to icos{"message":"read ECONNRESET","stack":"Error: read ECONNRESET\n at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27)","errno":"ECONNRESET","code":"NetworkingError","syscall":"read","region":"us-east-1","hostname":"diabos-logo-storage1.s3.eu-gb.cloud-object-storage.appdomain.cloud","retryable":true,"time":"2019-05-17T06:02:37.516Z"}

pushkale commented 5 years ago

Bryan, the issue is resolved now by creating a wildcard service entry for ICOS in the Istio Kubernetes. However it would be worth comparing the sdks as to why Java/Python works and Node JS doesnt. Thanks!

kellerbr-ibm commented 5 years ago

Yep. We'll take a look.

If your issue is resolved, would you mind closing this issue?

pushkale commented 5 years ago

Okay, closing the issue.