aws-sdk-js-v3: TimestreamQueryClient.query throws UnknownOperationException
Describe the bug
Trying to query a Timestream table using TimestreamQueryClient
results in UnknownOperationException
.
SDK version number
@aws-sdk/client-timestream-query@^3.2.0
Is the issue in the browser/Node.js/ReactNative? Node.js
Details of the browser/Node.js/ReactNative version
$ node -v
v12.16.1
To Reproduce (observed behavior)
const {TimestreamQueryClient, QueryCommand} = require('@aws-sdk/client-timestream-query')
const client = new TimestreamQueryClient({region: 'us-east-2'})
const command = new QueryCommand({QueryString: 'SELECT * FROM table'})
await client.send(command)
or
const {TimestreamQuery} = require('@aws-sdk/client-timestream-query')
const client = new TimestreamQuery({region: 'us-east-2'})
await client.query('SELECT * FROM table')
Expected behavior No error.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 10
- Comments: 17 (3 by maintainers)
To me it looks like the SDK is not correctly resolving the endpoint. This still happens in v3.5.0 for simple commands.
The docs state that the endpoint resolution is done automatically but the 404 indicates this is not true or not working correctly.
The following code solves the issue for me, it also requires the
timestream:DescribeEndpoints
permission (the fallback urlingest-cell1.timestream.eu-west-1.amazonaws.com
was determined by calling theDescribeEndpoint
command):Does this have to do something with : https://github.com/aws/aws-sdk-js-v3/pull/1643/commits/cba38d3c199893c625798225184e1d04afec4cdb ?
I’m also hitting the same issue
The endpoint discovery is not yet supported in AWS SDK for JavaScript (v3). This documentation is currently in PR https://github.com/aws/aws-sdk-js-v3/pull/2106, and the support is planned in 2021.
I encountered this same generic error on
writeRecords
. However, after downgrading to AWS-SDK v2 and using the exact same inputswriteRecords
worked fine.V2 code that works:
V3 code that does not work:
My error:
@trivikr @kennu Tried the above mentioned workaround and it did not work as expected. Are there any other workarounds/solutions?