-
Notifications
You must be signed in to change notification settings - Fork 269
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
/entrypoint.sh: line 192: php/conf.d/redis-session.ini: Permission denied for non-root container #187
Comments
Does this still happen today using the latest version of this helm chart? I know that config may always be owned by root, as per this issue, #335, however, I'm not sure that's related. You could try setting this: nextcloud:
podSecurityContext:
runAsUser: 33
runAsGroup: 33
runAsNonRoot: true
fsGroup: 33 However, that may already get set here: helm/charts/nextcloud/templates/deployment.yaml Lines 346 to 364 in ff07aac
Note: Since this issue was introduced, we've modified the available |
@jessebot Still having the issue when trying your YAML snippet. Also can't use the example from the chart's values.yaml as they are invalid values: helm/charts/nextcloud/values.yaml Lines 195 to 208 in 0b6bd84
Have to revert to last known working version, which for me is 3.5.19 of the chart. |
@jilleJr or @devent could you please provide your whole values.yaml after anonymizing any sensitive data?
Could you explain what you mean by invalid and where you're seeing the error? Those are the default values that are applied if you're using the non-alpine containers. |
Sure: values.yamlimage:
flavor: fpm
nginx:
enabled: true
resources:
requests:
memory: 10M
cpu: 5m
limits:
memory: 100M
cpu: 100m
redis:
enabled: true
architecture: standalone
auth:
enabled: true
password: ref+sops://secrets.yaml#redisPassword
master:
persistence:
enabled: false
requests:
memory: 10M
cpu: 10m
limits:
memory: 100M
cpu: 100m
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: letsencrypt
traefik.ingress.kubernetes.io/router.middlewares: nextcloud-nextcloud-replace-dav@kubernetescrd,nextcloud-nextcloud-replace-well-known@kubernetescrd,nextcloud-nextcloud-headers@kubernetescrd
tls:
- secretName: nextcloud-tls
hosts:
- XXXXXXXXXXXXXXXX
nextcloud:
host: XXXXXXXXXXXXXXXX
username: ref+sops://secrets.yaml#nextcloudUsername
password: ref+sops://secrets.yaml#nextcloudPassword
mail:
enabled: true
domain: ref+sops://secrets.yaml#emailDomain
smtp:
host: ref+sops://secrets.yaml#emailSmtpHostname
port: ref+sops://secrets.yaml#emailSmtpPort
secure: ssl
name: ref+sops://secrets.yaml#emailSmtpUsername
password: ref+sops://secrets.yaml#emailSmtpPassword
configs:
misc.config.php: |
<?php
$CONFIG = array(
'default_phone_region' => 'DE',
'music.lastfm_api_key' => getenv('LASTFM_API_KEY'),
'trusted_proxies' => array(
0 => '127.0.0.1',
1 => '10.0.0.0/8',
),
'trusted_domains' => array (
2 => 'XXXXXXXXXXXXXXXX',
),
);
extraEnv:
- name: LASTFM_API_KEY
valueFrom:
secretKeyRef:
key: LASTFM_API_KEY
name: nextcloud-extras
- name: PHP_MEMORY_LIMIT
value: 1024M
# Security context is broken in the Nexus chart:
# https://github.com/nextcloud/helm/issues/187
#securityContext:
# runAsUser: 33
# runAsGroup: 33
# runAsNonRoot: true
#podSecurityContext:
# fsGroup: 82
# fsGroupChangePolicy: OnRootMismatch
cronjob:
enabled: true
resources:
requests:
memory: 10M
cpu: 5m
limits:
memory: 100M
cpu: 100m
resources:
requests:
memory: 1500M
cpu: 100m
limits:
memory: 2000M
cpu: 1000m
persistence:
enabled: true
size: 30Gi
annotations:
helm.sh/resource-policy: keep
internalDatabase:
enabled: false
externalDatabase:
enabled: true
type: mysql
mariadb:
enabled: true
auth:
username: ref+sops://secrets.yaml#mariadbUsername
password: ref+sops://secrets.yaml#mariadbPassword
rootPassword: ref+sops://secrets.yaml#mariadbRootPassword
primary:
persistence:
enabled: true
annotations:
helm.sh/resource-policy: keep
resources:
requests:
memory: 300M
cpu: 30m
limits:
memory: 500M
cpu: 200m
volumePermissions:
enabled: true
metrics:
enabled: true
token: ref+sops://secrets.yaml#metricsToken
The Given that they're just copy-pasted from each other, I don't know how credible they are. |
will this ever be fixed? |
I updated my nextcloud docker installation to 27.1.3 today and it failed with this similar error. I am running non-root user as well. I found this thread: https://forums.unraid.net/topic/88504-support-knex666-nextcloud/page/20/ where robbenmu suggests that removing the redis config from the docker container makes it work. I tried that and it also worked for me (without disabling/removing the redis configuration in EDIT |
@provokateurin or @tvories Are you running redis and a non-root container? I see that this does indeed try to write to |
Any plans to make it work rootless? I am also failing for running nextcloud with redis enabled with a non-root user. Would really appreciate it, when there would be an option to run it rootless. |
@98jan can you please try asking in the upstream repo about this? This seems to be a nextcloud/docker issue. |
there is already an issue upstream.. and its more than 4 years old :D but the maintainers seems not to care about that |
Please be nice. I know you're all frustrated, but it's not that the maintainers dislike you or your particular GitHub Issue. We're unpaid volunteers that do this in our free time. I left a comment on that issue: nextcloud/docker#763 (comment) One of the contributors there suggested:
If we can figure out the occ command, I'm open to a PR to remove the ConfigMap and instead have a job that has post-install helm hook annotations to set the redis host that way. As long as it doesn't break anything, that seems like a win-win situation, yes? Update@stavros-k responded and helped us out by providing the scripts we need here:
Please feel free to test out the suggested solution and submit a PR. also, I played with the docker hooks feature a bit, but couldn't seem to get it to work? 🤔 you can see more details in nextcloud/docker#763 (comment) but until that's resolved (nextcloud/docker#2115), we still need to do this via a job with a helm hook rather than using the docker hooks feature. |
May I ask what's the altest on this ? Trying to use redis with my k3s deployment and it fails with the same error (i'm not even running it as nonRoot for now...) |
@R-Nabil, sorry for the extreme delay here, but this shouldn't occur for non-root usage. If it's still happening, could you please open a separate issue? |
Need to run a non-root container. I set the
securityContext
as following:Get the error:
Of course a non-root can not write to
/usr/local/etc/php/conf.d
Source https://github.com/nextcloud/docker/blob/master/22/apache/entrypoint.sh#L77
The text was updated successfully, but these errors were encountered: