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

Failed to Pull the backend - \auth\parameters.json' does not exist #13667

Closed
2 tasks done
KuzonFyre opened this issue Mar 22, 2024 · 9 comments
Closed
2 tasks done

Failed to Pull the backend - \auth\parameters.json' does not exist #13667

KuzonFyre opened this issue Mar 22, 2024 · 9 comments
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage

Comments

@KuzonFyre
Copy link

How did you install the Amplify CLI?

npm

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

18.18.2

Amplify CLI Version

12.10.1

What operating system are you using?

Windows

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

Similar to this issue #12766 link here. I am unable to push or pull withou t an error, Failed to Pull the backend. I ran this command with --appId and --envName dev. I also ran this with the --debug flag which produces this error \amplify\backend\auth\{APPID]\parameters.json' does not exist While making this issue I tried the amplify diagnose --send-report command which gave me \amplify\backend\amplify-meta.json' does not exist.

Expected behavior

I can still run my application. All GraphQL endpoints are working normally along with auth. I need to add social providers to my auth setup and I am assuming I can't do that until I have the amplify-meta.json file.

Reproduction steps

I can't provide the repo but can provide the local report that was generated.

Project Identifier

No response

Log output

# Put your logs below this line
PullBackendFault: Failed to pull the backend.
    at attachBackend (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cl
                                                                               li-internal\lib\attach-backend.js:55:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
                                                                               5)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\commands\pull.js:64:9)
    at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_mo
                                                                               odules\@aws-amplify\cli-internal\lib\index.js:194:9)
    at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modu
                                                                               ules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5)
    at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amp
                                                                               plify\cli-internal\lib\execution-manager.js:37:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\index.js:121:5)

File at path: 'C:\Users\NAME\APPNAME\amplify\backend\auth\APPID\parameter
                                                                               rs.json' does not exist
Error: File at path: 'C:\Users\NAME\APPNAME\amplify\backend\auth\APPID\pa
                                                                               arameters.json' does not exist
    at JSONUtilities.readJson (C:\snapshot\amplify-cli\build\node_modules\@aws-a
                                                                               amplify\amplify-cli-core\lib\jsonUtilities.js:44:19)
    at StateManager.getData (C:\snapshot\amplify-cli\build\node_modules\@aws-amp
                                                                               plify\amplify-cli-core\lib\state-manager\stateManager.js:327:56)
    at StateManager.getResourceParametersJson (C:\snapshot\amplify-cli\build\nod
                                                                               de_modules\@aws-amplify\amplify-cli-core\lib\state-manager\stateManager.js:149:25
                                                                               5)
    at ensureAmplifyMetaFrontendConfig (C:\snapshot\amplify-cli\build\node_modul
                                                                               les\@aws-amplify\cli-internal\lib\extensions\amplify-helpers\on-category-outputs-
                                                                               -change.js:105:60)
    at AmplifyToolkit.onCategoryOutputsChange (C:\snapshot\amplify-cli\build\nod
                                                                               de_modules\@aws-amplify\cli-internal\lib\extensions\amplify-helpers\on-category-o
                                                                               outputs-change.js:46:53)
    at initializeEnv (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cl
                                                                               li-internal\lib\initialize-env.js:143:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
                                                                               5)
    at async onSuccess (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\
                                                                               \cli-internal\lib\attach-backend.js:81:17)
    at async attachBackend (C:\snapshot\amplify-cli\build\node_modules\@aws-ampl
                                                                               lify\cli-internal\lib\attach-backend.js:50:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\commands\pull.js:64:9)
    at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_mo
                                                                               odules\@aws-amplify\cli-internal\lib\index.js:194:9)
    at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modu
                                                                               ules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5)
    at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amp
                                                                               plify\cli-internal\lib\execution-manager.js:37:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\index.js:121:5)


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.
@KuzonFyre KuzonFyre added the pending-triage Issue is pending triage label Mar 22, 2024
@ykethan
Copy link
Member

ykethan commented Mar 25, 2024

Hey @KuzonFyre, thank you for reaching out. Are you running the pull with --appId and --envName dev in an existing project? Does the error occur if you pull the backend into a empty folder outside the existing project directory?

Could download the #current-cloud-backend.zip from the deployment bucket(name ending with -deployment) on the S3 console, under the /auth/<auth-name>/build do you observe a parameters.json file?

@ykethan ykethan added auth Issues tied to the auth category of the CLI pending-response Issue is pending response from the issue author labels Mar 25, 2024
@KuzonFyre
Copy link
Author

@ykethan Thanks for the reply. I run this in the root directory of an exisiting project. I tried running this in an empty directory outside of my project and recived the same error \amplify\backend\auth\{APPID]\parameters.json' does not exist. I do see a parameters.json file in the #current-cloud-backend.zip. Can I copy that into my local?

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Mar 25, 2024
@KuzonFyre
Copy link
Author

KuzonFyre commented Mar 25, 2024

I tried copying that file into \amplify\backend\auth\{APPID]\parameters.json. I am noticing that the auth name that I have locally is different then the one in the error message. I went through all of the local files and removed any references to what I am assuming was another auth setup. The files I changed were team-provider-info.json and backend-config.json I double checked my cognetio user pools and I only have the one with the appid that was showing up in current-cloud-backend.zip. After that it still produces \amplify\backend\auth\{APPID]\parameters.json' does not exist. As far as I can tell there are no remaining references to the duplicate auth setup.

@ykethan
Copy link
Member

ykethan commented Mar 26, 2024

@KuzonFyre was the auth resource migrated from an older of version Amplify CLI?
Could you provide us the Amplify CLI version being utilized by running amplify --version.

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Mar 26, 2024
@KuzonFyre
Copy link
Author

KuzonFyre commented Mar 26, 2024

@ykethan The version is 12.10.1

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Mar 26, 2024
@ykethan
Copy link
Member

ykethan commented Mar 28, 2024

@KuzonFyre From Amplify CLI version 7, the CLI expects a cli-inputs.json file in the Amplify auth resource. On a push, the cli-inputs.json is transformed into parameters.json under the auth/build folder. On a pull the cli checks if the cli-inputs.json is present.
Could you provide us the full error message with the path as the path provided \amplify\backend\auth\APPID\parameters.json indicates a older CLI version being utilized?

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Mar 28, 2024
@KuzonFyre
Copy link
Author

@ykethan My auth folder has the same ID that I expected to see from AWS. That ID is napkyff72303c/. This auth folder has a cli-inputs.json file. Note that the error message below, gives me a different auth folder, napkyb8f78fcb. The APPID thing I did was just to remove that info because I thought it was potentially sensitive. I didn't ever change my cli version.

🛑 Failed to pull the backend.

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/

PullBackendFault: Failed to pull the backend.
    at attachBackend (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cl
                                                                               li-internal\lib\attach-backend.js:55:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
                                                                               5)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\commands\pull.js:64:9)
    at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_mo
                                                                               odules\@aws-amplify\cli-internal\lib\index.js:194:9)
    at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modu
                                                                               ules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5)
    at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amp
                                                                               plify\cli-internal\lib\execution-manager.js:37:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\index.js:121:5)

File at path: 'C:\Users\hamil\Napky\amplify\backend\auth\napkyb8f78fcb\parameter
                                                                               rs.json' does not exist
Error: File at path: 'C:\Users\hamil\Napky\amplify\backend\auth\napkyb8f78fcb\pa
                                                                               arameters.json' does not exist
    at JSONUtilities.readJson (C:\snapshot\amplify-cli\build\node_modules\@aws-a
                                                                               amplify\amplify-cli-core\lib\jsonUtilities.js:44:19)
    at StateManager.getData (C:\snapshot\amplify-cli\build\node_modules\@aws-amp
                                                                               plify\amplify-cli-core\lib\state-manager\stateManager.js:327:56)
    at StateManager.getResourceParametersJson (C:\snapshot\amplify-cli\build\nod
                                                                               de_modules\@aws-amplify\amplify-cli-core\lib\state-manager\stateManager.js:149:25
                                                                               5)
    at ensureAmplifyMetaFrontendConfig (C:\snapshot\amplify-cli\build\node_modul
                                                                               les\@aws-amplify\cli-internal\lib\extensions\amplify-helpers\on-category-outputs-
                                                                               -change.js:105:60)
    at AmplifyToolkit.onCategoryOutputsChange (C:\snapshot\amplify-cli\build\nod
                                                                               de_modules\@aws-amplify\cli-internal\lib\extensions\amplify-helpers\on-category-o
                                                                               outputs-change.js:46:53)
    at initializeEnv (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\cl
                                                                               li-internal\lib\initialize-env.js:143:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5
                                                                               5)
    at async onSuccess (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\
                                                                               \cli-internal\lib\attach-backend.js:81:17)
    at async attachBackend (C:\snapshot\amplify-cli\build\node_modules\@aws-ampl
                                                                               lify\cli-internal\lib\attach-backend.js:50:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\commands\pull.js:64:9)
    at async Object.executeAmplifyCommand (C:\snapshot\amplify-cli\build\node_mo
                                                                               odules\@aws-amplify\cli-internal\lib\index.js:194:9)
    at async executePluginModuleCommand (C:\snapshot\amplify-cli\build\node_modu
                                                                               ules\@aws-amplify\cli-internal\lib\execution-manager.js:139:5)
    at async executeCommand (C:\snapshot\amplify-cli\build\node_modules\@aws-amp
                                                                               plify\cli-internal\lib\execution-manager.js:37:9)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify
                                                                               y\cli-internal\lib\index.js:121:5)

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Mar 28, 2024
@KuzonFyre
Copy link
Author

Figured it out! So I copied the cli-inputs.json from the auth setup that I know is on AWS, napkyff72303c/ and put the file into a new directory with the name of the folder the error message said it was missing napkyb8f78fcb. That pulled sucesfully. I pulled again and it removed the bad auth folder. Upon deploying it referenced napkyb8f78fcb. I searched for references for napkyb8f78fcb in my files and found a reference in backend-config.json file and one in team-provider-info.json. I removed those and it worked. Thanks for the help!

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants