Nextcloud 29 on k3s, occ command not working in pod

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 29.0.0
Operating system and version (eg, Ubuntu 20.04): openSUSE 15.4, kubernetes 1.28.8+k3s1, Rancher 2.8.3
Apache or nginx version (eg, Apache 2.4.25): latest Docker Image
PHP version (eg, 7.4): latest Docker Image

The issue you are facing:

Hi, i have some warnings because of missing database indizies since the deployment of Nextcloud 29.0.0. In the description say´s that i have to use the command: occ db:add-missing-indices but it doesn´t work in the pod. The Instructions i found for using the occ command with for example: sudo -u www-data php occ … not working because of that there is no sudo package in the Nextcloud Image. External Access like docker exec does not work because of the pod run´s in kubernetes. So my question is, how can i fix the warning about missing database indizies in a kubernets enironment?

Thank you.

Best Regards
Bernd

Hi,

Inside pod, make sure you are root :

su

Then :

su -m www-data -c 'php occ blablabla'

Hi Noks,

thank you for the fast answer. I tried it but get the following Error:
root@nextcloud-7876695779-29pm2:/var/www/html# su -m www-data -c php occ db:add-missing-indices
This account is currently not available.

When i look into the passwd i see that the account is created but with the nologin Parameter.

Dont forget the ’

su -m www-data -c 'php occ db:add-missing-indices'

This account is currently not available.

When i look into the passwd i see that the account is created but with the nologin Parameter.

This is why we pass the “-m” option to su from root shell.

With the Single Quotes i get the same Error:

root@nextcloud-7876695779-29pm2:/var/www/html# su -m www-data -c ‘php occ db:add-missing-indices’
This account is currently not available.

Weird i have the same nextcloud in k3s as you and this is working fine :

# su
root@nextcloud-nc-7d85d599c8-xcf8p:/var/www/html# su -m www-data -c 'php occ db:add-missing-indices'
root@nextcloud-nc-7d85d599c8-xcf8p:/var/www/html#

I don’t know what to say sorry :confused:

No Problem, thanks you for your help.

I found the Problem. I had to enable the www-data User for Login. So simple, but when you think in the wrong way you don`t see the simplest errors. :smiley: