-
Notifications
You must be signed in to change notification settings - Fork 69
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
GRANTs Failing for Several Grant Types #79
Comments
Can you try with The code already suffixes |
Interesting... I get the same error. provider-sql 2022-04-05T15:40:59.878Z DEBUG provider-sql Cannot create external resource {"controller": "managed/grant.mysql.sql.crossplane.io", "request": "/datadog-repl", "uid": "1a84a73b-e5d0-4958-92b1-07d82e0992b1", "version": "187649454", "external-name": "datadog-repl", "error": "cannot create grant: Error 1221: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES", "errorVerbose": "Error 1221: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES\ncannot create grant\ngithub.com/crossplane-contrib/provider-sql/pkg/controller/mysql/grant.(*external).Create\n\t/home/runner/work/provider-sql/provider-sql/pkg/controller/mysql/grant/reconciler.go:249\ngithub.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*Reconciler).Reconcile\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/github.com/crossplane/crossplane-runtime@v0.13.0/pkg/reconciler/managed/reconciler.go:670\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/sigs.k8s.io/controller-runtime@v0.8.0/pkg/internal/controller/controller.go:293\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/sigs.k8s.io/controller-runtime@v0.8.0/pkg/internal/controller/controller.go:248\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/sigs.k8s.io/controller-runtime@v0.8.0/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/k8s.io/apimachinery@v0.20.1/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/k8s.io/apimachinery@v0.20.1/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/k8s.io/apimachinery@v0.20.1/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/k8s.io/apimachinery@v0.20.1/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/k8s.io/apimachinery@v0.20.1/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext\n\t/home/runner/work/provider-sql/provider-sql/.work/pkg/pkg/mod/k8s.io/apimachinery@v0.20.1/pkg/util/wait/wait.go:99\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.17.7/x64/src/runtime/asm_amd64.s:1581"}
provider-sql 2022-04-05T15:40:59.879Z DEBUG controller-runtime.manager.events Warning {"object": {"kind":"Grant","name":"datadog-repl","uid":"1a84a73b-e5d0-4958-92b1-07d82e0992b1","apiVersion":"mysql.sql.crossplane.io/v1alpha1","resourceVersion":"187649454"}, "reason": "CannotCreateExternalResource", "message": "cannot create grant: Error 1221: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES"}
|
I get the same problem also. I can see for me listed in the status conditions the following:
|
I believe the problem is because |
I have confirmed my suspicion with the following test:
results in the error:
However,
Does not. |
@alexbowers I'm curious how this would be handled:
(I believe single quotes ( |
Can someone verify whether this is fixed in v0.5.0 with #83 ? |
@Duologic I just upgraded and get this.
|
I'm hitting this same problem trying to setup a mysql user for the prometheus-mysql exporter. We're evaluating using the provider and hoping to find some way to address this problem. |
Hello, I am getting the same error while trying to grant PROCESS privilege to my sql user
Is PR#97 going to fix that ? @augustomelo Was it tested ? |
Hello @JaroVojtek yes it will fix the issue (since the main problem was that passing "" the script would escape it, and since the documentations states that de database is not mandatory, the change also makes if you don't pass the database it will use "") unfortunately I was not able to set up the environment to test it, but running the |
Hello @augustomelo Was this already fixed or what is the status here please ? Thank you |
Hey @JaroVojtek you can check it here #104, I am waiting for the #105 to be merged so the CI/CD can run the integration test (I ran it locally, and no error appeared) |
Hey folks, I'm still having issues:
The error that I'm getting is:
For context, This is the
The ---
apiVersion: mysql.sql.crossplane.io/v1alpha1
kind: User
metadata:
name: mysql-exporter
spec:
providerConfigRef:
name: cluster1-percona
forProvider:
passwordSecretRef:
name: mysql-exporter-secret
namespace: percona
key: password
resourceOptions:
maxUserConnections: 3
writeConnectionSecretToRef:
name: connection-secret
namespace: percona
@augustomelo FYI |
@guilledipa you have to youse |
What happened?
I'm attempting to create several GRANTs in MySQL. A few succeed, but several fail with
cannot create grant: Error 1221: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
. It seems to be related to the specific GRANT types I am trying to create.PROCESS, REPLICATION CLIENT, REPLICATION SLAVE
in particular.I can create the failing GRANTs from the MySQL CLI without any issue, using the same username/password that Crossplane is using.
Other GRANT objects with different sets of GRANT types work correctly and create the grants. e.g.
"SELECT","INSERT","UPDATE", "DELETE","EXECUTE","CREATE TEMPORARY TABLES"
How can we reproduce it?
What environment did it happen in?
Crossplane version:
Image: crossplane/crossplane:v1.7.0
Image: crossplane/provider-sql-controller:v0.4.1
uname -a
)uname -a Linux aks-lab90-23705758-vmss000001 5.4.0-1069-azure #72~18.04.1-Ubuntu SMP Mon Feb 7 11:12:24 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Debug Log
The text was updated successfully, but these errors were encountered: