"FeatureFlags is not initialized" when running `amplify api migrate`
Before opening, please confirm:
- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have searched for duplicate or closed issues.
- [X] I have read the guide for submitting bug reports.
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
How did you install the Amplify CLI?
npm install -g @aws-amplify/cli@latest
If applicable, what version of Node.js are you using?
v16.13.0
Amplify CLI Version
8.2.0
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Amplify Categories
api
Amplify Commands
Not applicable
Describe the bug
After updating amplify-cli from 4.27 to 8.2.0 running amplify api migrate I end up with the error FeatureFlags is not initialized. I was able to run amplify push afterwards without problems, so it does not seem to be related to https://github.com/aws-amplify/amplify-cli/issues/7068
I already re-installed amplify just to rule out any leftovers from the big versions bump, however, same result.
My <root>/amplify/cli.json:
{
"features": {
"graphqltransformer": {
"addmissingownerfields": false,
"improvepluralization": false,
"validatetypenamereservedwords": true,
"useexperimentalpipelinedtransformer": false,
"enableiterativegsiupdates": false,
"secondarykeyasgsi": false,
"skipoverridemutationinputtypes": false,
"transformerversion": 1,
"suppressschemamigrationprompt": true,
"securityenhancementnotification": true,
"showfieldauthnotification": false,
"usesubusernamefordefaultidentityclaim": false,
"securityEnhancementNotification": false
},
"frontend-ios": {
"enablexcodeintegration": false
},
"auth": {
"enablecaseinsensitivity": false,
"useinclusiveterminology": false,
"breakcirculardependency": false,
"forcealiasattributes": false,
"useenabledmfas": false
},
"codegen": {
"useappsyncmodelgenplugin": false,
"usedocsgeneratorplugin": false,
"usetypesgeneratorplugin": false,
"cleangeneratedmodelsdirectory": false,
"retaincasestyle": false,
"addtimestampfields": false,
"handlelistnullabilitytransparently": false,
"emitauthprovider": false,
"generateindexrules": false,
"enabledartnullsafety": false
},
"appsync": {
"generategraphqlpermissions": false
},
"latestregionsupport": {
"pinpoint": 0,
"translate": 0,
"transcribe": 0,
"rekognition": 0,
"textract": 0,
"comprehend": 0
},
"project": {
"overrides": true
}
}
}
Expected behavior
The migration process to start.
Reproduction steps
amplify api migrate
GraphQL schema(s)
# Put schemas below this line
Log output
# Put your logs below this line
2022-05-12T12:17:05.889Z|info : amplify migrate api
2022-05-12T12:17:05.932Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
Additional information
No response
Hey @thomasklein-winemaker :wave: thank you for taking the time to file this! While your cli.json looks great, can you confirm whether this error continuously pops up on subsequent amplify migrate api attempts? If you also run amplify update api, does it prompt to migrate the resource and is that also experiencing the same issue?
Hi Josef!
this error continuously pops up on subsequent amplify migrate api attempts
Yes it does.
...does it prompt to migrate the resource...
no, no prompt to migrate. Instead
amplify update api
? Select from one of the below mentioned services: GraphQL
General information
- Name: backend
- API endpoint: https://xxx.appsync-api.eu-central-1.amazonaws.com/graphql
Authorization modes
- Default: Amazon Cognito User Pool
- IAM
Conflict detection (required for DataStore)
- Disabled
? Select a setting to edit (Use arrow keys)
> Authorization modes
> Enable conflict detection (required for DataStore)
From here I didn't continue as neither option seems to solve my problem.
Is there any way I could run the command with a more verbose output? I couldn't find the option in the cli's flags.
I encounter the same problem 'FeatureFlags is not initialized'
Hey @thomasklein-winemaker and @johannchen2021 can you post the latest snippet from your logs in ~/.amplify/logs?
Sadly, not very enlightening.
2022-05-13T20:38:27.517Z|info : amplify migrate api
2022-05-13T20:38:27.565Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
We're hitting the same problem. The logs are the same too.
Is it a way to bypass the migration? I just want to override the default dynamodb table and point to a different table (backup table) for my amplify app. I got this error when I ran amplify override api "The GraphQL API is using transformer version 1. Run amplify migrate api to upgrade to transformer version 2 and rerun amplify override api to enable override functionality for API"
I tried to add a new env, and hoped that it would default to transformer version 2. However it automatically created the api resources with transformer version 1. Is it a way to make a new env with default to transformer version 2? Do I need to remove the amplify folder first before I create a new env?
Hey @thomasklein-winemaker , @jasonxh , and @johannchen2021 I was able to reproduce this issue on amplify migrate api using the following steps:
- use Amplify CLI 8.2.0
- run
amplify init -y - run
amplify add api> Accept defaults > Blank schema - change
transformerversionfeature flag to1 - change
useexperimentalpipelinedtransformerfeature flag tofalse - add the following to your
schema.graphqltype Todo @model { name: String! completed: Boolean! } - run
amplify push -y - run
amplify migrate api - observe error
> amplify migrate api The following types do not have '@auth' enabled. Consider using @auth with @model - Todo Learn more about @auth here: https://docs.amplify.aws/cli-legacy/graphql-transformer/auth GraphQL schema compiled successfully. Edit your schema at /path/to/my/project/amplify/backend/api/gqlmigrate/schema.graphql or place .graphql files in a directory at /path/to/my/project/amplify/backend/api/gqlmigrate/schema 🛑 FeatureFlags is not initialized
Marking this as a bug 🙂
I also just see the error "FeatureFlags is not initialized" when running 'amplify api migrate'. I update the cli fairly regularly so the problem is likely not caused by an update from a really old version. Any solutions or work-arounds would be greatly appreciated.
I've also came across the same issue as @jladdison said above. Any help is appreciated!
I have this same issue
+1
Experiencing this issue after being prompted to migrate api and auth during a push (and accepting/deploying those migrations). However the local schema and other files were never migrated, and now getting FeatureFlags is not initialized when trying to run amplify migrate api anyway to get this to run to auto migrate those files?
This issue should be fixed by this commit: https://github.com/aws-amplify/amplify-category-api/commit/5bd81fd2160bd619b3d10a382444598cea4f41f8 and the next release should address the error
Thanks @lazpavel @josefaidt. Can confirm it's working for me now.