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

CLI errors after selecting "no" to migrate REST API created with older CLI version #9104

Closed
4 tasks done
josefaidt opened this issue Nov 26, 2021 · 1 comment · Fixed by #9068
Closed
4 tasks done
Labels
api-rest Issues tied to REST APIs bug Something isn't working extensibility Issues related to expand or customize current configuration

Comments

@josefaidt
Copy link
Contributor

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?

pnpm add -g @aws-amplify/cli

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

v16.13.0

Amplify CLI Version

v7.5.2

What operating system are you using?

Mac

Amplify Categories

api

Amplify Commands

update

Describe the bug

Initially the REST API was created with CLI 5.x/6.x. When attempting to add a path to the existing resource I am prompted to migrate the API, however after selecting "no" the CLI errors out looking for cli-inputs.json in the API resource's directory

> amplify update api
⚠️ Amplify command hooks are disabled in the current execution environment.
⚠️ See https://docs.amplify.aws/cli/usage/command-hooks/ for more information.
? Select from one of the below mentioned services: REST
✔ Select the REST API you want to update: · discordapi
✔ What would you like to do? · Add another path
✔ A migration is needed to support latest updates on api resources.
Recommended to try in a non-production environment first. Run "amplify env add" to create or clone an environment.
Learn more about this migration: https://docs.amplify.aws/cli/migration/override
Do you want to migrate api resource "discordapi"? (Y/n) · no
🛑 File at path: '/Users/josef/Documents/projects/aws-amplify/amplify-discord-bots/amplify/backend/api/discordapi/cli-inputs.json' does not exist
Error: File at path: '/Users/josef/Documents/projects/aws-amplify/amplify-discord-bots/amplify/backend/api/discordapi/cli-inputs.json' does not exist
    at Function.JSONUtilities.readJson (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/[email protected]/node_modules/amplify-cli-core/src/jsonUtilities.ts:25:15)
    at StateManager.getData (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/[email protected]/node_modules/amplify-cli-core/src/state-manager/stateManager.ts:399:32)
    at StateManager.getResourceInputsJson (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/[email protected]/node_modules/amplify-cli-core/src/state-manager/stateManager.ts:162:17)
    at updateWalkthrough (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/@[email protected]/node_modules/@aws-amplify/amplify-category-api/src/provider-utils/awscloudformation/service-walkthroughs/apigw-walkthrough.ts:83:35)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at ApigwInputState.updateApigwResource (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/@[email protected]/node_modules/@aws-amplify/amplify-category-api/src/provider-utils/awscloudformation/apigw-input-state.ts:93:25)
    at Object.executeAmplifyCommand (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/@[email protected]/node_modules/@aws-amplify/amplify-category-api/src/index.ts:222:5)
    at executePluginModuleCommand (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/@[email protected]/node_modules/@aws-amplify/cli/src/execution-manager.ts:204:3)
    at executeCommand (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/@[email protected]/node_modules/@aws-amplify/cli/src/execution-manager.ts:30:5)
    at Object.run (/Users/josef/.fnm/node-versions/v16.13.0/installation/pnpm-global/5/node_modules/.pnpm/@[email protected]/node_modules/@aws-amplify/cli/src/index.ts:205:5)

Expected behavior

Amplify CLI exits gracefully

Reproduction steps

  1. create REST API with Amplify CLI 6.x
  2. amplify push -y
  3. upgrade CLI to latest (7.5.2)
  4. amplify update api
  5. attempt to add a path
  6. select "No" to prompt asking to migrate the resource

GraphQL schema(s)

# Put schemas below this line

Log output

# Put your logs below this line


Additional information

No response

@josefaidt josefaidt added api-rest Issues tied to REST APIs bug Something isn't working extensibility Issues related to expand or customize current configuration labels Nov 26, 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 Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-rest Issues tied to REST APIs bug Something isn't working extensibility Issues related to expand or customize current configuration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant