Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/helm] Can't install older versions of MongoDB #18730

Closed
jwalton opened this issue Nov 8, 2019 · 5 comments
Closed

[stable/helm] Can't install older versions of MongoDB #18730

jwalton opened this issue Nov 8, 2019 · 5 comments
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@jwalton
Copy link

jwalton commented Nov 8, 2019

Describe the bug

Trying to install MongoDB 3.2.x results in a container that crashes continuously.

I have an older app I'm trying to migrate to Kubernetes, and the current production servers are running 3.2. My plan is to take a snapshot of the drives, kill off the old production instance, and then bring up a new instance to minimize downtime. But to do this, I'd either need to upgrade the existing production machines to the latest MongoDB, or I'd need to bring up MongoDB 3.2 in k8s and then upgrade in k8s. I prefer the latter, because I can try it out ahead of time and make sure it all goes smoothly, whereas I only get one chance to get it right on a live production system.

Version of Helm and Kubernetes:

Helm v3.0.0-rc.2
Kubernetes v1,14,7-eks

Which chart:

stable/helm

What happened:

The MongoDB container is stuck in CrashLoopBackOff. It doesn't seem to print any logs.

What you expected to happen:

MongoDB should come up.

How to reproduce it (as minimally and precisely as possible):

helm install mongo stable/mongodb --set image.tag=3.2.11-r2 \
  --set persistence.storageClass=standard 
@jwalton
Copy link
Author

jwalton commented Nov 8, 2019

If I run:

docker run -it --rm -e MONGODB_ROOT_PASSWORD=foo \
  -e MONGODB_SYSTEM_LOG_VERBOSITY=0 \
  -e MONGODB_DISABLE_SYSTEM_LOG=0 \
  -e MONGODB_ENABLE_IPV6=0 \
  -e MONGODB_ENABLE_DIRECTORY_PER_DB=no \
  --user=1001 \
  bitnami/mongodb:3.2.11-r2

which is (more or less) what K8s is running here, the container quits immediately. Interestingly, if I remove the --user=1001, it comes up.

And. sure enough:

helm install mongo stable/mongodb \
  --set persistence.storageClass=standard \
  --set image.tag=3.2.9-r2 \
  --set securityContext.enabled=false

gets it up and running.

@jwalton
Copy link
Author

jwalton commented Nov 8, 2019

Well... this almost works. If you try to make this a replica set and set a password on your mongodb cluster it fails with:

nami    INFO  Initializing mongodb
Error executing 'postInstallation': Not possible to configure replica set scenario using authentication. Please do not provided any of the following properties: username, password, database, rootPassword.

But, of course, you can't create a replica set without a password because of #16450.

@juan131
Copy link
Collaborator

juan131 commented Nov 12, 2019

Hi @jwalton

When MongoDB 3.2.11 was released, the stable/mongodb chart didn't even exist.

The chart evolved significantly during the last years and the images used on it (bitnami/mongodb) too. Therefore, it's very likely there are several incompatibilities between the current manifests used in the Helm chart and bitnami/mongodb:3.2.9-r2.

I recommend you to try to install it with an old version of the chart and try to make it work. You can list the versions using the command below:

$ helm search stable/mongodb --versions

And install the chart using:

$ helm install mongo stable/mongodb \
  --version X.Y.Z
  --set image.tag=3.2.9-r2
  ...

Under the section below you can find some of the notable changes included on the different MongoDB releases:

Probably the biggest changes was introduced at 3.6.13-debian-9-r15, when MongoDB configuration logic was moved to bash scripts in the rootfs folder.

@stale
Copy link

stale bot commented Dec 12, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 12, 2019
@stale
Copy link

stale bot commented Dec 26, 2019

This issue is being automatically closed due to inactivity.

@stale stale bot closed this as completed Dec 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

2 participants