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

error when updating to 4.50 #7231

Closed
4 tasks done
jhaddock385 opened this issue May 2, 2021 · 2 comments
Closed
4 tasks done

error when updating to 4.50 #7231

jhaddock385 opened this issue May 2, 2021 · 2 comments
Assignees

Comments

@jhaddock385
Copy link

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm install -g @aws-amplify/cli@latest

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

v12.18.3

Amplify CLI Version

4.48.0

What operating system are you using?

mac

Amplify Categories

auth, function, api, hosting

Amplify Commands

push

Describe the bug

I started out with amplify cli 4.48. I am working with another dev who is using version 4.50. If I update to 4.50 and then try to amplify push I get the following error: Cannot read property 'length' of undefined

After reverting to 4.48 I can amplify push again.

Additionally, I set up amplify frontend hosting with github ci before I noticed this problem. I went to check those frontend environments and it looks like after the other developer pushed to the github branches that those frontend environments are connected to, they stopped building successfully.

Looking at the errors on those environments, they are having the same problem I ran into when I tried to update my amplify CLI to 4.50.

2021-05-01T03:41:34.837Z [WARNING]: ✔ Initialized provider successfully. 2021-05-01T03:41:35.009Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud 2021-05-01T03:41:35.010Z [WARNING]: ✖ There was an error initializing your environment. 2021-05-01T03:41:35.013Z [INFO]: �[0mTypeError: Cannot read property 'length' of undefined�[0m

Expected behavior

I should be able to update my amplify vli and then amplify push without running into an error.
Also, my amplify frontend envs should be able to build.

Reproduction steps

  1. Pull an amplify project while using amplify cli 4.48
  2. update amplify cli to 4.50
  3. try to amplify push

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:121:99
    at Array.forEach (<anonymous>)
    at ApiGatewayAuthStack.createPoliciesFromResources (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:120:13)
    at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:94:16
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:84:31
    at Array.forEach (<anonymous>)
    at new ApiGatewayAuthStack (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:62:23)
    at createApiGatewayAuthResources (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:205:17)
    at Object.consolidateApiGatewayPolicies (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/consolidate-apigw-policies.ts:201:10)
    at Object.createEnvLevelConstructs (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/utils/env-level-constructs.ts:22:5)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:97:5)
    at async Promise.all (index 0)
    at providersPush (/usr/local/lib/node_modules/@aws-amplify/cli/src/extensions/amplify-helpers/push-resources.ts:99:3)
    at AmplifyToolkit.pushResources [as _pushResources] (/usr/local/lib/node_modules/@aws-amplify/cli/src/extensions/amplify-helpers/push-resources.ts:75:7)
    at Object.executeAmplifyCommand (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-function/src/index.ts:240:3)
    at executePluginModuleCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:175:3)
    at Object.executeCommand (/usr/local/lib/node_modules/@aws-amplify/cli/src/execution-manager.ts:28:5)
    at Object.run (/usr/local/lib/node_modules/@aws-amplify/cli/src/index.ts:139:5)
An error occurred when pushing the function resource

Additional information

No response

@cjihrig
Copy link
Contributor

cjihrig commented May 2, 2021

Thanks for reporting this @jhaddock385. I'm going to close this as a duplicate of #7190. Please see the linked issue for a workaround. There should also be a fix in the next release.

@cjihrig cjihrig closed this as completed May 2, 2021
@cjihrig cjihrig self-assigned this May 2, 2021
@github-actions
Copy link

github-actions bot commented Jun 1, 2021

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants