Skip to content

Set Nextcloud cronjob securityContext to run as www-data#589

Open
mdnix wants to merge 1 commit intodevelopfrom
fix/nextcloud-cron
Open

Set Nextcloud cronjob securityContext to run as www-data#589
mdnix wants to merge 1 commit intodevelopfrom
fix/nextcloud-cron

Conversation

@mdnix
Copy link
Member

@mdnix mdnix commented Feb 13, 2026

Summary

The cronjob was failing because it runs as root (uid 0) but config.php is owned by www-data (uid 33):

Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33

On vanilla Kubernetes explicitly set runAsUser/runAsGroup to 33.
On OpenShift leave empty to let SCC handle UID assignment.

Ref: nextcloud/helm#740

Checklist

  • Update tests.
  • Link this PR to related issues.
  • Merge with /merge comment.

Component PR: vshn/component-appcat#1071

The cronjob was failing because it runs as root (uid 0) but config.php
is owned by www-data (uid 33):

Console has to be executed with the user that owns the file
config/config.php
Current user id: 0
Owner id of config.php: 33

On vanilla Kubernetes explicitly set runAsUser/runAsGroup to 33.
On OpenShift leave empty to let SCC handle UID assignment.

Ref: nextcloud/helm#740
@github-actions
Copy link
Contributor

@mdnix
Copy link
Member Author

mdnix commented Feb 13, 2026

Tested on:
Lab (Openshift) and Servala test (Talos)

"enabled": comp.GetInstances() > 0,
"type": "cronjob",
"cronjob": map[string]any{
"securityContext": cronjobSecurityContext,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that this won't have an impact and replace whatever the helm chart sets as default, if isOpenshift is true and therefore an empty map?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants