New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integ-tests: Response is not valid JSON #24491
Labels
@aws-cdk/integ-tests
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Comments
nikovirtala
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 7, 2023
2 tasks
Note this can be reproduced with any custom resource. |
pahud
added
p1
effort/medium
Medium work item – several days of effort
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Mar 7, 2023
mergify bot
pushed a commit
that referenced
this issue
Mar 10, 2023
…i-byte utf8 chars (#24501) Custom Resources need to write their response into a S3 object. This is implemented as a PUT request to a pre-signed URL and has to specify the `content-length` of the response object. Previously the CustomResource code would use `responseBody.length`. However this returns the number of graphemes, not bytes. If any utf8 characters with `graphemes != bytes` are part of the response, CloudFormation would fail the deployment with a `Response is not valid JSON` error. Also updates the `log-retention-provider` code, although the data should only contain 1-byte characters. Due to this limitation it can't be tested. Closes #24491 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
homakk
pushed a commit
to homakk/aws-cdk
that referenced
this issue
Mar 28, 2023
…i-byte utf8 chars (aws#24501) Custom Resources need to write their response into a S3 object. This is implemented as a PUT request to a pre-signed URL and has to specify the `content-length` of the response object. Previously the CustomResource code would use `responseBody.length`. However this returns the number of graphemes, not bytes. If any utf8 characters with `graphemes != bytes` are part of the response, CloudFormation would fail the deployment with a `Response is not valid JSON` error. Also updates the `log-retention-provider` code, although the data should only contain 1-byte characters. Due to this limitation it can't be tested. Closes aws#24491 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/integ-tests
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p1
Describe the bug
The integration test fails if the expected result object contains UTF-8 characters.
Expected Behavior
The test should return a successful status if the expectation match, regardless of what kind of data the user is trying to assert.
Current Behavior
The test fails with the following error:
Reproduction Steps
Run the test described in: https://github.com/nikovirtala/integ-runner-proto/blob/main/test/integ.not-valid-json.ts
Possible Solution
Maybe we shouldn't send full data objects to CloudFormation? — I don't see the data being displayed to the user.
Additional Information/Context
No response
CDK CLI Version
2.66.1
Framework Version
No response
Node.js Version
v18.14.2
OS
macOS Ventura
Language
Typescript
Language Version
4.9.5
Other information
No response
The text was updated successfully, but these errors were encountered: