amplify-cli: deployment-secrets.json migration causes amplify[hostedUIProviderCreds] must have values error on amplify push

After upgrading cli to 4.34.0, the cli forces to move secrets from team-provider-info.json to deployment-secrets.json on amplify push After selecting Yes, it seem like the migration is successful and push works just fine. However, the deployment-secrets.json is never created and on the future pushes, I get the following error:

amplify[hostedUIProviderCreds] must have values

It is due to deletion of the hostedUIProviderCreds from the team-provider-info.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 14
  • Comments: 51 (11 by maintainers)

Most upvoted comments

@wcomicho The file should be under~/.aws/amplify/deployment-secrets.json

Same issue here. On top of that my Cognito schema (which contains custom fields) gets overwritten.

Getting the same issue trying to perform a very simple schema update (not sure why the auth update is even necessary in this situation)

image

Rolling back version is not helpful

Ok, so I was able to get this to work. It seems like version 4.34.0 removed the hostedUIProviderCreds: [] in the team-provider-info.json but didn’t successfully add it to deployment-secrets.json.

I updated the categories section in team-provider-info.json with:

"auth": {
   "[api_name]": {
     "hostedUIProviderCreds": "[]"
   },
   "userPoolGroups": {}
 },

The next time I ran amplify push it asked me to migrate to deployment-secrets.json and if I wanted to backup team-provider-info.json. I said yes and it successfully updated deployment-secrets.json:

{
  "appSecrets": [
    {
      "rootStackId": "[stack_id]",
      "environments": {
        "dev": {
          "auth": {
            "[api_name]": {
              "hostedUIProviderCreds": "[]"
            }
          }
        }
      }
    }
  ]
}

Ok, so I was able to get this to work. It seems like version 4.34.0 removed the hostedUIProviderCreds: [] in the team-provider-info.json but didn’t successfully add it to deployment-secrets.json.

I updated the categories section in team-provider-info.json with:

"auth": {
   "[api_name]": {
     "hostedUIProviderCreds": "[]"
   },
   "userPoolGroups": {}
 },

The next time I ran amplify push it asked me to migrate to deployment-secrets.json and if I wanted to backup team-provider-info.json. I said yes and it successfully updated deployment-secrets.json:

{
  "appSecrets": [
    {
      "rootStackId": "[stack_id]",
      "environments": {
        "dev": {
          "auth": {
            "[api_name]": {
              "hostedUIProviderCreds": "[]"
            }
          }
        }
      }
    }
  ]
}

And this overrides some information on Auth Cloud Formation template, like UsernameConfiguration or AccountRecoverySetting 👎 so any time that I need to push, I have to do this step plus modify the template and push again.

to solve this, I performed the following steps:

  1. confirm empty array for appSecrets in ~/.aws/amplify/deployment-secrets.json
  2. re-added “hostedUIProviderCreds”: “[]” to team-provider-info.json
  3. amplify push answer y when prompted for backup creation
  4. verify item is added to array in ~/.aws/amplify/deployment-secrets.json

In my app, there is no hostedUIProvider creds. The existing behavior should not require a config in deployment-secrets if there are none in the app.

@ammarkarachi I do not remember if the CLI threw an error at me or not. After I upgraded to version 4.34.0 I do remember it asking me if I wanted to backup team-provider-info.json. I recall typing yes but don’t remember if it errored on me or not. I was able to push after that upgrade.

When I updated to version 4.35.0 this morning and tried to do a push, it gave me the [hostedUIProviderCreds] must have values error. I then checked my team-provider-info.json on another branch, pre-upgrade, and noticed under the categories -> auth section, I had:

"[api_name]": {
   "hostedUIProviderCreds": "[]"
 },

So I added that back into my team-provider-info.json file, re-ran amplify push, and the CLI then asked me to migrate to deployment-secrets.json again. After it migrated I checked the deployment-secrets.json file and the hostedUIProviderCreds were added. Upon a successful push, hostedUIProviderCreds were removed but every push since has worked.

I hope all that made sense.

I’m guessing forcing the migration again must correct something in the CLI?

I am also having this issue. I upgraded to 4.35.0 and am receiving this error when trying to amplify push:

[hostedUIProviderCreds] must have values

The deployment-secrets.json file gets created but only has this in it:

{
  "appSecrets": []
}