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

Reconcile Error after change the Config Map #304

Closed
Gsantomaggio opened this issue Sep 1, 2020 · 1 comment · Fixed by #308
Closed

Reconcile Error after change the Config Map #304

Gsantomaggio opened this issue Sep 1, 2020 · 1 comment · Fixed by #308
Assignees
Labels
bug Something isn't working

Comments

@Gsantomaggio
Copy link
Member

Gsantomaggio commented Sep 1, 2020

Describe the bug

When the definition-rabbitmq-server-conf config map is changed the Operator raises an exception:

2020-09-01T21:32:07.332+0200    ERROR   rabbitmqcluster-controller      Failed to enable plugins on pod definition-rabbitmq-server-0 in namespace default, running command rabbitmq-plugins set rabbitmq_peer_discovery_k8s rabbitmq_prometheus rabbitmq_management with output:   {"error": "unable to upgrade connection: container not found (\"rabbitmq\")"}
github.com/go-logr/zapr.(*zapLogger).Error
        /home/gas/go/pkg/mod/github.com/go-logr/zapr@v0.1.1/zapr.go:128
github.com/rabbitmq/cluster-operator/controllers.(*RabbitmqClusterReconciler).enablePlugins
        /home/gas/go/src/github.com/rabbitmq/cluster-operator/controllers/rabbitmqcluster_controller.go:367
github.com/rabbitmq/cluster-operator/controllers.(*RabbitmqClusterReconciler).Reconcile

And the config map won't be changed.

To Reproduce

Steps to reproduce the behavior:

  1. Install the operator
  2. Deploy the definition:
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
  name: definition
spec:
  replicas: 3
  1. Try to change the config map:

Screenshot from 2020-09-01 21-22-58

I was trying to change the log.file.level = debug
4. See error:

2020-09-01T21:32:07.332+0200    ERROR   rabbitmqcluster-controller      Failed to enable plugins on pod definition-rabbitmq-server-0 in namespace default, running command rabbitmq-plugins set rabbitmq_peer_discovery_k8s rabbitmq_prometheus 

Expected behavior
Change the config map without errors.

Version information

  • RabbitMQ: 3.8.5
  • RabbitMQ Cluster Operator: building from source 3e52b74
  • Kubernetes: Kind 1.17.5

Additional context

When the config map is changed, the reconcile restarts the pod, and when it tries to enable the plugins gets the error since the POD isn't ready yet.

@Gsantomaggio Gsantomaggio added the bug Something isn't working label Sep 1, 2020
@gerhard
Copy link
Contributor

gerhard commented Sep 2, 2020

Thanks for reporting this!

cc @mkuratczyk

@ansd ansd self-assigned this Sep 2, 2020
ansd added a commit that referenced this issue Sep 2, 2020
Fixes #304

Exec on pods only if StatefulSet is ready and up to date.

Before this commit, we observed in #304 that the controller tried to
exec into pods at the same time as the pods got updated due to a StatefulSet restart
resulting in connection errors.
ansd added a commit that referenced this issue Sep 8, 2020
Fixes #304

Exec on pods only if StatefulSet is ready and up to date.

Before this commit, we observed in #304 that the controller tried to
exec into pods at the same time as the pods got updated due to a StatefulSet restart
resulting in connection errors.
ansd added a commit that referenced this issue Sep 8, 2020
Relates to #304

Before this commit, the controller exec'ed into every RabbitMQ cluster pod in
every reconcile loop to idempotently 'rabbitmq-plugins set'.
Although simple and correct, these were unnecessary and expensive operations.

After this commit, the controller only execs into the pods if the
plugins config map got updated.
ansd added a commit that referenced this issue Sep 11, 2020
Fixes #304

Exec on pods only if StatefulSet is ready and up to date.

Before this commit, we observed in #304 that the controller tried to
exec into pods at the same time as the pods got updated due to a StatefulSet restart
resulting in connection errors.
ansd added a commit that referenced this issue Sep 11, 2020
Relates to #304

Before this commit, the controller exec'ed into every RabbitMQ cluster pod in
every reconcile loop to idempotently 'rabbitmq-plugins set'.
Although simple and correct, these were unnecessary and expensive operations.

After this commit, the controller only execs into the pods if the
plugins config map got updated.
@Zerpet Zerpet self-assigned this Sep 15, 2020
Zerpet pushed a commit that referenced this issue Sep 15, 2020
Fixes #304

Exec on pods only if StatefulSet is ready and up to date.

Before this commit, we observed in #304 that the controller tried to
exec into pods at the same time as the pods got updated due to a StatefulSet restart
resulting in connection errors.
Zerpet pushed a commit that referenced this issue Sep 15, 2020
Relates to #304

Before this commit, the controller exec'ed into every RabbitMQ cluster pod in
every reconcile loop to idempotently 'rabbitmq-plugins set'.
Although simple and correct, these were unnecessary and expensive operations.

After this commit, the controller only execs into the pods if the
plugins config map got updated.
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.

4 participants