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

Bug: Unable to delete User (with Improperly connected FirewallRule) #1112

Closed
melonrush13 opened this issue May 28, 2020 · 1 comment · Fixed by #1139
Closed

Bug: Unable to delete User (with Improperly connected FirewallRule) #1112

melonrush13 opened this issue May 28, 2020 · 1 comment · Fixed by #1139
Assignees
Labels
bug 🪲 Something isn't working

Comments

@melonrush13
Copy link
Contributor

melonrush13 commented May 28, 2020

Describe the bug
When we create an AzureSqlUser with a bad Firewall Rule (which doesn't have access to the server), we are unable to delete the AzureSqlUser. The reconciler throws a zaperr, and the delete never finishes.

To Reproduce
Steps to reproduce the behavior:
Create an azure sql server
Create an azure sql database
Create an azure sql firewallrule with the following:

  startipaddress: 0.0.0.0
  endipaddress: 0.0.0.0

Create an azure sql user
Note: AzureSql User will NOT be able to create. We will get the following message in status:

Login error: mssql: Cannot open server 'sqlservermeltest' requested by the login. Client with IP address '73.181.19.189' is not allowed to access the server.  To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect.

Delete the azuresql user
Will get the following zap err

}
2020-05-28T16:13:33.300-0600	ERROR	controller-runtime.controller	Reconciler error	{"controller": "azuresqluser", "request": "default/sqluser-samplemel", "error": "1 error occurred:\n\t* Login error: mssql: Cannot open server 'sqlservermeltest' requested by the login. Client with IP address '73.181.19.189' is not allowed to access the server.  To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.  It may take up to five minutes for this change to take effect.\n\n"}
github.com/go-logr/zapr.(*zapLogger).Error
	/Users/melanierush/go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:128
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/Users/melanierush/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.5.0/pkg/internal/controller/controller.go:258
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/Users/melanierush/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.5.0/pkg/internal/controller/controller.go:232
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker
	/Users/melanierush/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.5.0/pkg/internal/controller/controller.go:211
k8s.io/apimachinery/pkg/util/wait.JitterUntil.func1
	/Users/melanierush/go/pkg/mod/k8s.io/apimachinery@v0.17.2/pkg/util/wait/wait.go:152
k8s.io/apimachinery/pkg/util/wait.JitterUntil
	/Users/melanierush/go/pkg/mod/k8s.io/apimachinery@v0.17.2/pkg/util/wait/wait.go:153
k8s.io/apimachinery/pkg/util/wait.Until
	/Users/melanierush/go/pkg/mod/k8s.io/apimachinery@v0.17.2/pkg/util/wait/wait.go:88

The azuresqluser is never able to delete.

Expected behavior
We should be able to delete an azuresqluser if it is created with a FirewallRule which doesn't have access to the server.

Fix bug for the following operators

  • AzureSqlUser
  • PostgreSqlUser
  • MySqlUser

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@melonrush13 melonrush13 added bug 🪲 Something isn't working azure-sql labels May 28, 2020
@melonrush13 melonrush13 changed the title Bug: Unable to delete AzureSqlUser (with Improperly connected FirewallRule) Bug: Unable to delete User (with Improperly connected FirewallRule) Jun 1, 2020
@buhongw7583c buhongw7583c self-assigned this Jun 3, 2020
@buhongw7583c
Copy link
Contributor

Another edge scenario to be checked as well:
in mysqluser and postgresqluser, not define the username and create the user, then delete. The created user in service operator could be deleted but not in the database.

Check if the azuresqluser has the same issue as well.

buhongw7583c added a commit to buhongw7583c/azure-service-operator-1 that referenced this issue Jun 6, 2020
buhongw7583c added a commit to buhongw7583c/azure-service-operator-1 that referenced this issue Jun 8, 2020
@buhongw7583c buhongw7583c linked a pull request Jun 8, 2020 that will close this issue
2 tasks
melonrush13 added a commit to buhongw7583c/azure-service-operator-1 that referenced this issue Jun 8, 2020
buhongw7583c pushed a commit to buhongw7583c/azure-service-operator-1 that referenced this issue Jun 9, 2020
buhongw7583c added a commit that referenced this issue Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants