5

I am doing the walkthrough for building a full stack app with Amplify and am stuck on the third module, adding auth. I followed all the instructions to a T but my build is failing saying there are invalid feature flags like so.

                                 # Starting phase: build
2022-02-14T02:47:02.527Z [INFO]: [31mInvalid feature flag configuration[39m
2022-02-14T02:47:02.530Z [INFO]: [31mThese feature flags are defined in the "amplify/cli.json" configuration file and are unknown to the currently running Amplify CLI:[39m
                                 [31m  - project[39m
                                 [31m  - graphqltransformer.transformerversion[39m
                                 [31m  - graphqltransformer.suppressschemamigrationprompt[39m
                                 [31m  - graphqltransformer.securityenhancementnotification[39m
                                 [31m  - graphqltransformer.showfieldauthnotification[39m
                                 [31m  - auth.useenabledmfas[39m
                                 [31mThis issue likely happens when the project has been pushed with a newer version of Amplify CLI, try updating to a newer version.[39m
                                 [31mEnsure that the CI/CD pipeline is not using an older or pinned down version of Amplify CLI.[39m
                                 [31mLearn more about feature flags: https://docs.amplify.aws/cli/reference/feature-flags[39m
2022-02-14T02:47:02.539Z [ERROR]: !!! Build failed
2022-02-14T02:47:02.539Z [ERROR]: !!! Non-Zero Exit Code detected
2022-02-14T02:47:02.539Z [INFO]: # Starting environment caching...
2022-02-14T02:47:02.540Z [INFO]: # Uploading environment cache artifact...
2022-02-14T02:47:02.602Z [INFO]: # Environment caching completed
Terminating logging...

Here is my amplify/cli.json

{
  "features": {
    "graphqltransformer": {
      "addmissingownerfields": true,
      "improvepluralization": false,
      "validatetypenamereservedwords": true,
      "useexperimentalpipelinedtransformer": true,
      "enableiterativegsiupdates": true,
      "secondarykeyasgsi": true,
      "skipoverridemutationinputtypes": true,
      "transformerversion": 2,
      "suppressschemamigrationprompt": true,
      "securityenhancementnotification": false,
      "showfieldauthnotification": false
    },
    "frontend-ios": {
      "enablexcodeintegration": true
    },
    "auth": {
      "enablecaseinsensitivity": true,
      "useinclusiveterminology": true,
      "breakcirculardependency": true,
      "forcealiasattributes": false,
      "useenabledmfas": true
    },
    "codegen": {
      "useappsyncmodelgenplugin": true,
      "usedocsgeneratorplugin": true,
      "usetypesgeneratorplugin": true,
      "cleangeneratedmodelsdirectory": true,
      "retaincasestyle": true,
      "addtimestampfields": true,
      "handlelistnullabilitytransparently": true,
      "emitauthprovider": true,
      "generateindexrules": true,
      "enabledartnullsafety": true
    },
    "appsync": {
      "generategraphqlpermissions": true
    },
    "latestregionsupport": {
      "pinpoint": 1,
      "translate": 1,
      "transcribe": 1,
      "rekognition": 1,
      "textract": 1,
      "comprehend": 1
    },
    "project": {
      "overrides": true
    }
  }
}

I updated node, aws-amplify, and amplify all to the newest versions. What is the problem here?

Zio-4
  • 189
  • 2
  • 12
  • I found a post with the issue and followed the comments there. It worked! https://github.com/aws-amplify/amplify-console/issues/2552 – Zio-4 Feb 14 '22 at 04:15

2 Answers2

14

It seems to be a different version of amplify cli between the aws build image and your machine.

Check your version of amplify cli :

$ amplify --version

And override the version of amplify CLI in the build image : AWS Amplify console -> Build Settings -> Build Image Settings -> Live package updates -> Amplify CLI

enter image description here

Gabriel
  • 319
  • 3
  • 15
  • 3
    Worked! Thanks! Its also worth mentioning that if you do decide to update your local amplify/cli library, be sure to add the -g flag to install globally or you'll face another issue – Pythoner Feb 21 '22 at 22:11
0

To anyone who still has issues follow Gabriel's approach and make sure that you change manually the version on the Console from latest (which is the pre-typed input) to the version that matches exactly your CLI version.

Make sure also on the "Edit build image settings" to choose the Amplify CLI as it is not the first available option.