amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

Function Tokenizer failed - The Value field of every Outputs member must evaluate to a String and not a Map.

Open JackDurden00 opened this issue 11 months ago • 16 comments

How did you install the Amplify CLI?

yarn

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

16.20

Amplify CLI Version

12.4.0

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 i nerver did a manuel changes on the function tokenizer.

Describe the bug

i did amplify push there are 4 days. (i add a variable on my graph) and now i try to add another variable but when i use amplify push i have this error:

The following resources failed to deploy: Resource Name: functiontokenizer (AWS::CloudFormation::Stack) Event Type: update Reason: Template format error: The Value field of every Outputs member must evaluate to a String and not a Map. URL: https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/arn%3Aaws%3Acloudformation%3***********************************/events

so i try to just deleted my change (remove my change on my graph) and use amplify push again and i have the same error.

i dont understand because this function is supposed to be managed by Amplify.....

Expected behavior

i want to do the comand 'amplify push' with no error

Reproduction steps

amplify push:

The following resources failed to deploy: Resource Name: functiontokenizer (AWS::CloudFormation::Stack)

Project Identifier

No response

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • [X] I have removed any sensitive information from my code snippets and submission.

JackDurden00 avatar Mar 18 '24 21:03 JackDurden00

Hey @JackDurden00 :wave: thanks for raising this! By chance is this Function supported by a Lambda Layer? This seems related to https://github.com/aws-amplify/amplify-cli/issues/12076

josefaidt avatar Mar 19 '24 18:03 josefaidt

Hey josefaidt,

i saw that but its not a function that i created like this issue(12076), its the function tokenizer. that amplify generated.

JackDurden00 avatar Mar 19 '24 18:03 JackDurden00

Hey @JackDurden00 thanks for clarifying! What stack is this coming from? Do you see any additional logs with --debug or from the last few lines in the latest log in ~/.amplify/logs?

josefaidt avatar Mar 19 '24 18:03 josefaidt

i have this with amplify push: functiontokenizer AWS::CloudFormation::Stack UPDATE_FAILED

The following resources failed to deploy: Resource Name: functiontokenizer (AWS::CloudFormation::Stack) Event Type: update Reason: Template format error: The Value field of every Outputs member must evaluate to a String and not a Map. URL: https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/arn%3Aaws%3Acloudformation%3Aeu-central-1%3*******2Famplify-mvl-stgxix-150ef7f81c828/events

🛑 Resource is not in the state stackUpdateComplete Name: functiontokenizer (AWS::CloudFormation::Stack), Event Type: update, Reason: Template format error: The Value field of every Outputs member must evaluate to a String and not a Map., IsCustomResource: false

debug mode dont give me more info :(

JackDurden00 avatar Mar 19 '24 18:03 JackDurden00

Hey @JackDurden00, could you run amplify diagnose --send-report and provide us the project identifier output.

ykethan avatar Mar 21 '24 20:03 ykethan

There was a error with the sending diagnose:

amplify diagnose --send-report

✅ Report saved: /var/folders/tx/0bp****************/T/mvl/report-1711120840727.zip

⠙ Sending zip DiagnoseReportUploadError ✖ Sending zip

JackDurden00 avatar Mar 22 '24 15:03 JackDurden00

@JackDurden00 could you email us your amplify folder to [email protected]? this would enable us in diving deeper into the issue.

ykethan avatar Mar 22 '24 16:03 ykethan

OK, i sent it.

JackDurden00 avatar Mar 22 '24 20:03 JackDurden00

Hey @JackDurden00, thank you for information. On diving into the diagnose report, did notice the functiontokenizer is a lambda layer (tokenizer) under the function folder. Tried to reproduce the issue using the lambda layer but did not observe this error message on a push. Could you try invoking an update on the layer by adding a small dependancy then running amplify push, this should re-build the templates? if the above does note mitigate the issue, did notice the functions did not have a dependancy on this layer, could you try recreating the layer?

ykethan avatar Mar 22 '24 22:03 ykethan

Hey @ykethan, sorry for the delay. i dont understand the invoking an update on the function. there are a command for update the function tokenizer ?

JackDurden00 avatar Apr 16 '24 11:04 JackDurden00

@JackDurden00 we can trigger an update on the Lambda layer by adding a package in the package.json in the functions/<layer-name> folder

ykethan avatar Apr 17 '24 16:04 ykethan

Ah ok,

but when i did 'amplify status', the function tokenizer is already 'update'. So i try to change a package ?

and i dont knwo why sometimes this function is in update because i change nothing.

JackDurden00 avatar Apr 17 '24 18:04 JackDurden00

I encountered this error some months ago, but I recreated a new environment with Amplify. However, I'm unable to do it again now because the database is very large.

JackDurden00 avatar Apr 17 '24 18:04 JackDurden00

@JackDurden00 yes if run a push with a new package do observe a error? if you still run into a error and a function does not depend Lambda layer could you try running amplify remove function -> select the Lambda layer called tokenizer. The re-add the layer using amplify add function.

ykethan avatar Apr 18 '24 17:04 ykethan

"Hey @ykethan, I keep encountering the same error whenever I update the package.json for the 'tokenizer' function. If I decide to remove the function, should I run 'amplify push' afterward, or should I directly run the 'add function' command?"

JackDurden00 avatar Apr 18 '24 17:04 JackDurden00

@JackDurden00 either is fine. you can run push with --debug before just to ensure they are no errors.

ykethan avatar Apr 18 '24 17:04 ykethan

Closing the issue due to inactivity. Do reach out to us if you are still experiencing this issue

ykethan avatar Jun 11 '24 20:06 ykethan

This issue is now closed. 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.

github-actions[bot] avatar Jun 11 '24 21:06 github-actions[bot]