Skip to content

AppStream 2.0 createStreamingURL -- Incorrect Endpoint #1189

@seliger

Description

@seliger

I am attempting to write a PHP script that uses createStreamingURL() to shuffle users over to AppStream to run apps. However, when I attempt to do this, I am seeing the following in the debug output:

Fatal error:  Uncaught exception 'Aws\Appstream\Exception\AppstreamException' with message 'Error executing "CreateStreamingURL" on "https://appstream.us-east-1.amazonaws.com"; AWS HTTP error: Client error: `POST https://appstream.us-east-1.amazonaws.com` resulted in a `404 Not Found` response:
<UnknownOperationException/>

 Unable to parse error information from response - Error parsing JSON: unexpected character'

exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: `POST https://appstream.us-east-1.amazonaws.com` resulted in a `404 Not Found` response:
<UnknownOperationException/>

' in /home/ubuntu/workspace/appstream-auth/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111
Stack trace:
#0 /home/ubuntu/workspace/appstream-auth/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/ubuntu/workspace/appstream-auth/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHtt in /home/ubuntu/workspace/appstream-auth/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php on line 192

If you notice, the URL it is sending the request to is appstream.us-east-1.amazonaws.com. Invoking the same call using the CLI with debugging turned on shows something different -- and it works:

2017-02-19 21:17:40,079 - MainThread - botocore.hooks - DEBUG - Event request-created.appstream2.CreateStreamingURL: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x7f0bb3cf5410>>
2017-02-19 21:17:40,080 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2017-02-19 21:17:40,080 - MainThread - botocore.auth - DEBUG - CanonicalRequest:
POST
/

content-type:application/x-amz-json-1.1
host:appstream2.us-east-1.amazonaws.com
x-amz-date:20170219T211740Z
x-amz-target:PhotonAdminProxyService.CreateStreamingURL

content-type;host;x-amz-date;x-amz-target
1cf4403fe47d8a04d4bae8ac1702fd31a6cb0dbb7b4416734f51fc445bcc98c5
2017-02-19 21:17:40,080 - MainThread - botocore.auth - DEBUG - StringToSign:
AWS4-HMAC-SHA256
20170219T211740Z
20170219/us-east-1/appstream/aws4_request
dd06cfd0468c5baee613c52d113014f643462a407de176ac6592dff97056ee8d
2017-02-19 21:17:40,081 - MainThread - botocore.auth - DEBUG - Signature:
fe1ed79fe16808c1144ea58913c7a82326bc07808f9688782bb193340306ae42
2017-02-19 21:17:40,089 - MainThread - botocore.endpoint - DEBUG - Sending http request: <PreparedRequest [POST]>
2017-02-19 21:17:40,090 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - INFO - Starting new HTTPS connection (1): appstream2.us-east-1.amazonaws.com
2017-02-19 21:17:40,316 - MainThread - botocore.vendored.requests.packages.urllib3.connectionpool - DEBUG - "POST / HTTP/1.1" 200 448

You will notice here, using appstream_2_.us-east-1.amaazonaws.com, that the CLI gets a 200 and happily returns a JSON object containing the requested streaming URL.

Please investigate. I tried mucking about in the SDK code trying to get it to point at appstream2, but that proved to be more difficult than originally thought.

Thank you!
Corey

php-debug.txt
cli-debug.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions