Git Product home page Git Product logo

Comments (20)

ykethan avatar ykethan commented on June 15, 2024

Hey @KuzonFyre, thank you for reaching out. Could you download the #current-cloud-backend.zip from the S3 deployment bucket on the AWS console. The bucket name should end with deployment and contain the app name.
Could you verify if the current-cloud-backend contains the amplify-meta.json?

if you do not observe a amplify-meta.json in the zip, we could try carefully re-zipping the contents with the local copy of amplify-meta.json without creating a nested folder similar to as follows, then upload the zip and try pulling the env in a new empty folder outside your existing project directory to test.

cd /#current-cloud-backend/
zip -r "../#current-cloud-backend.zip" *

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

@ykethan I do see an amplify-meta.json file in the root dir of #current-cloud-backend.zip.

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

@KuzonFyre could you try adding AMPLIFY_ENABLE_DEBUG_OUTPUT as true in the Amplify hosting environment variables and provide us the output?

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024
                                 # Starting phase: build
2024-04-02T15:07:55.770Z [INFO]: ## Running amplify pull to generate aws-exports.js file for frontend
2024-04-02T15:07:58.003Z [INFO]: �[0mAmplify AppID found: d1f2rx89u9ycx. Amplify App name is: Napky�[0m
2024-04-02T15:07:58.052Z [INFO]: �[0mBackend environment dev found in Amplify Console app: Napky�[0m
2024-04-02T15:07:59.526Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2024-04-02T15:08:00.228Z [INFO]: Overrides functionality is not implemented for this category
2024-04-02T15:08:00.229Z [WARNING]: - Building resource api/napky
2024-04-02T15:08:00.229Z [WARNING]: - Building resource auth/napkyff72303c
2024-04-02T15:08:00.229Z [WARNING]: - Building resource storage/s3korkbostoragephotos
2024-04-02T15:08:00.282Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2024-04-02T15:08:00.297Z [WARNING]: ✖ There was an error initializing your environment.
2024-04-02T15:08:00.306Z [INFO]: 🛑 Failed to pull the backend.
2024-04-02T15:08:00.306Z [INFO]: Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
                                 PullBackendFault: Failed to pull the backend.
                                 at attachBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:55:15)
                                 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:64:9)
                                 at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
                                 at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
                                 at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)
                                 File at path: '/codebuild/output/src3871774277/src/napky/amplify/backend/auth/napkyff72303c/parameters.json' does not exist
                                 Error: File at path: '/codebuild/output/src3871774277/src/napky/amplify/backend/auth/napkyff72303c/parameters.json' does not exist
                                 at JSONUtilities.readJson (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/jsonUtilities.js:44:19)
                                 at StateManager.getData (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/state-manager/stateManager.js:327:56)
                                 at StateManager.getResourceParametersJson (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/state-manager/stateManager.js:149:25)
                                 at ensureAmplifyMetaFrontendConfig (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/on-category-outputs-change.js:105:60)
                                 at AmplifyToolkit.onCategoryOutputsChange (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/on-category-outputs-change.js:46:53)
                                 at initializeEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:143:31)
                                 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                                 at async onSuccess (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:99:9)
                                 at async attachBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:50:9)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:64:9)
                                 at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
                                 at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
                                 at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)
2024-04-02T15:08:00.315Z [INFO]: 
2024-04-02T15:08:00.315Z [INFO]: Session Identifier: 0263abb0-021f-480d-9e12-006ca4853c94
2024-04-02T15:08:00.316Z [WARNING]: - Creating Zip
2024-04-02T15:08:00.324Z [INFO]: 
2024-04-02T15:08:00.324Z [INFO]: ✅ Report saved: /tmp/Napky/report-1712070480318.zip
2024-04-02T15:08:00.324Z [WARNING]: - Sending zip
2024-04-02T15:08:00.324Z [INFO]: File at path: '/codebuild/output/src3871774277/src/napky/amplify/backend/amplify-meta.json' does not exist
2024-04-02T15:08:00.326Z [WARNING]: ✖ Sending zip
2024-04-02T15:08:00.352Z [ERROR]: !!! Build failed
2024-04-02T15:08:00.352Z [INFO]: Please read more about Amplify Hosting's support for SSR frameworks to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/amplify-ssr-framework-support.html. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2024-04-02T15:08:00.352Z [ERROR]: !!! Error: Command failed with exit code 1
2024-04-02T15:08:00.352Z [INFO]: # Starting environment caching...
2024-04-02T15:08:00.353Z [INFO]: # Uploading environment cache artifact...
2024-04-02T15:08:00.417Z [INFO]: # Uploaded environment cache artifact
2024-04-02T15:08:00.417Z [INFO]: # Environment caching completed
Terminating logging...

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

@KuzonFyre from the logs it appears the build failed due to

Error: File at path: '/codebuild/output/src3871774277/src/napky/amplify/backend/auth/napkyff72303c/parameters.json' does not exist

from the comment #13667 (comment) it appears you were able to run a push.
Is the Live package updates on the Amplify hosting Build setting currently set to latest or an older version on Amplify CLI? or in the amplify.yml are you manually installing an older version of Amplify CLI?

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

I double checked the current cloud backup file that I downloaded earlier and their is a parameters.json file but it is in the build folder like so auth/napkyff72303c/build/parameters.json.

Live Package updates is set to the latest version of the cli.
image
Not seeing anything in the yml file that is set to an older version. I'm working on a team so it's possible someone else might have modified the backend. I think that's why I got #13667 in the first place.

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

@KuzonFyre interesting, the issue does show symptoms of this.
To ensure the project is in the correct state, could you zip the Amplify folder and send it to [email protected]?

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

Sent an email.

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

@ykethan Any updates on this?

from amplify-cli.

edwardfoyle avatar edwardfoyle commented on June 15, 2024

Hi @KuzonFyre taking a look at the stack trace you provided, it looks like the condition that is not being hit is here

!fs.existsSync(path.join(resourceDirPath, PathConstants.ParametersJsonFileName)) &&
fs.existsSync(path.join(resourceDirPath, PathConstants.CLIInputsJsonFileName)) &&

Looking at the amplify .zip archive you provided, I don't see what would be causing that condition to not hit. In addition to double checking that amplify/backend/auth/napkyff72303c/parameters.json does NOT exist and that amplify/backend/auth/napkyff72303c/cli-inputs.json DOES exist, can you also check that the same is true within the #current-cloud-backend directory?

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

I can confirm that amplify/backend/auth/napkyff72303c/parameters.json does not exist and that amplify/backend/auth/napkyff72303c/cli-inputs.json does exist in my local amplify dir. I can also confirm that is also true in the #current-cloud-backend dir that I downloaded from S3. I have sent another zip file to the email that was provided. This is the amplify folder for a previous version of the application that deployed correctly before we added a storage bucket for images. As far as I can tell there is nothing about adding storage to the Amplify folders that would have messed up Auth but it might be helpful.

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

While I would prefer to fix this without having to just delete the amplify folder and backend env on AWS and starting fresh, that is an acceptable work around at this point. I may test this on a git branch and update this comment if I observe the same issue on a fresh setup.

Update: Okay so I am going to send yet another zipped amplify folder that I set up on fresh build with the same setup, api, auth and storage. I ended up with the same error in AWS after I added the AMPLIFY_ENABLE_DEBUG_OUTPUT env variable.

Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
                                 PullBackendFault: Failed to pull the backend.
                                 at attachBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:55:15)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:64:9)
                                 at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
                                 at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
                                 at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)
                                 File at path: '/codebuild/output/src626817708/src/Napky/amplify/backend/auth/korkbo39ee6db5/parameters.json' does not exist
                                 Error: File at path: '/codebuild/output/src626817708/src/Napky/amplify/backend/auth/korkbo39ee6db5/parameters.json' does not exist
                                 at JSONUtilities.readJson (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/jsonUtilities.js:44:19)
                                 at StateManager.getData (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/state-manager/stateManager.js:327:56)
                                 at StateManager.getResourceParametersJson (/snapshot/amplify-cli/build/node_modules/@aws-amplify/amplify-cli-core/lib/state-manager/stateManager.js:149:25)
                                 at ensureAmplifyMetaFrontendConfig (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/on-category-outputs-change.js:105:60)
                                 at AmplifyToolkit.onCategoryOutputsChange (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/extensions/amplify-helpers/on-category-outputs-change.js:46:53)
                                 at initializeEnv (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/initialize-env.js:143:31)
                                 at async onSuccess (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:99:9)
                                 at async attachBackend (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/attach-backend.js:50:9)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:64:9)
                                 at async Object.executeAmplifyCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:194:9)
                                 at async executePluginModuleCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:139:5)
                                 at async executeCommand (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:37:9)
                                 at async Object.run (/snapshot/amplify-cli/build/node_modules/@aws-amplify/cli-internal/lib/index.js:121:5)
2024-04-08T22:27:55.718Z [INFO]: 

In this new setup I also double checked the #current-cloud-backup dir and my local dir and made sure I had cli-inputs.json and not parameters.json. You would have seen this when you looked at the first zip I sent but their was a parameters.json in the auth/napky/build dir. I will try a new setup with just the api and auth enabled and see if that changes anything.
@edwardfoyle

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

Did one more check and it doesn't look like adding storage caused any issues. @edwardfoyle @ykethan

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

@KuzonFyre from the information provided it appears issue doesnt appear be on the current-cloud-backend.zip. If are able to run amplify push locally and the issue is only occurring on the hosting builds with the live package override for Amplify CLI is set to latest, could you check if the local project root package.json and provide us the amplify packages installed here?
could you provide us the amplify.yml file here?

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

Here is the relevant dependencies in the package.json file. ```
"dependencies": {
"@aws-amplify/adapter-nextjs": "^1.0.21",
"@aws-amplify/ui-react": "^6.1.5",
"aws-amplify": "^6.0.18",
}

I do not have an amplify.yml file in the local dir but I do have a `.graphqlconfig.yml file`. 
```projects:
  korkbo:
    schemaPath: src/graphql/schema.json
    includes:
      - src/graphql/**/*.ts
    excludes:
      - ./amplify/**
    extensions:
      amplify:
        codeGenTarget: typescript
        generatedFileName: src/API.ts
        docsFilePath: src/graphql
extensions:
  amplify:
    version: 3

We had a version of the app deploying succesffully so I am going to go through all of the changes that occured after that point.

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

@KuzonFyre you can find the amplify.yml on the Amplify console under build setting
image

from amplify-cli.

KuzonFyre avatar KuzonFyre commented on June 15, 2024

@ykethan

version: 1
backend:
  phases:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm ci --cache .npm --prefer-offline
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - .next/cache/**/*
      - .npm/**/*

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

Hey @KuzonFyre , thank you for the information. Would you be open for a quick chat. I am available on discord, my handle is ykethan. Wanted to dive deeper into the issue over a screenshare.

from amplify-cli.

ykethan avatar ykethan commented on June 15, 2024

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

from amplify-cli.

github-actions avatar github-actions commented on June 15, 2024

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.

from amplify-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.