Amplify-console: Error when deploying through aws amplify console CI

Created on 23 Sep 2019  路  12Comments  路  Source: aws-amplify/amplify-console

We're currently getting the error below when deploying changes on amplify console ci:
image
Current version we use is 3.8.0. We did not change any config on amplify ci console. It was working before,

backend bug pending-customer-response

Most helpful comment

Hi, I've made a workaround for myself after guessing at the issue. It looks like the amplifyPush.sh command is failing because envCache has "stackInfo" set to garbage. envCache is normally updated after running amplify commands, but the script fails before it can be updated to a good value, getting "stackInfo" stuck in the bad state, which won't be fixed by updated amplify-cli.

I've gotten around this by modifying my amplify.yml build steps to include

backend:
  phases:
    build:
      commands:
        - envCache --set stackInfo ${STACKINFO}
        - amplifyPush --simple

where STACKINFO is a single-line json object set as an environment variable in the console. There used to be a button to press in the console to download this information, but I couldn't find it and needed to extract it from Cloudformation outputs.

I am still seeing the deploy issue as described in #143

All 12 comments

same problem after upgrade to 3.9.0

I've had issues with the amplify console since updating too. For me it was because the version of amplify-cli in the console was an old one (by default it was 1.7.0). You can see which version of the cli the console in using in the provision step:

Capture d鈥櫭ヽran 2019-09-23 脿 11 52 25

The solution is to override it in Build settings > Build image settings > Live package updates

Capture d鈥櫭ヽran 2019-09-23 脿 11 51 33

On the next generation, the right amplify-cli version will be installed at the end of the "cloning repository" step.
Capture d鈥櫭ヽran 2019-09-23 脿 11 54 24

Yes I adjusted those settings but the problem remain the same... The interesting part is I can deploy it from local cli with amplify push but it does not work from the cloud.

@im-dnsosso i've had issues like that too. Right now when that happens I just re-push from local and re-run the cloud deployment right after. It has worked so far but it's not reassuring...

Thank you! Let me try that...

# Starting phase: build # Executing command: amplifyPush --simple 2019-09-23T10:16:58.646Z [INFO]: # Getting Amplify CLI Cloud-Formation stack info from environment cache 2019-09-23T10:16:58.652Z [INFO]: # Start initializing Amplify environment: develop 2019-09-23T10:16:58.653Z [INFO]: STACKINFO=context.print.fancy is not a function TypeError: context.print.fancy is not a function at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env/get.js:53:35 at step (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env/get.js:33:23) at Object.next (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env/get.js:14:53) at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env/get.js:8:71 at new Promise (<anonymous>) at __awaiter (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env/get.js:4:12) at Object.run (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env/get.js:41:38) at /root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env.js:67:56 at step (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env.js:33:23) at Object.next (/root/.nvm/versions/node/v10.16.0/lib/node_modules/@aws-amplify/cli/lib/commands/env.js:14:53) # Importing Amplify environment: develop (amplify env import) 2019-09-23T10:16:59.467Z [INFO]: Scanning for plugins... 2019-09-23T10:17:06.445Z [INFO]: Plugin scan successful 2019-09-23T10:17:06.462Z [INFO]: You must pass in the configs of the environment in an object format using the --config flag 2019-09-23T10:17:06.509Z [ERROR]: !!! Build failed 2019-09-23T10:17:06.561Z [ERROR]: !!! Non-Zero Exit Code detected 2019-09-23T10:17:06.561Z [INFO]: # Starting environment caching... 2019-09-23T10:17:06.561Z [INFO]: # Uploading environment cache artifact... 2019-09-23T10:17:06.598Z [INFO]: # Environment caching completed

Same problem... I deleted the cache option from the buildspec but still no luck...

I am also seeing this issue on my latest deploy.

This is an issue tied to the Amplify console not able to switch CLI versions - they've been informed and looking into it. Moving it to the console team repo to further investigate and provide a workaround for the same.

Hi, I've made a workaround for myself after guessing at the issue. It looks like the amplifyPush.sh command is failing because envCache has "stackInfo" set to garbage. envCache is normally updated after running amplify commands, but the script fails before it can be updated to a good value, getting "stackInfo" stuck in the bad state, which won't be fixed by updated amplify-cli.

I've gotten around this by modifying my amplify.yml build steps to include

backend:
  phases:
    build:
      commands:
        - envCache --set stackInfo ${STACKINFO}
        - amplifyPush --simple

where STACKINFO is a single-line json object set as an environment variable in the console. There used to be a button to press in the console to download this information, but I couldn't find it and needed to extract it from Cloudformation outputs.

I am still seeing the deploy issue as described in #143

@incr3m Can you give me your AppId. So that we can do more research on the bug. Thanks for @RossWilliams 's workaround. The STACK_INFO is messed up due to CLI bug. Anyone who meets this error can reset the stackInfo with the following setting

backend:
  phases:
    build:
      commands:
        - envCache --set stackInfo ""
        - amplifyPush --simple

Make sure after the envCache is reset, you remove the envCache --set stackInfo "" line

Closing this issue right now. If you're still having issues please reopen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucaluke88 picture lucaluke88  路  4Comments

dongjason1 picture dongjason1  路  3Comments

gherrera-gesintel picture gherrera-gesintel  路  4Comments

thedgbrt picture thedgbrt  路  5Comments

nhhaidee picture nhhaidee  路  3Comments