amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

Deployment failed: MissingRequiredParameter: Missing required key 'functionId' in params

Open cabcookie opened this issue 1 year ago • 40 comments

Environment information

System:
  OS: macOS 14.3.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 112.33 MB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
  Yarn: undefined - undefined
  npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/backend: 0.12.1
  @aws-amplify/backend-cli: 0.11.1
  aws-amplify: 6.0.16
  aws-cdk: 2.126.0
  aws-cdk-lib: 2.126.0
  typescript: 5.3.3
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description

Hello, I run into an issue with my sandbox environment. It happened twice to me in the last 2 weeks and I had to delete and recreate my sandbox which has been quite cumbersome (including recreation of demo data). I login to my account using SSO and the profile org-data-amplify. My session is valid for a couple of hours and then I need to sign in again. Yesterday, I launched my sandbox environment with npx amplify sandbox --profile org-data-amplify and forgot to stop it. So, today I got back to VS Code (I didn't restart it) and stopped the sandbox and ran the command again. Now, I tried to make a change to my data model. I changed my Activity schema from

const schema = a.schema({
  Context: a.enum(["family", "hobby", "work"]),
  Activity: a
    .model({
      owner: a.string().authorization([a.allow.owner().to(["read", "delete"])]),
      notes: a.string(),
      finishedOn: a.datetime(),
    })
    .authorization([a.allow.owner()]),
});

to

const schema = a.schema({
  Context: a.enum(["family", "hobby", "work"]),
  Activity: a
    .model({
      owner: a.string().authorization([a.allow.owner().to(["read", "delete"])]),
      notes: a.string(),
      slateNotes: a.string(),
      finishedOn: a.datetime(),
    })
    .authorization([a.allow.owner()]),
});

Amplify identified correctly a file update, synthesized the template and tried to deploy the update but then failed with the mentioned error message. Here is the output in my console: [Sandbox] Triggered due to a file update event: /Users/carskoch/Development/personal-crm/amplify/data/resource.ts

✨ Synthesis time: 3.86s

⚠️ The --hotswap and --hotswap-fallback flags deliberately introduce CloudFormation drift to speed up deployments ⚠️ They should only be used for development - never use them for your production Stacks!

amplify-personalcrm-carskoch-sandbox-63e4bb09d0: deploying... [1/1]

✨ hotswapping resources: ✨ AWS::AppSync::FunctionConfiguration 'MutationcreateActivityauth0Function' ✨ AWS::AppSync::FunctionConfiguration 'MutationupdateActivityauth0Function' ✨ AWS::AppSync::GraphQLSchema 'uevvie4lgje2pegsontu5uvbwaGraphQLSchema' ✨ Contents of S3 Bucket 'amplify-personalcrm-carsk-amplifydataamplifycodege-8slq063fvosf'

✨ Contents of S3 Bucket 'amplify-personalcrm-carsk-amplifydataamplifycodege-8slq063fvosf' hotswapped! ✨ AWS::AppSync::GraphQLSchema 'uevvie4lgje2pegsontu5uvbwaGraphQLSchema' hotswapped! The CloudFormation deployment has failed. Find more information in the CloudFormation AWS Console for this stack. Caused By: ❌ Deployment failed: MissingRequiredParameter: Missing required key 'functionId' in params

It mentions I should verify CloudFormation. However, CloudFormation is not showing any events. How can I fix this issue?

cabcookie avatar Feb 27 '24 08:02 cabcookie