amplify-cli: Unable to push because of "Invalid AttributeDataType input" in auth with all attributes in sync to cognito userpool

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

8.x

Amplify CLI Version

7.6.12

What operating system are you using?

Mac and Windows

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

  • custom attribute custom:company
  • I added an own app client
  • I added read to custom:company to the existing 2 app clients but reverted this and still same error
  • I did not add analytics or sth new (as far as I know)
  • I just added UI stuff
  • I remember that my pretokenGeneration function was not assigned to Cognito anymore suddenly and I added it manually. But this is also some time ago
  • I normally just git push and not amplify push. Nevertheless in this case both does not work,

Amplify Categories

auth

Amplify Commands

publish

Describe the bug

when doing amplify push, I get the error

“Invalid AttributeDataType input, consider using the provided AttributeDataType enum. (Service: AWSCognitoIdentityProviderService; Status Code: 400; Error Code: InvalidParameterException”

Expected behavior

run smoothly and deploy all changes

Reproduction steps

see https://github.com/aws-amplify/amplify-cli/issues/9525

GraphQL schema(s)

# Put schemas below this line


Log output

# Put your logs below this line


Additional information

See https://github.com/aws-amplify/amplify-cli/issues/9525#issuecomment-1020368077 and https://github.com/aws-amplify/amplify-cli/issues/9525#issuecomment-1020417480 for more details

There are more users with this problem like @sandeep-pracbee

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

Did you mean to remove it manually in cli-inputs.json to match the cloud template file?

@SunnieBB yes. try changing the cli-inputs.json in the backend directory (not the #current-cloud-backend directory)

if amplify/backend/auth/myapp1234/cli-inputs.json has:

"requiredAttributes": [
"email",
"phone"
],

change it to:

"requiredAttributes": [
"phone"
],

Then try amplify push.

@SunnieBB it worked for me when reducing the cli-inputs.json file to whats required in the template.

This solved it for me: https://github.com/aws-amplify/amplify-cli/issues/9525#issuecomment-1020860520

There was a difference between amplify/#current-cloud-backend/auth/myapp1234/build/myapp1234-cloudformation-template.json and amplify/backend/auth/myapp1234/cli-inputs.json

The #current-cloud-backend file had in my case only family_name and in cli-inputs.json I had email first_name, given_name and website.

It is still with all 4 elements in image

@johnpc: it is running now but do we get into trouble in the future with this configuration? It sounds for me super strange that the cloudformation template does not show the right configuration of the userpool but when having the right configuration, it fails. Also cognito seems not to care.

Thank you so much @jladdison for finding a solution.