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

String_Split issue #31

Closed
arouxAgicap opened this issue Feb 23, 2022 · 1 comment · Fixed by #52
Closed

String_Split issue #31

arouxAgicap opened this issue Feb 23, 2022 · 1 comment · Fixed by #52

Comments

@arouxAgicap
Copy link

I'm currently using version 0.2.4 of the provider and I encounter issues creating multiple users for the same database.
The error message is the following :
Error: unable to create user USER: mssql: There is already an object named 'String_Split' in the database

Looking at the previous issues and PRs, I saw that race condition can occurs if trying to create multiple users & login on the same database and it was supposedly fixed with #24.

Rolling back to 0.2.3 solved the problem

@alxy
Copy link
Collaborator

alxy commented Jun 10, 2022

May I ask on which compatibility level for the SQL database you are? You can find that out by running select name, compatibility_level FROM sys.databases on your database.

beandrad added a commit to beandrad/terraform-provider-mssql that referenced this issue Dec 14, 2022
When creating or updating a mssql user in servers with compatibility
level below 130, the `string_split` function needs to be created.

At the moment, this is causing issues when trying to create/update
multiple users, as each of those requests tries to create the same
function.

This change introduces a lock on application resource in exclusive
mode so that only one of the calls creates the function.

Fixes betr-io#31
beandrad added a commit to beandrad/terraform-provider-mssql that referenced this issue Dec 14, 2022
When creating or updating a mssql user in servers with compatibility
level below 130, the `string_split` function needs to be created.

At the moment, this is causing issues when trying to create/update
multiple users, as each of those requests tries to create the same
function.

This change introduces a lock on application resource in exclusive
mode so that only one of the calls creates the function.

Fixes betr-io#31
beandrad added a commit to beandrad/terraform-provider-mssql that referenced this issue Dec 14, 2022
When creating or updating a mssql user in servers with compatibility
level below 130, the `string_split` function needs to be created.

At the moment, this is causing issues when trying to create/update
multiple users, as each of those requests tries to create the same
function.

This change introduces a lock on application resource in exclusive
mode so that only one of the calls creates the function.

Fixes betr-io#31
beandrad added a commit to beandrad/terraform-provider-mssql that referenced this issue Dec 14, 2022
When creating or updating a mssql user in servers with compatibility
level below 130, the `string_split` function needs to be created.

At the moment, this is causing issues when trying to create/update
multiple users, as each of those requests tries to create the same
function.

This change introduces a lock on application resource in exclusive
mode so that only one of the calls creates the function.

Fixes betr-io#31
@magne magne closed this as completed in #52 Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants