oracle/oci-typescript-sdk

Different Response Linux/Windows

Closed this issue · 7 comments

Hi guys,

We test the oci-object-storage:2.50.0 npm on a new project to get saved objects to our customers. But we have a situation where the code works perfectly with windows and does not work when run over linux (ALPINE distro docker).

The code above gets different results on windows and linux:

const resp = await client.getObject({
bucketName,
namespaceName,
objectName
});

On Windows, the response has value (ReadableStream) and on linux has an empty object on value.

There's no exception occurring running over linux/windows, but the response are different.

WINDOWS RESPONSE:

{"value":{"_readableState":{"objectMode":false,"highWaterMark":16384,"buffer":{"head":{"data":{"type":"Buffer","data":[...DATA]},"next":null},"length":1},"length":1957,"pipes":[],"flowing":null,"ended":false,"endEmitted":false,"reading":true,"constructed":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":false,"resumeScheduled":false,"errorEmitted":false,"emitClose":true,"autoDestroy":true,"destroyed":false,"errored":null,"closed":false,"closeEmitted":false,"defaultEncoding":"utf8","awaitDrainWriters":null,"multiAwaitDrain":false,"readingMore":false,"dataEmitted":false,"decoder":null,"encoding":null},"_events":{"error":[null,null]},"_eventsCount":5,"_writableState":{"objectMode":false,"highWaterMark":16384,"finalCalled":false,"needDrain":false,"ending":false,"ended":false,"finished":false,"destroyed":false,"decodeStrings":true,"defaultEncoding":"utf8","length":0,"writing":false,"corked":0,"sync":false,"bufferProcessing":false,"writecb":null,"writelen":0,"afterWriteTickInfo":null,"buffered":[],"bufferedIndex":0,"allBuffers":true,"allNoop":true,"pendingcb":0,"constructed":true,"prefinished":false,"errorEmitted":false,"emitClose":true,"autoDestroy":true,"errored":null,"closed":false,"closeEmitted":false},"allowHalfOpen":true},"opcRequestId":"gru-1:xlSlsk_44ks7xNdU2eK9sEFtmpNMbhdV8CY63SrodPFjBE88B-TWTxB7ysUjgAL1","eTag":"765725ea-7266-4222-9a8c-bdf649f90b0f","contentLength":47478,"contentMd5":"rAxKXPwu/yG+abfX0C8tAQ==","contentType":"image/jpeg","cacheControl":"public, max-age=2555778733956","lastModified":"2022-12-27T15:32:14Z","storageTier":"Standard","versionId":"9f7a0ed1-28f9-4b25-9e40-1fee73f6d294","opcMeta":{}}

LINUX RESPONSE:

{"value":{},"opcRequestId":"gru-1:AGzNCaT7SjNJtYCazPfE2IsM16yd3EPhuvxgIds8xLYIoTZjaqN4p2j7gKC3zmvo","eTag":"765725ea-7266-4222-9a8c-bdf649f90b0f","contentLength":47478,"contentMd5":"rAxKXPwu/yG+abfX0C8tAQ==","contentType":"image/jpeg","cacheControl":"public, max-age=2555778733956","lastModified":"2022-12-
27T18:32:14Z","storageTier":"Standard","versionId":"9f7a0ed1-28f9-4b25-9e40-1fee73f6d294","opcMeta":{}}

Any idea what's going on?

Hi @costainnovations ,

Our SDKs don't behave differently on different OS platforms. So ideally there shouldn't be a difference in responses on Linux vs Windows. Can you please confirm if you are calling the getObject on the same object on both platforms before we investigate it? Thanks!

Hi @KartikShrikantHegde,

Yes. We call the same object in windows/linux platforms. Now we have to make bucket to public read, because we couldn't solve the problem. We made many tests to confirm if there is any difference in code, but it wasn't found. The code are the same, same object, same private key, same region, same namespace.

My question about we made is why, in linux, the object apparently comes in request, but the "value" attribute is empty?

Thanks!

Hi @costainnovations , Can you confirm the node.Js version you are using? And is the version the same both on Windows and Linux?

Hi @KartikShrikantHegde,

Node versions:

Windows: v16.13.0
Alpine Linux: v18.7.0

@costainnovations the OCI TypeScript SDK supports NodeJS v14 and v16: https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/typescriptsdk.htm#Versions_Supported . Looks like you are using v18 on Linux. If you move to NodeJS v16 on that box, does it work?

Hi @jodoglevy and @KartikShrikantHegde,

You guys showed me the real mistake that i was make. The node version!

We change docker file to node 16 alpine and working fine!

Thank you!

Good to know you were able to resolve it. Closing the ticket for now, please feel free to reopen it if you run into issues.