bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.9k stars 9.17k forks source link

unable to start mongodb POD #15739

Closed acharbha closed 1 year ago

acharbha commented 1 year ago

Name and Version

docker.io/bitnami/mongodb:4.4

What steps will reproduce the bug?

annotations:
  category: Database
apiVersion: v2
appVersion: 4.4.1
dependencies:
- name: common
  repository: https://charts.bitnami.com/bitnami
  tags:
  - bitnami-common
  version: 1.x.x
description: NoSQL document-oriented database that stores JSON-like documents with
  dynamic schemas, simplifying the integration of data in content-driven applications.
home: https://github.com/bitnami/charts/tree/master/bitnami/mongodb
icon: https://bitnami.com/assets/stacks/mongodb/img/mongodb-stack-220x234.png
keywords:
- mongodb
- database
- nosql
- cluster
- replicaset
- replication
maintainers:
- email: containers@bitnami.com
  name: Bitnami
name: mongodb
sources:
- https://github.com/bitnami/bitnami-docker-mongodb
- https://mongodb.org
version: 10.0.1

Are you using any custom parameters or values?

I'm using MongoDB as a dependency chart with StackStorm HA helm installation Kubernetes. https://github.com/StackStorm/stackstorm-k8s

What is the expected behavior?

The container within the POD is supposed to be starting without issues. However, failing with the below error:

Advertised Hostname: stackstorm-k8s-ha-mongodb-0.stackstorm-k8s-ha-mongodb-headless.dbaas-gar.svc.cluster.local
Pod name matches initial primary pod name, configuring node as a primary
mongodb 06:28:21.00 
mongodb 06:28:21.00 Welcome to the Bitnami mongodb container
mongodb 06:28:21.01 Subscribe to project updates by watching https://github.com/bitnami/containers
mongodb 06:28:21.01 Submit issues and feature requests at https://github.com/bitnami/containers/issues
mongodb 06:28:21.01 
mongodb 06:28:21.01 INFO  ==> ** Starting MongoDB setup **
mongodb 06:28:21.03 INFO  ==> Validating settings in MONGODB_* env vars...
mkdir: cannot create directory '/bitnami/mongodb': Permission denied

What do you see instead?

CrashLoopBackOff: back-off 5m0s restarting failed container=mongodb pod=stackstorm-k8s-ha-mongodb-0_dbaas-gar(2debb13f-919d-46bd-8fd7-2c7bb18f1275)

Additional information

How to fix this issue?

carrodher commented 1 year ago

Bitnami containers are non-root by default, which means any file/dir used by the application should belong to the root group since the random user (1001 by default) is part of this root group. You should adapt the permission of your local directory so the root group is the owner.

You can find more info about non-root containers at

github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 1 year ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.