aws icon indicating copy to clipboard operation
aws copied to clipboard

TimestreamWrite `writeRecords` not working

Open GrahamCampbell opened this issue 3 years ago • 3 comments

Putting this here so I can remember to fix it.

AsyncAws\Core\Exception\Http\ClientException with message 'HTTP 404 returned for "https://ingest.timestream.us-east-1.amazonaws.com/".

Code:    UnknownOperationException
Message: 
Type:    
Detail:  
'

GrahamCampbell avatar May 03 '22 07:05 GrahamCampbell

I think this is because endpoint discovery is not implemented. The CLI tool makes two requests:

POST
/
content-type:application/x-amz-json-1.0
host:ingest.timestream.us-east-1.amazonaws.com
x-amz-api-version:2018-11-01
x-amz-date:20220503T103501Z
x-amz-target:Timestream_20181101.DescribeEndpoints
...
2022-05-03 11:35:01,005 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): ingest.timestream.us-east-1.amazonaws.com:443
2022-05-03 11:35:01,473 - MainThread - urllib3.connectionpool - DEBUG - https://ingest.timestream.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 200 105
...
2022-05-03 11:35:01,475 - MainThread - botocore.parsers - DEBUG - Response body:
b'{"Endpoints":[{"Address":"ingest-cell2.timestream.us-east-1.amazonaws.com","CachePeriodInMinutes":1440}]}'
...
POST
/
content-type:application/x-amz-json-1.0
host:ingest-cell2.timestream.us-east-1.amazonaws.com
x-amz-date:20220503T103501Z
x-amz-target:Timestream_20181101.WriteRecords
...
2022-05-03 11:35:01,478 - MainThread - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): ingest-cell2.timestream.us-east-1.amazonaws.com:443
2022-05-03 11:35:01,963 - MainThread - urllib3.connectionpool - DEBUG - https://ingest-cell2.timestream.us-east-1.amazonaws.com:443 "POST / HTTP/1.1" 400 128

GrahamCampbell avatar May 03 '22 10:05 GrahamCampbell

Having to do discovery first is quite a pain in the ass. It makes it difficult to trigger a big bunch of requests at the same time. I wonder if we should force the caller to do this for themselves?

GrahamCampbell avatar May 03 '22 10:05 GrahamCampbell

Gonna see if I can change out the codegen to ask for EndpointAddress: string on the inputs for all operations where endpoint discovery is required, and forward that through.

GrahamCampbell avatar May 03 '22 10:05 GrahamCampbell