amplify-cli
amplify-cli copied to clipboard
[hostedUIProviderCreds] do not exist in the template
How did you install the Amplify CLI?
No response
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
12.10.1
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
Describe the bug
Unable to push latest changes to Amplify environment due to bug, 'Reason: [hostedUIProviderCreds] do not exist in the template.
~/.aws/amplify/deployment-secrets.json
contains the following for the environment:
{
"appSecrets": [
{
"rootStackId": "ROOT_STACK_ID",
"environments": {
"ENV_NAME": {
"ENV": {
"COGNITO_USER_POOL": {
"hostedUIProviderCreds": "[]"
}
}
}
}
}
}
But I still receive the issue when trying to push latest changes.
Re-adding:
{
"hostedUIProviderCreds: "[]"
}
within team-provider-info.json
auth field regenerates deployment-secrets.json
but still fails to push with the above error remaining.
Deleting the amplify directory, re-pulling and attempting to push new changes still results in the error.
This issue has been reported in previous Github issues and still occurs in latest CLI.
- https://github.com/aws-amplify/amplify-cli/issues/6563
- https://github.com/aws-amplify/amplify-cli/issues/5942
Expected behavior
Specifying hostedUIProviderCreds
within deployment-secrets.json
should enable user to push changes to environment.
Pulling an environment should created default variable when unable to access environment variables related to identify providers.
Reproduction steps
Unsure, but most likely related to external authentication provider.
- Add external authentication provider
- Pull/update amplify project
- Remove authentication provider in AWS console
- Re-pull/update Amplify project
- Attempt to push changes
Project Identifier
No response
Log output
# Put your logs below this line
🛑 The following resources failed to deploy:
Resource Name: XYZ (AWS::CloudFormation::Stack)
Event Type: update
Reason: Parameters: [hostedUIProviderCreds] do not exist in the template
Additional information
No response
Before submitting, please confirm:
- [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.
Hey @R70YNS, thank you for reaching out. could you try running amplify update auth
, select Update OAuth social providers
, re-enter the credentials and run amplify push
. This should update the ~/.aws/amplify/deployment-secrets.json
file
Hi @ykethan
I've tried the above:
amplify update auth
Update OAuth social providers
(Purposely didn't select any) and pressed enter
amplify push
This still results in being unable to push any updates, even with the updated deployment-secrets.json
file
To confirm, it gave the same error message:
🛑 The following resources failed to deploy:
Resource Name: authxyz (AWS::CloudFormation::Stack)
Event Type: update
Reason: Parameters: [hostedUIProviderCreds] do not exist in the template
Tested on both Mac & Linux
Another issue related to the above, raised awhile back.
https://github.com/aws-amplify/amplify-cli/issues/3642
Unfortunately the known fix of adding "hostedUIProviderCreds": "[]"
to team-provider-info.json
no longer seems to work, instead just prompting to generate deployment-secrets.json
instead.
Even though deployment-secrets.json
contains the field hostedUIProviderCreds
for the relevant environment it still fails as above.
Hey @R70YNS, could you provide us the project identifier by running amplify diagnose --send-report
?
Remove authentication provider in AWS console
noticed this, could provide us some information on how the authentication provider was removed?
Project Identifier: bb01826d6e9e4d639ab999b6a0e018db
Authentication provider was removed via console via Cognito -> User pool -> Sign-in experience -> Federated Identity provider sign-in. I did notice though that the same thing was done in a different environment and this still works fine.
In trying to resolve the above, I deleted the local amplify directory and re-pulled via amplify pull --appId xyz --envName envName
but this still resulted in the same issue.
Hey @R70YNS, could you try the following
- run
amplify update auth
->Update OAuth social providers
. deselect the providers. - remove the deployment secrets from
team-provider-info.json
- delete the
~/.aws/amplify/deployment-secrets.json
file - then run
amplify push
Hi @ykethan
My team-provider-info.json
file contains:
{
"auth": {
"{{ resource name }}": {}
}
}
I've removed deployment-secrets.json
.
I didn't have any social providers selected, so purposely selected one and then deselected it. This changed my Auth resource when doing amplify status
.
I then tried pushing via amplify push --force
but still receive the issue.
🛑 The following resources failed to deploy:
Resource Name: XYZ (AWS::CloudFormation::Stack)
Event Type: update
Reason: Parameters: [hostedUIProviderCreds] do not exist in the template
Since the above failed, I deleted my amplify directory completely, re-pulled it, and without any modification tried doing amplify push --force
. I still wasn't able to update it and received the same issue:
🛑 Resource is not in the state stackUpdateComplete
Name: XYZ (AWS::CloudFormation::Stack), Event Type: update, Reason: Parameters: [hostedUIProviderCreds] do not exist in the template, IsCustomResource: false
I think this clearly shows there is an error in the CLI when pulling the environment. I'm unable to correct it even when using the --force
parameter.
@R70YNS thank you for the information. From the project identifier did not observe any reference in the cli-inputs.json
or backend-config.json
but noticed a reference in the root-cloudformation-stack.json
. Do you observe hostedUIProviderCreds
in the amplify-meta.json
under the auth block?
Hi @ykethan
I don't have a amplify-meta.json
locally, but within the deploymentBucket in S3 there is an amplify-meta.json
file. It only contains a awscloudformation
field underneath providers
. I cannot see a hostedUIProviderCreds
within the file.
I've tried regenerating deployment-secrets.json
aswell as modifying as below:
{
"rootStackId": "xxxx-xxxx-xxxx-xxxx",
"environments": {
"xxxx": {
"ENV": {
"COGNITO_USER_POOL": {
"hostedUIProviderCreds": "[]"
}
},
"auth": {
"$RESOURCE_NAME": {
"hostedUIProviderCreds": "[]"
}
}
}
}
}
But both still fail with Event Type: update, Reason: Parameters: [hostedUIProviderCreds] do not exist in the template
Hey @R70YNS, would be open for a quick call wanted to dive into the project. I am available on discord and my handle is ykethan
Resolved with @ykethan. Updated CLI and re-generated deployment-secrets.json
by re-adding:
"hostedUIProviderCreds": "[]"
under resource within auth field in team-provider.json
There was valid config already in deployment-secrets.json
, but running amplify push
after updating the CLI and triggering the changeover to generate deployment-secrets.json
worked.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.