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

1st Deploy of Data Model fails from Amplify Studio #958

Closed
2 tasks done
daveashworth opened this issue May 31, 2023 · 8 comments
Closed
2 tasks done

1st Deploy of Data Model fails from Amplify Studio #958

daveashworth opened this issue May 31, 2023 · 8 comments
Labels
bug An issue which has been identified as a bug data Data modelling deployment studio-ui An issue that needs to be tracked by Studio Console team

Comments

@daveashworth
Copy link

How did you install the Amplify CLI?

npm

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

16.13.1

Amplify CLI Version

12.0.3

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

I had defined the data model for a new Amplify project and clicked "Deploy" in the Amplify Studio and immediately saw the deploy error message in the UI asking me to report this issue.

Expected behavior

I expected the data model I defined to be created and then deployed.

Reproduction steps

Again, this happened in Amplify Studio, but it asked me to report it here. I defined the data model, then clicked "Deploy" and got the error.

Project Identifier

4188a2e36601ecf00b1a0c9b2e1c7fe2

Log output

# Put your logs below this line
Command failed with exit code 1: amplify add api --headless [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. [WARNING] aws-cdk-lib.CfnResource#addDependsOn is deprecated. use addDependency This API will be removed in the next major release. {"errorName":"UnknownFault","errorMessage":"There is already a Construct with name 'PermissionsRolesPermissionsDataResolverFn' in TransformerNestedStack [ConnectionStack]","resolution":"Please report this issue at https://github.com/aws-amplify/amplify-cli/issues and include the project identifier from: 'amplify diagnose --send-report'","link":"https://docs.amplify.aws/cli/project/troubleshooting/"} Amplify command hooks are disabled in the current execution environment. See https://docs.amplify.aws/cli/usage/command-hooks/ for more information. Session Identifier: 96225e83-3f02-4af4-88f9-1fd29b5a21d4

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.
@daveashworth daveashworth added the pending-triage An issue that is pending triage label May 31, 2023
@daveashworth
Copy link
Author

Screen Shot 2023-05-31 at 5 17 31 PM

@ykethan
Copy link
Member

ykethan commented Jun 1, 2023

Hey @daveashworth, 👋 thank you for reaching out. The error message seems to be masked with the CDK warnings

There is already a Construct with name 'PermissionsRolesPermissionsDataResolverFn' in TransformerNestedStack [ConnectionStack]

Does the data model have a many to many relationship? was there a recent change to the data model such as changing the model name or data type on a field?
Could you provide your AppID(present in the url or the AWS console) and the data model being utilized?

I will be transferring the issue to studio repository for further assistance.

@ykethan ykethan transferred this issue from aws-amplify/amplify-cli Jun 1, 2023
@ykethan ykethan added pending-response An issue is pending response from the issue requestor deployment data Data modelling labels Jun 1, 2023
@daveashworth
Copy link
Author

Hey @ykethan 👋

I do have a few many-to-many relationships in the model, but this was the initial creation step. No pre-existing model. I was trying to define a Permissions and a Roles model with a many-to-many relationship between those two. Unfortunately the overall model wasn't created when I clicked "Deploy" and I'm going to need to create this from scratch again as none of what I defined yesterday exists today in the Studio.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Jun 1, 2023
@daveashworth
Copy link
Author

I took a screenshot yesterday before stopping for the day so here's what those two models looked like that I was trying to create.

Screen Shot 2023-06-01 at 9 04 24 AM

@daveashworth
Copy link
Author

And I believe this is the App ID if that still helps: d3kodjfp812wgk

@ykethan
Copy link
Member

ykethan commented Jun 1, 2023

Hey @daveashworth, I was able to reproduce the issue. The issue appears due to the naming conflict on Permissions model relationship. Changing the relationship name from RolesPermissions to for example Roles mitigates the issue.
Under the hood when deploying the GraphQL API, it autogenerates resolvers and in the resolvers it appears the API is already creating a resolver function with the name PermissionsRolesPermissionsDataResolverFn which is causing the conflict.

@ykethan ykethan added the studio-backend An issue that needs to be tracked by Studio Backend team label Jun 1, 2023
@daveashworth
Copy link
Author

Ok thank you @ykethan! I will re-create the model and make sure to change the name on that relationship for now.

@ykethan ykethan added bug An issue which has been identified as a bug and removed pending-triage An issue that is pending triage labels Jun 1, 2023
@murali-j-99 murali-j-99 added studio-ui An issue that needs to be tracked by Studio Console team and removed studio-backend An issue that needs to be tracked by Studio Backend team labels Jul 7, 2023
@cwoolum cwoolum closed this as completed Sep 23, 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
bug An issue which has been identified as a bug data Data modelling deployment studio-ui An issue that needs to be tracked by Studio Console team
Projects
None yet
Development

No branches or pull requests

4 participants