Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hostedUIProviderCreds] do not exist in the template #13587

Closed
2 tasks done
R70YNS opened this issue Feb 11, 2024 · 14 comments
Closed
2 tasks done

[hostedUIProviderCreds] do not exist in the template #13587

R70YNS opened this issue Feb 11, 2024 · 14 comments
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage

Comments

@R70YNS
Copy link

R70YNS commented Feb 11, 2024

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.

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:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@R70YNS R70YNS added the pending-triage Issue is pending triage label Feb 11, 2024
@ykethan
Copy link
Member

ykethan commented Feb 12, 2024

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

@ykethan ykethan added auth Issues tied to the auth category of the CLI pending-response Issue is pending response from the issue author labels Feb 12, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 16, 2024

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

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 16, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 16, 2024

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

@R70YNS
Copy link
Author

R70YNS commented Feb 16, 2024

Another issue related to the above, raised awhile back.

#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.

@ykethan
Copy link
Member

ykethan commented Feb 17, 2024

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?

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Feb 17, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 19, 2024

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.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 19, 2024
@ykethan
Copy link
Member

ykethan commented Feb 21, 2024

Hey @R70YNS, could you try the following

  1. run amplify update auth -> Update OAuth social providers. deselect the providers.
  2. remove the deployment secrets from team-provider-info.json
  3. delete the ~/.aws/amplify/deployment-secrets.json file
  4. then run amplify push

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Feb 21, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 26, 2024

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.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 26, 2024
@ykethan
Copy link
Member

ykethan commented Feb 26, 2024

@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?

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Feb 26, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 28, 2024

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.

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 28, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 28, 2024

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

@ykethan
Copy link
Member

ykethan commented Feb 28, 2024

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

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Feb 28, 2024
@R70YNS
Copy link
Author

R70YNS commented Feb 29, 2024

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.

@R70YNS R70YNS closed this as completed Feb 29, 2024
@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Feb 29, 2024
Copy link

⚠️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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants