Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

MessagingUser "Failed to update after finalizers" operations is "null" #5093

Open
dan-j opened this issue Jul 29, 2020 · 0 comments
Open

MessagingUser "Failed to update after finalizers" operations is "null" #5093

dan-j opened this issue Jul 29, 2020 · 0 comments
Labels

Comments

@dan-j
Copy link

dan-j commented Jul 29, 2020

Describe the bug

Create a MessagingUser with type password is failing to reconcile by saying that the spec.authorization.operations is "null" and it expects array.

It looks like r.client.Update(ctx, user) isn't getting the same data that is being PUT to the api-server. I can kubectl get messaginguser and the fields are set as I expect. The only reasonable thing I can see the problem being is r.client.Get(ctx, request.NamespacedName, user) isn't unmarshalling the fields correctly.

Nothing more happens to the resource, I see status.phase is meant to be updated but it doesn't, and viewing the Keycloak dashboard my user isn't created.

To Reproduce

cat << EOF | kubectl -f-
apiVersion: user.enmasse.io/v1beta1
kind: MessagingUser
metadata:
  name: importer.worker
spec:
  username: worker
  authentication:
    type: password
    password: Y2hhbmdlbWU=
  authorization:
    - addresses: ["queue1", "queue2", "queue3"]
    - operations: ["send", "recv"]
EOF

Results in the following log message in the enmasse-operator:

{"level":"info","ts":1596060709.3697517,"logger":"controller_messaginguser","msg":"Reconciling MessagingUser","Request.Namespace":"default","Request.Name":"importer.worker"}
{"level":"info","ts":1596060709.3699453,"logger":"finalizer","msg":"Re-queue: added finalizer"}
{
  "level": "error",
  "ts": 1596060709.3799522,
  "logger": "controller-runtime.controller",
  "msg": "Reconciler error",
  "controller": "messaginguser-controller",
  "request": "default/importer.worker",
  "error": "Failed to update after finalizers: MessagingUser.user.enmasse.io \"importer.worker\" is invalid: spec.authorization.operations: Invalid value: \"null\": spec.authorization.operations in body must be of type array: \"null\"",
  "errorVerbose": "MessagingUser.user.enmasse.io \"importer.worker\" is invalid: spec.authorization.operations: Invalid val ue: \"null\": spec.authorization.operations in body must be of type array: \"null\"\nFailed to update after finalizers\ngithub.com/enmasseproject/enmasse/pkg/controller/messaginguser.(*ReconcileMessagingUser).Reconcile\n\t/home/runner/work/enmasse/enmasse/pkg/controll er/messaginguser/messaginguser_controller.go:134\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/work/enmasse/enmasse/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:256\nsigs.k8s.io/co ntroller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/work/enmasse/enmasse/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker \n\t/home/runner/work/enmasse/enmasse/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/home/runner/work/enmasse/enmasse/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\nk8s.io /apimachinery/pkg/util/wait.JitterUntil\n\t/home/runner/work/enmasse/enmasse/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/runner/work/enmasse/enmasse/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88\nruntime .goexit\n\t/opt/hostedtoolcache/go/1.13.1/x64/src/runtime/asm_amd64.s:1357",
  "stacktrace": "github.com/go-logr/zapr.(*zapLogger).Error\n\t/home/runner/work/enmasse/enmasse/vendor/github.com/go-logr/zapr/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller .(*Controller).reconcileHandler\n\t/home/runner/work/enmasse/enmasse/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:258\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/work/enmasse/ enmasse/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:232\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/home/runner/work/enmasse/enmasse/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/cont roller.go:211\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\t/home/runner/work/enmasse/enmasse/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:152\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\t/home/runner/work/enmasse/enmasse/vendor/k8s.io/apimachinery/ pkg/util/wait/wait.go:153\nk8s.io/apimachinery/pkg/util/wait.Until\n\t/home/runner/work/enmasse/enmasse/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"
}

Expected behavior

The resource reconcile, a user created in Keycloak and I'm able to connect to my address space authenticated and authorized.

Additional context

I've been using Enmasse for a couple of days without authn/z with great success, I don't think it's a problem with my installation.

  • enmasse v0.32.0
  • Running on Docker Desktop's local kubernetes cluster
> kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T18:55:03Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:18:29Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
@dan-j dan-j added the kind/bug label Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant