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

Can't remove function #13439

Closed
2 tasks done
Ruetd-Devs opened this issue Nov 30, 2023 · 3 comments
Closed
2 tasks done

Can't remove function #13439

Ruetd-Devs opened this issue Nov 30, 2023 · 3 comments
Labels
functions Issues tied to the functions category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage

Comments

@Ruetd-Devs
Copy link

How did you install the Amplify CLI?

npm

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

v18.18.0

Amplify CLI Version

12.7.1

What operating system are you using?

Mac

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

No manual changes made

Describe the bug

Our team created a function that is triggered by a DynamoDB stream. It was deployed successfully. A team member then ran amplify push without first pulling the function into their codebase. This caused the function and triggers to be removed. The stream and CloudWatch log groups were left in place. The team member then pulled the function locally and ran amplify push. No changes were detected. A duplicate function under an alternate name was created and successfully deployed. Attempts to remove the old function prompted the creation of this bug report.

Screenshot 2023-11-29 at 10 33 30 PM

Expected behavior

The old function is removed.

Reproduction steps

Create a function and commit
Amplify push
Open the project without the added function (don't pull the commit)
Make a schema change and Amplify push
Pull the commit with the function
Amplify push (We expected this to fix the issue)
Create a new function under a different name
Amplify push
Amplify remove original function

Project Identifier

513f9a125170cf19b4d2e61fe787ec2e

Log output

# Put your logs below this line
2023-11-30T05:05:38.262Z|info : amplify remove function streamEntities 
2023-11-30T05:05:38.314Z|info : @aws-amplify/amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2023-11-30T05:05:38.885Z|error : Cannot read properties of undefined (reading 'value')
UnknownFault: Cannot read properties of undefined (reading 'value')
2023-11-30T05:05:57.386Z|info : amplify push core  
2023-11-30T05:05:57.442Z|info : @aws-amplify/amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2023-11-30T05:05:59.344Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2023-11-30T05:05:59.345Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"us-west-2"}])
2023-11-30T05:05:59.345Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2023-11-30T05:05:59.352Z|info : amplify-provider-awscloudformation.zip-util.downloadZip.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip"},null])
2023-11-30T05:05:59.353Z|info : amplify-provider-awscloudformation.aws-s3.s3.getFile([{"Key":"[***]rent-[***]ud-[***]d.zip","Bucket":"[***]ify-[***]td-[***]od-[***]504-[***]ment"}])
2023-11-30T05:06:03.794Z|info : amplify-provider-awscloudformation.initialize-env.run.cfn.updateamplifyMetaFileWithStackOutputs([{"StackName":"[***]ify-[***]td-[***]od-[***]504"}])
2023-11-30T05:06:03.795Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2023-11-30T05:06:03.796Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"region":"us-west-2"}])
2023-11-30T05:06:03.796Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])
2023-11-30T05:06:03.804Z|info : amplify-provider-awscloudformation.aws-cfn.updateamplifyMetaFileWithStackOutputs.cfn.listStackResources([{"StackName":"[***]ify-[***]td-[***]od-[***]504"}])


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.
@Ruetd-Devs Ruetd-Devs added the pending-triage Issue is pending triage label Nov 30, 2023
@ykethan
Copy link
Member

ykethan commented Nov 30, 2023

Hwy @Ruetd-Devs, thank you for reaching out.
Could you try removing the function reference from team-provider-info.json and backend-config.json , then run amplify env checkout <current-env-name>.
The amplify status should show as deleted, then run amplify push to remove the resource.

@ykethan ykethan added functions Issues tied to the functions category pending-response Issue is pending response from the issue author labels Nov 30, 2023
@josefaidt
Copy link
Contributor

Closing due to inactivity

@josefaidt josefaidt closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 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-response Issue is pending response from the issue author pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

3 participants