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

Nextcloud on Docker/K8s: "oc_admin" does not exist" after manifest update #2116

Closed
qworkz11 opened this issue Dec 7, 2023 · 2 comments
Closed
Labels

Comments

@qworkz11
Copy link

qworkz11 commented Dec 7, 2023

Hi,

I am having troubles with my docker Nextcloud installation using Kubernetes:

After updating the Nextcloud version in the K8s manifest (26.0.8-apache -> 27.1.3-apache), postgres seems to be corrupted, as it logs FATAL: password authentication failed for user "oc_admin" and Role "oc_admin" does not exist. messages. As a consequence I cannot reach the Nextcloud UI, and all occ commands fail (FATAL: password authentication failed for user "oc_admin"). I had experienced this error once before after some misconfiguration of mounted config files, and could only fix it by deleting all volumes and starting fresh.

I'm working on a test setup currently, so setting up a fresh Nextcloud installation is no problem, but that is not a solution once the installation is running in production.

Any ideas why this problem occurs, or how it can be fixed without data loss? Did I mis-configure something?

Container section of Nextcloud manifest:

containers:
  - name: nextcloud
    image: nextcloud:27.1.3-apache
    ports:
      - containerPort: 80
    volumeMounts:
      - name: nextcloud-volume
        mountPath: /var/www/html
    env:
      - name: POSTGRES_DB
        value: nextcloud
      - name: POSTGRES_USER
        value: nextcloud
      - name: POSTGRES_PASSWORD
        value: nextcloud
      - name: POSTGRES_HOST
        value: nextcloud-db
      - name: NEXTCLOUD_ADMIN_USER
        value: admin
      - name: NEXTCLOUD_ADMIN_PASSWORD
        value: admin
  - name: nextcloud-cron
    image: nextcloud:27.1.3-apache
    command:
      - /cron.sh
    volumeMounts:
      - name: nextcloud-volume
        mountPath: /var/www/html

Container section of postgres manifest:

containers:
  - name: nextcloud-db
    image: postgres:16.0
    ports:
      - containerPort: 5432
    env:
      - name: POSTGRES_USER
        value: nextcloud
      - name: POSTGRES_PASSWORD
        value: nextcloud
      - name: POSTGRES_DB
        value: nextcloud
    volumeMounts:
      - mountPath: /var/lib/postgresql
        subPath: data
        name: nextcloud-db

Thanks!

@joshtrichards
Copy link
Member

postgres seems to be corrupted, as it logs FATAL: password authentication failed for user "oc_admin" and Role "oc_admin" does not exist messages.
[...]
I had experienced this error once before after some misconfiguration of mounted config files, and could only fix it by deleting all volumes and starting fresh.

Hi @qworkz11 - Sorry you're running into trouble. This channel isn't a support forum - it's for reporting bugs in the image. As this sounds like a configuration matter, would you mind posting over at the Nextcloud Help Forum via https://help.nextcloud.com instead?

You might also find the community maintained Helm chart for Kubernetes of interest: https://github.com/nextcloud/helm/

P.S. For the record, I agree it does sound like your postgres server is messed up somehow. Check it's logs and maybe try to connect to it manually with psql (e.g. https://docs.nextcloud.com/server/27/admin_manual/configuration_database/linux_database_configuration.html#how-can-i-find-out-if-a-created-user-can-access-a-database).

@joshtrichards joshtrichards closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
@qworkz11
Copy link
Author

I see your point - thanks anyways!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants