Skip to content
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

amplify push fails with Zlib error after amplify add function #13623

Closed
2 tasks done
pr0g opened this issue Feb 28, 2024 · 4 comments
Closed
2 tasks done

amplify push fails with Zlib error after amplify add function #13623

pr0g opened this issue Feb 28, 2024 · 4 comments
Labels
functions Issues tied to the functions category pending-triage Issue is pending triage

Comments

@pr0g
Copy link

pr0g commented Feb 28, 2024

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

16.20.2

Amplify CLI Version

12.10.1

What operating system are you using?

Mac (Sonama 14.2.1)

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

N/A

Describe the bug

When attempting to run amplify push after previously adding a new lambda function (amplify add function <name>) after the GraphQL schema is compiled, I receive an error that looks roughly like the following:

Received error [Error: Command failed with exit code 1: yarn --no-bin-links --production
...
error Error: incorrect data check
    at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
yarn install v1.22.21
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.] running command [yarn --no-bin-links --production]

I did some searching to see if anyone else has reported this and I came across this Stack Overflow post that seems to indicate it may be related to macOS Sonama (which I'm running).

I performed the exact same operation on a different machine running Windows 11, and things worked as expected.

If you have any idea what this may be or how I could resolve I'd be very grateful to know.

Expected behavior

amplify push works as expected on macOS Sonama when trying to add a new function

Reproduction steps

Not currently available - If more information is required I can try to reproduce in a smaller project

Project Identifier

1da990300fc92aec89645b7f0ce67ae3

Log output

This is a snippet from the log

2024-02-27T12:02:31.836Z|error : Received error [Error: Command failed with exit code 1: yarn --no-bin-links --production
warning <app> > aws-appsync > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning <app> > aws-appsync-auth-link > @aws-sdk/[email protected]: This package has moved to @smithy/util-hex-encoding
warning <app> > aws-appsync > aws-appsync-auth-link > @aws-sdk/[email protected]: This package has moved to @smithy/util-hex-encoding
warning <app> > aws-appsync > @aws-crypto/sha256-universal > @aws-sdk/[email protected]: This package has moved to @smithy/hash-node
error Error: incorrect data check
    at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
yarn install v1.22.21
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.] running command [yarn --no-bin-links --production]
ShellCommandExecutionError: Received error [Error: Command failed with exit code 1: yarn --no-bin-links --production
warning <app> > aws-appsync > [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning <app> > aws-appsync-auth-link > @aws-sdk/[email protected]: This package has moved to @smithy/util-hex-encoding
warning <app> > aws-appsync > aws-appsync-auth-link > @aws-sdk/[email protected]: This package has moved to @smithy/util-hex-encoding
warning <app> > aws-appsync > @aws-crypto/sha256-universal > @aws-sdk/[email protected]: This package has moved to @smithy/hash-node
error Error: incorrect data check
    at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
yarn install v1.22.21
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@pr0g pr0g added the pending-triage Issue is pending triage label Feb 28, 2024
@ykethan
Copy link
Member

ykethan commented Feb 28, 2024

Hey @pr0g, thank you for reaching out. From the logs provided it appears this is occurring on the installation. Could you try changing directories into the amplify/backend/function/<function-name> and run yarn install do you observe similar errors?
if the installation does not throw an error and if you run amplify push at the root of the project does the error still occur?

@ykethan ykethan added functions Issues tied to the functions category pending-response Issue is pending response from the issue author labels Feb 28, 2024
@pr0g
Copy link
Author

pr0g commented Feb 28, 2024

Hi @ykethan, thank you very much for getting back to me so quickly, I really appreciate it!

Thanks for the suggested approaches, I'm in UTC+0, so will try this tomorrow and leave an update here with how things go and update the state of the issue then.

Cheers!

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 28, 2024
@ykethan ykethan added the pending-response Issue is pending response from the issue author label Feb 29, 2024
@pr0g
Copy link
Author

pr0g commented Mar 4, 2024

Hi @ykethan, this issue appears to have resolved itself.

I'm not 100% sure what actually fixed it 🤔 But I think quite a lot of our dependencies and Amplify CLI were out of date which may have been contributing.

I'll close the issue for now and report back if I see it happen again and can find a repro. Thanks!

@pr0g pr0g closed this as completed Mar 4, 2024
@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Mar 4, 2024
Copy link

github-actions bot commented Mar 4, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions Issues tied to the functions category pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants