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

Lambda Layer always in Status Change since layer refactoring #7569

Closed
4 tasks done
StefanV85 opened this issue Jun 21, 2021 · 4 comments · Fixed by #7581
Closed
4 tasks done

Lambda Layer always in Status Change since layer refactoring #7569

StefanV85 opened this issue Jun 21, 2021 · 4 comments · Fixed by #7581
Assignees
Labels
bug Something isn't working functions Issues tied to the functions category lambda-layers issues related to Lambda Layers referenced-in-release Issues referenced in a published release changelog

Comments

@StefanV85
Copy link

StefanV85 commented Jun 21, 2021

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

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

14.15.5

Amplify CLI Version

5.0.1

What operating system are you using?

Windows

Amplify Categories

auth, function, api, hosting

Amplify Commands

push, status

Describe the bug

Hello,

My existing Amplify Project use Lambda Layers. I updated now to Amplify Cli Version 5.0.1. Since Amplify 5 there is a complete refactoring of the Layer Handling.

The Migration of my Lambda Layer was done. and i updated all lambda settings to always use the latest lambda layer.
it works fine. if i change my layer code, all lambda functions are updated to the newest version.

The Problem is, that after the Amplify Push, the layer has again (without coding change) the amplify status "change".
so if i would do an "amplify push" => everything works.
But if i would do an "amplify push" or "amplify status" directly after, the status of the layer is imediatly "Update".

The result is, that each amplify push, will result in an new amplfy layer version, even i doesn't change the layer code.
if the layer always have the status "change".

i tried to setup a new "hello world" amplify project, with a lambda function, and an lambda layer. The problem doesn't exist here. after the "amplify push", the status of the lambda layer is in Status "No Change".

Are there any tricks, how to fix my layer in the existing project? Or how can i find out the reason, why amplify set the status to "Update"?

Kind Regards
Stefan

Expected behavior

After the Amplify Push, the layer has the status "No Change"

Reproduction steps

  1. amplify push => successfully "√ All resources are updated in the cloud"
  2. amplify status => Layer has status "Change"
  3. amplify push => New Layer Version is created.

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


Additional information

No response

@attilah
Copy link
Contributor

attilah commented Jun 21, 2021

@StefanV85 this is an issue that we try to replicate on our end with no success yet. Could you give more information about your layer and the project?

  1. what runtime is this layer using?
  2. what version of the CLI was the layer created with?
  3. did you do the migration with 5.0.0 or 5.0.1?
  4. is the layer referenced by any function?
  5. can you send a file list without (node_modules or lib/python3.x directory) of the affected layer?

@attilah attilah added lambda-layers issues related to Lambda Layers pending-response Issue is pending response from the issue author pending-triage Issue is pending triage bug Something isn't working functions Issues tied to the functions category and removed pending-triage Issue is pending triage pending-response Issue is pending response from the issue author labels Jun 21, 2021
@attilah attilah self-assigned this Jun 22, 2021
@StefanV85
Copy link
Author

Hi @attilah

I tried to narrow down the problem for a while today.
In generell i was able to reproduce the problem in a new amplify project. I just copied all my source code files (which are in the opt folder of the layer) in the new project. And The Problem is in the new amplify project again.

so it's defenetly not a problem with the "migration" of the layer refactoring.
Unfortunately i can't share my sourcecode here, because it's production code.

i wasn't able to narrow down the problem to specific files yet.

regarding your questions:

  1. Layer Runtime: NodeJS
  2. Which Version created the lambda layer: because it happens in a new project too, we can use the version 5.0.1.
  3. Migration happend with 5.0.1. But it's not related to the migration, because it also happens in new projects.
  4. Yes i have Lambda Functions wihich use this layer. Setting: "Always use the newest version"
  5. Is the filelist still necassary? Because i see you already linked an pull request? :-)

@github-actions github-actions bot added the referenced-in-release Issues referenced in a published release changelog label Jun 24, 2021
@github-actions
Copy link

👋 Hi, this issue was referenced in the v5.0.2 release!

Check out the release notes here https://github.com/aws-amplify/amplify-cli/releases/tag/v5.0.2.

@attilah attilah mentioned this issue Jun 24, 2021
4 tasks
cjihrig pushed a commit to ctjlewis/amplify-cli that referenced this issue Jul 12, 2021
@github-actions
Copy link

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 Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working functions Issues tied to the functions category lambda-layers issues related to Lambda Layers referenced-in-release Issues referenced in a published release changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants