Skip to content

nextcloud-cron does not work in OpenShift #733

Description

@antoinetran

Describe your Issue

In OpenShift kubernetes cluster, with restricted-v2 pod policy, the UID is within a range. The volume data belongs to the first UID of this range, instead of www-data, which will result in a permission error.

Logs and Errors

crond: USER www-data pid 333 cmd php -f /var/www/html/cron.php
crond: can't set groups: Operation not permitted
crond: USER www-data pid 337 cmd php -f /var/www/html/cron.php
crond: can't set groups: Operation not permitted
crond: USER www-data pid 341 cmd php -f /var/www/html/cron.php
crond: can't set groups: Operation not permitted
crond: USER www-data pid 342 cmd php -f /var/www/html/cron.php

Describe your Environment

  • Kubernetes distribution:
    OKD 4.15

  • Helm Version (or App that manages helm):

  • Helm Chart Version:
    nextcloud helm 6.6.7

  • values.yaml:

cronjob:
  #enabled: false
  enabled: true
  #securityContext: {}
  securityContext:
    runAsUser: null
    runAsGroup: null
    runAsNonRoot: true

Additional context, if any

Inside the container, some info:

1004080000@my-nextcloud-6b9695ccfb-spplh:/var/www/html$ id
uid=1004080000(1004080000) gid=0(root) groups=0(root),1004080000

1004080000@my-nextcloud-6b9695ccfb-spplh:/var/www/html$ ls -al /var/www/html/cron.php
-rw-r--r--. 1 1004080000 1004080000 7550 May 27 12:50 /var/www/html/cron.php

1004080000@my-nextcloud-6b9695ccfb-spplh:/var/www/html$ cat /etc/passwd | grep -e www-data -e 1004080000
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
1004080000:x:1004080000:0:1004080000 user:/:/sbin/nologin

1004080000@my-nextcloud-6b9695ccfb-spplh:/var/www/html$ cat /var/spool/cron/crontabs/www-data
*/5 * * * * php -f /var/www/html/cron.php

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions