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

Can't deploy after Amplify Auth Import #2308

Closed
4 tasks done
galacoder opened this issue Oct 7, 2021 · 9 comments
Closed
4 tasks done

Can't deploy after Amplify Auth Import #2308

galacoder opened this issue Oct 7, 2021 · 9 comments
Labels
archived This issue has been locked. backend-builds bug Something isn't working

Comments

@galacoder
Copy link

galacoder commented Oct 7, 2021

Before opening, please confirm:

App Id

df8be0ia8uiak

Region

ap-southeast-1

Amplify Console feature

Build settings, Environment variables

Describe the bug

Checking for associated backend environment...

                             ## Backend environment association found

2021-10-07T16:18:37.531Z [INFO]: �[0mAmplify AppID found: df8be0ia8uiak. Amplify App name is: projectyou�[0m
2021-10-07T16:18:37.582Z [INFO]: �[0mBackend environment dev found in Amplify Console app: projectyou�[0m
2021-10-07T16:18:38.865Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2021-10-07T16:18:39.418Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2021-10-07T16:18:39.442Z [WARNING]: ✖ There was an error initializing your environment.
2021-10-07T16:18:39.449Z [INFO]: �[31mFailed to pull the backend.�[39m
2021-10-07T16:18:39.451Z [INFO]: �[31mauth headless is missing the following inputParams userPoolId, webClientId, nativeClientId, identityPoolId�[39m
2021-10-07T16:18:39.498Z [INFO]: �[0mError: auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId, identityPoolId�[0m
�[0m at ensureHeadlessParameters (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts:1288:11)�[0m
�[0m at Object.headlessImport (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts:1145:40)�[0m
�[0m at importedAuthEnvInit (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/provider-utils/awscloudformation/import/index.ts:922:18)�[0m
�[0m at runMicrotasks ()�[0m
�[0m at processTicksAndRejections (internal/process/task_queues.js:97:5)�[0m
�[0m at updateConfigOnEnvInit (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/provider-utils/awscloudformation/index.js:50:72)�[0m
�[0m at /root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-auth/src/index.js:304:22�[0m
2021-10-07T16:18:39.515Z [ERROR]: !!! Build failed
2021-10-07T16:18:39.515Z [ERROR]: !!! Non-Zero Exit Code detected
2021-10-07T16:18:39.516Z [INFO]: # Starting environment caching...
2021-10-07T16:18:39.516Z [INFO]: # Uploading environment cache artifact...
2021-10-07T16:18:39.628Z [INFO]: # Environment caching completed

Expected behavior

Successfully deploy my app after importing my existing User Pool

Reproduction steps

  1. Amplify Auth Import
  2. Amplify Push
  3. Git Push

Build Settings

version: 1.0
backend:
  phases:
    build:
      commands:
        - amplifyPush --simple
frontend:
  phases:
    preBuild:
      commands:
        - npm install --quiet --global expo-cli
        - >
          if [ -f yarn.lock ]; then
            yarn
          elif [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then
            npm ci
          else
            npm install
          fi
    build:
      commands:
        - expo build:web
  artifacts:
    baseDirectory: web-build
    files:
      - "**/*"
  cache:
    paths:
      - node_modules/**/*
      - $(npm root --global)/**/*

Additional information

I attempted this issue: #1271 (comment)
Screen_Shot_2021-10-08_at_00 19 17

This is what I build error I got
Screen_Shot_2021-10-08_at_00 32 23

Screen Shot 2021-10-08 at 10 54 23

Your earliest assistance is very much appreciated. Tks!

@github-actions
Copy link

github-actions bot commented Oct 7, 2021

Hi 👋, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

@hamedhemmati
Copy link

It looks like the deployment is down completely right now. It skips the build process and goes straight to deploy and fails.

@abhi7cr abhi7cr added the bug Something isn't working label Oct 8, 2021
@ghost ghost removed the bug Something isn't working label Oct 8, 2021
@ghost
Copy link

ghost commented Oct 15, 2021

Hi @hamedhemmati 👋🏽, I have not been able to reproduce this behavior entirely. After adding the environment variables, I was able to deploy successfully. Can you confirm that the AMPLIFY_IDENTITYPOOL_ID you provided exists and doesn't have any typos?

@hamedhemmati
Copy link

hi @hloriana for me the issue went away by itself after a couple of hours. I haven't had any issues deploying since.

@ghost
Copy link

ghost commented Oct 15, 2021

@hamedhemmati that's awesome! Thanks for providing these details. I'll go ahead and close this but if anything else occurs feel free to open another issue. Thank you!

@ghost ghost added backend-builds bug Something isn't working labels Oct 15, 2021
@ghost
Copy link

ghost commented Oct 15, 2021

I was able to reproduce the initial behavior with these steps:

  1. Create Cognito user pool and identity pool with requirements listed here
  2. amplify import auth
  3. amplify push
  4. git push
  5. Notice the build stage fails with:
auth headless is missing the following inputParams userPoolId, webClientId, nativeClientId, identityPoolId

Solution:

  1. Add missing params as environment variables in the console
  2. Re-deploy
  3. Confirm the deployment is successful

@ghost ghost closed this as completed Oct 15, 2021
@galacoder
Copy link
Author

@hloriana Could u plz specify a bit more on Add missing params as environment variables in the console ? Where can I add these env vars ? Tks!

@ghost
Copy link

ghost commented Dec 1, 2021

Hi @onlineworld69 👋🏽 When importing auth, Amplify needs certain information in order to access those resources like AMPLIFY_USERPOOL_ID, AMPLIFY_WEBCLIENT_ID, AMPLIFY_NATIVECLIENT_ID, and AMPLIFY_IDENTITYPOOL_ID. You can add them in the console by navigating to your amplify app -> app settings -> environment variables. Here is a reference for default variables accessible by Amplify: Amplify console environment variables

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. backend-builds bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants