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

helm upgrade: mediawikiPassword must not be empty #25943

Open
sle78 opened this issue May 16, 2024 · 3 comments
Open

helm upgrade: mediawikiPassword must not be empty #25943

sle78 opened this issue May 16, 2024 · 3 comments
Assignees
Labels
in-progress mediawiki tech-issues The user has a technical issue about an application

Comments

@sle78
Copy link

sle78 commented May 16, 2024

Name and Version

bitnami/mediawiki v16.1.4

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Set mediawikiSecret and comment out or set mediawikiPassword empty
  2. helm upgrade bitnami/mediawiki mediawiki
  3. If I specify a password, I get:
Error: UPGRADE FAILED: execution error at (techwiki/charts/mediawiki/templates/NOTES.txt:120:3): 
mediawiki: mediawikiSecret
    You cannot provide both mediawikiPassword and mediawikiSecret

Are you using any custom parameters or values?

--set mediawikiPassword="$MEDIAWIKI_PASSWORD"

What is the expected behavior?

Since we are using a secret, it should not complain about empty password.

What do you see instead?

Error: UPGRADE FAILED: execution error at (techwiki/charts/mediawiki/templates/NOTES.txt:118:4): 
PASSWORDS ERROR: You must provide your current passwords when upgrading the release.
                 Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims.
                 Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases

    'mediawikiPassword' must not be empty, please add '--set mediawikiPassword=$MEDIAWIKI_PASSWORD' to the command. To get the current value:

        export MEDIAWIKI_PASSWORD=$(kubectl get secret --namespace "mediawiki" techwiki -o jsonpath="{.data.mediawiki-password}" | base64 -d)
IF I SPECIFY A PASSWORD
mediawiki: mediawikiSecret
    You cannot provide both mediawikiPassword and mediawikiSecret
@sle78 sle78 added the tech-issues The user has a technical issue about an application label May 16, 2024
@github-actions github-actions bot added the triage Triage is needed label May 16, 2024
@github-actions github-actions bot removed the triage Triage is needed label May 16, 2024
@github-actions github-actions bot assigned fmulero and unassigned carrodher May 16, 2024
@fmulero
Copy link
Collaborator

fmulero commented May 20, 2024

Hi @sle78, thanks for using bitnami/charts.

Could you share how the secret was created? This secret should have the field mediawiki-password to work.

@sle78
Copy link
Author

sle78 commented May 20, 2024

apiVersion: v1
data:
  mariadb-password: xxxxx
  mariadb-replication-password: xxxxx
  mariadb-root-password: xxxxx
  mediawiki-password: xxxxx
kind: Secret
metadata:
  annotations:
    meta.helm.sh/release-name: mediawiki
    meta.helm.sh/release-namespace: mediawiki
  creationTimestamp: "2023-09-08T15:40:22Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: mediawiki-mariadb
  namespace: mediawiki
  resourceVersion: "55004502"
  uid: 63e8b806-f2eb-481b-bb41-1fa8ff974ad9
type: Opaque

So when I created this app i.e. helm install mediawiki bitnami/mediawiki everything worked fine, the problem is when I use helm upgrade mediawiki bitnami/mediawiki, that doesn't work

@fmulero
Copy link
Collaborator

fmulero commented May 27, 2024

I am facing other issues probably related to a wrong assumption: According to the content of your secret and I think you are using mediawiki-mariadb secret to store mediawiki and mariadb passwords. If I do that and I set that secret for both porpouses my mediawiki pod won't work, it doesn't start.

I'd like to reproduce exactly your case before applying any patch or fix. Could you share your specific steps to reproduce the problem?. For instance, these are the steps I followed:

  1. Create the secret with this command:
$ kubectl create secret generic mediawiki-test  --from-literal mediawiki-password=salame --from-literal=mariadb-password=salchichon --from-literal=mariadb-root-password=sausage
secret/mediawiki-test created
  1. Using these values:
mediawikiSecret: mediawiki-test
mediawikiHost: mediawiki.example.com
mariadb:
  auth:
    existingSecret: mediawiki-test

Install the chart:

helm install mediawiki bitnami/mediawiki -f ../support/charts/25943/mediawiki.yaml 
NAME: mediawiki
LAST DEPLOYED: Mon May 27 10:27:23 2024
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mediawiki
CHART VERSION: 20.1.0
APP VERSION: 1.41.1

** Please be patient while the chart is being deployed **

1. Get the MediaWiki URL by running:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace default -w mediawiki'

  export SERVICE_IP=$(kubectl get svc --namespace default mediawiki --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
  echo "Mediawiki URL: http://$SERVICE_IP/"

2. Get your MediaWiki login credentials by running:

    echo Username: user
    echo Password: $(kubectl get secret --namespace default mediawiki -o jsonpath="{.data.mediawiki-password}" | base64 -d)

WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
  - resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

NOTE: Pods don't work and the get secret message is wrong. Same secret shouldn't be used for mariadb and mediawiki password
3. Upgrade the chart:

rror: UPGRADE FAILED: execution error at (mediawiki/templates/NOTES.txt:118:4): 
PASSWORDS ERROR: You must provide your current passwords when upgrading the release.
                 Note that even after reinstallation, old credentials may be needed as they may be kept in persistent volume claims.
                 Further information can be obtained at https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues/#credential-errors-while-upgrading-chart-releases

    'mediawikiPassword' must not be empty, please add '--set mediawikiPassword=$MEDIAWIKI_PASSWORD' to the command. To get the current value:

        export MEDIAWIKI_PASSWORD=$(kubectl get secret --namespace "default" mediawiki -o jsonpath="{.data.mediawiki-password}" | base64 -d)

As I said, please share the instructions to reproduce it because the problems I shared seem not exactly the same you described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-progress mediawiki tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests

3 participants