nextcloud / helm

A community maintained helm chart for deploying Nextcloud on Kubernetes.
GNU Affero General Public License v3.0
330 stars 268 forks source link

Environment not properly prepared #220

Open lucasscheepers opened 2 years ago

lucasscheepers commented 2 years ago

I'm trying to deploy Nextcloud using Helm. First I tried it on my local machine (MacOS Big Sur) using Minikube (Kubernetes 1.21) and it was up and running in 5 minutes.. Unfortunately it will not succeed at work. I'm using there CentOS7 to eventually deploy Nextcloud on a Kubernetes cluster 1.21.

The error I retrieve: Environment not properly prepared in /var/www/html/lib/private/Console/Application.php:162. See image below: Screenshot 2022-04-01 at 13 32 08

My values.yml file looks like this:

## Official nextcloud image version
## ref: https://hub.docker.com/r/library/nextcloud/tags/
##
image:
  repository: nextcloud
  tag: 23.0.2-apache
  pullPolicy: IfNotPresent
  # pullSecrets:
  #   - myRegistrKeySecretName

nameOverride: ""
fullnameOverride: ""
podAnnotations: {}
deploymentAnnotations: {}

# Number of replicas to be deployed
replicaCount: 1

secuurityContext:
  runAsUser: 33
  runAsGroup: 33
  runAsNonRoot: true

## Allowing use of ingress controllers
## ref: https://kubernetes.io/docs/concepts/services-networking/ingress/
##
ingress:
  enabled: false
  # className: nginx
  annotations: {}
  #  nginx.ingress.kubernetes.io/proxy-body-size: 4G
  #  kubernetes.io/tls-acme: "true"
  #  cert-manager.io/cluster-issuer: letsencrypt-prod
  #  nginx.ingress.kubernetes.io/server-snippet: |-
  #    server_tokens off;
  #    proxy_hide_header X-Powered-By;

  #    rewrite ^/.well-known/webfinger /public.php?service=webfinger last;
  #    rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
  #    rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json;
  #    location = /.well-known/carddav {
  #      return 301 $scheme://$host/remote.php/dav;
  #    }
  #    location = /.well-known/caldav {
  #      return 301 $scheme://$host/remote.php/dav;
  #    }
  #    location = /robots.txt {
  #      allow all;
  #      log_not_found off;
  #      access_log off;
  #    }
  #    location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ {
  #      deny all;
  #    }
  #    location ~ ^/(?:autotest|occ|issue|indie|db_|console) {
  #      deny all;
  #    }
  # tls:
  #   - secretName: nextcloud-tls
  #     hosts:
  #       - nextcloud.kube.home
  labels: {}
  path: /
  pathType: Prefix

# Allow configuration of lifecycle hooks
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/
lifecycle: {}
  # postStartCommand: []
  # preStopCommand: []

phpClientHttpsFix:
  enabled: false
  protocol: https

nextcloud:
  host: nextcloud.kube.home
  username: admin
  password: changeme
  ## Use an existing secret
  existingSecret:
    enabled: false
    # secretName: nameofsecret
    # usernameKey: username
    # passwordKey: password
    # tokenKey: serverinfo_token
    # smtpUsernameKey: smtp_username
    # smtpPasswordKey: smtp_password
  update: 0
  # If web server is not binding default port, you can define it
  # containerPort: 8080
  datadir: /var/www/html/data
  persistence:
    subPath:
  mail:
    enabled: false
    fromAddress: user
    domain: domain.com
    smtp:
      host: domain.com
      secure: ssl
      port: 465
      authtype: LOGIN
      name: user
      password: pass
  # PHP Configuration files
  # Will be injected in /usr/local/etc/php/conf.d for apache image and in /usr/local/etc/php-fpm.d when nginx.enabled: true
  phpConfigs: {}
  # Default config files
  # IMPORTANT: Will be used only if you put extra configs, otherwise default will come from nextcloud itself
  # Default confgurations can be found here: https://github.com/nextcloud/docker/tree/master/16.0/apache/config
  defaultConfigs:
    # To protect /var/www/html/config
    .htaccess: true
    # Redis default configuration
    redis.config.php: true
    # Apache configuration for rewrite urls
    apache-pretty-urls.config.php: true
    # Define APCu as local cache
    apcu.config.php: true
    # Apps directory configs
    apps.config.php: true
    # Used for auto configure database
    autoconfig.php: true
    # SMTP default configuration
    smtp.config.php: true
  # Extra config files created in /var/www/html/config/
  # ref: https://docs.nextcloud.com/server/15/admin_manual/configuration_server/config_sample_php_parameters.html#multiple-config-php-file
  configs: {}

  # For example, to use S3 as primary storage
  # ref: https://docs.nextcloud.com/server/13/admin_manual/configuration_files/primary_storage.html#simple-storage-service-s3
  #
  #  configs:
  #    s3.config.php: |-
  #      <?php
  #      $CONFIG = array (
  #        'objectstore' => array(
  #          'class' => '\\OC\\Files\\ObjectStore\\S3',
  #          'arguments' => array(
  #            'bucket'     => 'my-bucket',
  #            'autocreate' => true,
  #            'key'        => 'xxx',
  #            'secret'     => 'xxx',
  #            'region'     => 'us-east-1',
  #            'use_ssl'    => true
  #          )
  #        )
  #      );

  ## Strategy used to replace old pods
  ## IMPORTANT: use with care, it is suggested to leave as that for upgrade purposes
  ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
  strategy:
    type: Recreate
    # type: RollingUpdate
    # rollingUpdate:
    #   maxSurge: 1
    #   maxUnavailable: 0

  ##
  ## Extra environment variables
  extraEnv:
  #  - name: SOME_SECRET_ENV
  #    valueFrom:
  #      secretKeyRef:
  #        name: nextcloud
  #        key: secret_key

  # Extra mounts for the pods. Example shown is for connecting a legacy NFS volume
  # to NextCloud pods in Kubernetes. This can then be configured in External Storage
  extraVolumes:
  #  - name: nfs
  #    nfs:
  #      server: "10.0.0.1"
  #      path: "/nextcloud_data"
  #      readOnly: false
  extraVolumeMounts:
  #  - name: nfs
  #    mountPath: "/legacy_data"

  # Extra secuurityContext parameters. For example you may need to define runAsNonRoot directive
  # extraSecurityContext:
  #   runAsUser: "33"
  #   runAsGroup: "33"
  #   runAsNonRoot: true
  #   readOnlyRootFilesystem: true

nginx:
  ## You need to set an fpm version of the image for nextcloud if you want to use nginx!
  enabled: false
  image:
    repository: nginx
    tag: alpine
    pullPolicy: IfNotPresent

  config:
    # This generates the default nginx config as per the nextcloud documentation
    default: true
    # custom: |-
    #     worker_processes  1;..

  resources: {}

internalDatabase:
  enabled: true
  name: nextcloud

##
## External database configuration
##
externalDatabase:
  enabled: false

  ## Supported database engines: mysql or postgresql
  type: mysql

  ## Database host
  host:

  ## Database user
  user: nextcloud

  ## Database password
  password:

  ## Database name
  database: nextcloud

  ## Use a existing secret
  existingSecret:
    enabled: false
    # secretName: nameofsecret
    # usernameKey: username
    # passwordKey: password

##
## MariaDB chart configuration
##
mariadb:
  ## Whether to deploy a mariadb server to satisfy the applications database requirements. To use an external database set this to false and configure the externalDatabase parameters
  enabled: false

  auth:
    database: nextcloud
    username: nextcloud
    password: changeme

  architecture: standalone

  ## Enable persistence using Persistent Volume Claims
  ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
  ##
  primary:
    persistence:
      enabled: false
      # storageClass: ""
      accessMode: ReadWriteOnce
      size: 8Gi

##
## PostgreSQL chart configuration
## for more options see https://github.com/bitnami/charts/tree/master/bitnami/postgresql
##
postgresql:
  enabled: false
  postgresqlUsername: nextcloud
  postgresqlPassword: changeme
  postgresqlDatabase: nextcloud
  persistence:
    enabled: false
    # storageClass: ""

##
## Redis chart configuration
## for more options see https://github.com/bitnami/charts/tree/master/bitnami/redis
##

redis:
  enabled: false
  auth:
    enabled: true
    password: 'changeme'

## Cronjob to execute Nextcloud background tasks
## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron
##
cronjob:
  enabled: false
  # Nexcloud image is used as default but only curl is needed
  image: {}
    # repository: nextcloud
    # tag: 16.0.3-apache
    # pullPolicy: IfNotPresent
    # pullSecrets:
    #   - myRegistrKeySecretName
  # Every 5 minutes
  # Note: Setting this to any any other value than 5 minutes might
  #  cause issues with how nextcloud background jobs are executed
  schedule: "*/5 * * * *"
  annotations: {}
  # Set curl's insecure option if you use e.g. self-signed certificates
  curlInsecure: false
  failedJobsHistoryLimit: 5
  successfulJobsHistoryLimit: 2
  # If not set, nextcloud deployment one will be set
  # resources:
    # We usually recommend not to specify default resources and to leave this as a conscious
    # choice for the user. This also increases chances charts run on environments with little
    # resources, such as Minikube. If you do want to specify resources, uncomment the following
    # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
    # limits:
    #  cpu: 100m
    #  memory: 128Mi
    # requests:
    #  cpu: 100m
    #  memory: 128Mi

  # If not set, nextcloud deployment one will be set
  # nodeSelector: {}

  # If not set, nextcloud deployment one will be set
  # tolerations: []

  # If not set, nextcloud deployment one will be set
  # affinity: {}

service:
  type: ClusterIP
  port: 8080
  loadBalancerIP: nil
  nodePort: nil

## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
  # Nextcloud Data (/var/www/html)
  enabled: false
  annotations: {}
  ## nextcloud data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS & OpenStack)
  ##
  # storageClass: "-"

  ## A manually managed Persistent Volume and Claim
  ## Requires persistence.enabled: true
  ## If defined, PVC must be created manually before volume will be bound
  # existingClaim:

  accessMode: ReadWriteOnce
  size: 8Gi

  ## Use an additional pvc for the data directory rather than a subpath of the default PVC
  ## Useful to store data on a different storageClass (e.g. on slower disks)
  nextcloudData:
    enabled: false
    subPath:
    annotations: {}
    # storageClass: "-"
    # existingClaim:
    accessMode: ReadWriteOnce
    size: 8Gi

resources: {}
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  # limits:
  #  cpu: 100m
  #  memory: 128Mi
  # requests:
  #  cpu: 100m
  #  memory: 128Mi

## Liveness and readiness probe values
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
##
livenessProbe:
  enabled: true
  initialDelaySeconds: 10
  periodSeconds: 10
  timeoutSeconds: 5
  failureThreshold: 3
  successThreshold: 1
readinessProbe:
  enabled: true
  initialDelaySeconds: 10
  periodSeconds: 10
  timeoutSeconds: 5
  failureThreshold: 3
  successThreshold: 1
startupProbe:
  enabled: false
  initialDelaySeconds: 30
  periodSeconds: 10
  timeoutSeconds: 5
  failureThreshold: 30
  successThreshold: 1

## Enable pod autoscaling using HorizontalPodAutoscaler
## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
##
hpa:
  enabled: false
  cputhreshold: 60
  minPods: 1
  maxPods: 10

nodeSelector: {}

tolerations: []

affinity: {}

## Prometheus Exporter / Metrics
##
metrics:
  enabled: false

  replicaCount: 1
  # The metrics exporter needs to know how you serve Nextcloud either http or https
  https: false
  # Use API token if set, otherwise fall back to password authentication
  # https://github.com/xperimental/nextcloud-exporter#token-authentication
  # Currently you still need to set the token manually in your nextcloud install
  token: ""
  timeout: 5s

  image:
    repository: xperimental/nextcloud-exporter
    tag: 0.5.0
    pullPolicy: IfNotPresent

  ## Metrics exporter resource requests and limits
  ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
  ##
  # resources: {}

  ## Metrics exporter pod Annotation and Labels
  # podAnnotations: {}

  # podLabels: {}

  service:
    type: ClusterIP
    ## Use serviceLoadBalancerIP to request a specific static IP,
    ## otherwise leave blank
    # loadBalancerIP:
    annotations:
      prometheus.io/scrape: "true"
      prometheus.io/port: "9205"
    labels: {}

rbac:
  enabled: false
  serviceaccount:
    create: true
    name: nextcloud-serviceaccount

Has this something to do with some config.php files I need to add?

jessebot commented 1 year ago

Hoi!

I haven't actually seen this before, but others can chime in if they have. Could you test again with the current nextcloud helm chart version and values.yaml?

It looks like you're using 23.0.2-apache for your docker tag there, and we're currently on 25.0.3-apache. (We need to update the commented image.tag param in values.yaml, but so you know, the template is configured to use the chart appVersion here: https://github.com/nextcloud/helm/blob/master/charts/nextcloud/Chart.yaml#L4)

It also looks like you're using securityContext which is now deprecated in favor of nextcloud.securityContext (for the nextcloud container) and nextcloud.podSecurityContext (for all containers in the nextcloud pod) which you can read more about here in the README and here: https://github.com/nextcloud/helm/pull/269

If you're still having the issue, I might ask that you enable a more verbose logging level with the following:

  nextcloud:
    configs:
      # Log Levels: 0=DEBUG, 1=INFO, 2=WARN, 3=ERROR, 4=FATAL
      logging.config.php: |-
        <?php
        $CONFIG = array (
          'log_type' => 'file',
          'logfile' => 'nextcloud.log',
          'loglevel' => 2,
          'logdateformat' => 'F d, Y H:i:s'
          );

Logging is explained a bit further here But you should be able to check the log from within the pod, and paste it back here.

Let me know if you have further questions! :)

jessebot commented 1 year ago

Can you also try on k3s or kind?

jessebot commented 3 months ago

Closing, as this Issue hasn't had activity in over a year, and I can't seem to reproduce it. If you, or anyone else in the community, is still having issues on the latest version of the helm chart (and Kubernetes), please feel free to open a new issue and we're happy to help you out. :) Kind regards!

joelmccoy commented 1 week ago

I seem to be running into this issue as well.

Chart version: 6.1.0 Image: nextcloud:28.0.11-apache

Non-default values:

nextcloud:
  host: "nextcloud.my.domain"
  trustedDomains:
    - "nextcloud.my.domain"
    - "nextcloud.nextcloud.svc.cluster.local"
  configs:
    logging.config.php: |-
      <?php
      $CONFIG = array (
        'log_type' => 'file',
        'logfile' => 'nextcloud.log',
        'loglevel' => 0,
        'logdateformat' => 'F d, Y H:i:s'
        );
    custom-overwrite.config.php: |-
      <?php
      $CONFIG = array (
        'overwrite.cli.url' => 'https://nextcloud.nextcloud.svc.cluster.local',
        'overwriteprotocol' => 'https',
      );
    proxy.config.php: |-
      <?php
      $CONFIG = array (
        'trusted_proxies' => array(
          0 => '127.0.0.1',
          1 => '10.0.0.0/8',
        ),
        'forwarded_for_headers' => array('HTTP_X_FORWARDED_FOR'),
      );
  securityContext:
    runAsUser: 33
    runAsGroup: 33
    runAsNonRoot: true
    readOnlyRootFilesystem: false

persistence:
  enabled: true

Pod logs:

nextcloud Warning: /var/www/html/config/apache-pretty-urls.config.php differs from the latest version of this image at /usr/src/nextcloud/config/apache-pretty-urls.config.php     
nextcloud Warning: /var/www/html/config/apcu.config.php differs from the latest version of this image at /usr/src/nextcloud/config/apcu.config.php                                 
nextcloud Warning: /var/www/html/config/apps.config.php differs from the latest version of this image at /usr/src/nextcloud/config/apps.config.php                                 
nextcloud Warning: /var/www/html/config/redis.config.php differs from the latest version of this image at /usr/src/nextcloud/config/redis.config.php                              
nextcloud Warning: /var/www/html/config/reverse-proxy.config.php differs from the latest version of this image at /usr/src/nextcloud/config/reverse-proxy.config.php              
nextcloud Warning: /var/www/html/config/s3.config.php differs from the latest version of this image at /usr/src/nextcloud/config/s3.config.php                                     
nextcloud Warning: /var/www/html/config/smtp.config.php differs from the latest version of this image at /usr/src/nextcloud/config/smtp.config.php                                
nextcloud Warning: /var/www/html/config/swift.config.php differs from the latest version of this image at /usr/src/nextcloud/config/swift.config.php                              
nextcloud Warning: /var/www/html/config/upgrade-disable-web.config.php differs from the latest version of this image at /usr/src/nextcloud/config/upgrade-disable-web.config.php   

nextcloud => Searching for scripts (*.sh) to run, located in the folder: /docker-entrypoint-hooks.d/before-starting                                                                

nextcloud AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.42.0.64. Set the 'ServerName' directive globally to suppress this message
nextcloud AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.42.0.64. Set the 'ServerName' directive globally to suppress this message

nextcloud [Sun Oct 20 20:19:09.925064 2024] [mpm_prefork:notice] [pid 1:tid 1] AH00163: Apache/2.4.62 (Debian) PHP/8.2.24 configured -- resuming normal operations                 
nextcloud [Sun Oct 20 20:19:09.925084 2024] [core:notice] [pid 1:tid 1] AH00094: Command line: 'apache2 -D FOREGROUND'                                                             

nextcloud 127.0.0.6 - - [20/Oct/2024:20:19:28 +0000] "GET /status.php HTTP/1.1" 503 3595 "-" "kube-probe/1.30"                                                                     
nextcloud 127.0.0.6 - - [20/Oct/2024:20:19:28 +0000] "GET /status.php HTTP/1.1" 503 3601 "-" "kube-probe/1.30"

A tail of nextcloud logs

{"reqId":"gnO0EfL6P5Odq2fyN9vq","level":1,"time":"October 20, 2024 20:20:58","remoteAddr":"127.0.0.6","user":"--","app":"no app in context","method":"GET","url":"/status.php","message":"Unable to generate a URL for the named route \"files.view.index\" as such route does not exist.","userAgent":"kube-probe/1.30","version":"28.0.11.1","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"files.view.index\" as such route does not exist.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Route/Router.php","line":380,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["files.view.index",[],1]},{"file":"/var/www/html/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["files.view.index",[],false]},{"file":"/var/www/html/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->","args":["files.view.index",[]]},{"file":"/var/www/html/lib/private/NavigationManager.php","line":374,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["files.view.index"]},{"file":"/var/www/html/lib/private/NavigationManager.php","line":131,"function":"init","class":"OC\\NavigationManager","type":"->","args":[]},{"file":"/var/www/html/apps/theming/lib/ThemingDefaults.php","line":199,"function":"getAll","class":"OC\\NavigationManager","type":"->","args":["guest"]},{"file":"/var/www/html/lib/private/legacy/OC_Defaults.php","line":271,"function":"getShortFooter","class":"OCA\\Theming\\ThemingDefaults","type":"->","args":[]},{"file":"/var/www/html/lib/public/Defaults.php","line":176,"function":"getLongFooter","class":"OC_Defaults","type":"->","args":[]},{"file":"/var/www/html/core/templates/layout.guest.php","line":51,"function":"getLongFooter","class":"OCP\\Defaults","type":"->","args":[]},{"file":"/var/www/html/lib/private/Template/Base.php","line":180,"args":["/var/www/html/core/templates/layout.guest.php"],"function":"include"},{"file":"/var/www/html/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\\Template\\Base","type":"->","args":["/var/www/html/core/templates/layout.guest.php",null]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":139,"function":"fetchPage","class":"OC\\Template\\Base","type":"->","args":[null]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":170,"function":"fetchPage","class":"OC_Template","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":232,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"/var/www/html/lib/base.php","line":722,"function":"printGuestPage","class":"OC_Template","type":"::","args":["","error",[[["Your data directory is readable by other users.","Please change the permissions to 0770 so that the directory cannot be listed by other users."]]]]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/status.php","line":37,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":144,"message":"Unable to generate a URL for the named route \"files.view.index\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"files.view.index\" as such route does not exist."}}
{"reqId":"wD3VWCwYBChc6xNX8mPq","level":1,"time":"October 20, 2024 20:20:58","remoteAddr":"127.0.0.6","user":"--","app":"no app in context","method":"GET","url":"/status.php","message":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist.","userAgent":"kube-probe/1.30","version":"28.0.11.1","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Route/Router.php","line":380,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["photos.page.index",[],1]},{"file":"/var/www/html/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["photos.page.index",[],false]},{"file":"/var/www/html/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->","args":["photos.page.index",[]]},{"file":"/var/www/html/lib/private/NavigationManager.php","line":374,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["photos.page.index"]},{"file":"/var/www/html/lib/private/NavigationManager.php","line":131,"function":"init","class":"OC\\NavigationManager","type":"->","args":[]},{"file":"/var/www/html/apps/theming/lib/ThemingDefaults.php","line":199,"function":"getAll","class":"OC\\NavigationManager","type":"->","args":["guest"]},{"file":"/var/www/html/lib/private/legacy/OC_Defaults.php","line":271,"function":"getShortFooter","class":"OCA\\Theming\\ThemingDefaults","type":"->","args":[]},{"file":"/var/www/html/lib/public/Defaults.php","line":176,"function":"getLongFooter","class":"OC_Defaults","type":"->","args":[]},{"file":"/var/www/html/core/templates/layout.guest.php","line":51,"function":"getLongFooter","class":"OCP\\Defaults","type":"->","args":[]},{"file":"/var/www/html/lib/private/Template/Base.php","line":180,"args":["/var/www/html/core/templates/layout.guest.php"],"function":"include"},{"file":"/var/www/html/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\\Template\\Base","type":"->","args":["/var/www/html/core/templates/layout.guest.php",null]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":139,"function":"fetchPage","class":"OC\\Template\\Base","type":"->","args":[null]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":170,"function":"fetchPage","class":"OC_Template","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":232,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"/var/www/html/lib/base.php","line":722,"function":"printGuestPage","class":"OC_Template","type":"::","args":["","error",[[["Your data directory is readable by other users.","Please change the permissions to 0770 so that the directory cannot be listed by other users."]]]]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/status.php","line":37,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":144,"message":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist."}}
{"reqId":"gnO0EfL6P5Odq2fyN9vq","level":1,"time":"October 20, 2024 20:20:58","remoteAddr":"127.0.0.6","user":"--","app":"no app in context","method":"GET","url":"/status.php","message":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist.","userAgent":"kube-probe/1.30","version":"28.0.11.1","exception":{"Exception":"Symfony\\Component\\Routing\\Exception\\RouteNotFoundException","Message":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Route/Router.php","line":380,"function":"generate","class":"Symfony\\Component\\Routing\\Generator\\UrlGenerator","type":"->","args":["photos.page.index",[],1]},{"file":"/var/www/html/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\\Route\\Router","type":"->","args":["photos.page.index",[],false]},{"file":"/var/www/html/lib/private/URLGenerator.php","line":103,"function":"generate","class":"OC\\Route\\CachingRouter","type":"->","args":["photos.page.index",[]]},{"file":"/var/www/html/lib/private/NavigationManager.php","line":374,"function":"linkToRoute","class":"OC\\URLGenerator","type":"->","args":["photos.page.index"]},{"file":"/var/www/html/lib/private/NavigationManager.php","line":131,"function":"init","class":"OC\\NavigationManager","type":"->","args":[]},{"file":"/var/www/html/apps/theming/lib/ThemingDefaults.php","line":199,"function":"getAll","class":"OC\\NavigationManager","type":"->","args":["guest"]},{"file":"/var/www/html/lib/private/legacy/OC_Defaults.php","line":271,"function":"getShortFooter","class":"OCA\\Theming\\ThemingDefaults","type":"->","args":[]},{"file":"/var/www/html/lib/public/Defaults.php","line":176,"function":"getLongFooter","class":"OC_Defaults","type":"->","args":[]},{"file":"/var/www/html/core/templates/layout.guest.php","line":51,"function":"getLongFooter","class":"OCP\\Defaults","type":"->","args":[]},{"file":"/var/www/html/lib/private/Template/Base.php","line":180,"args":["/var/www/html/core/templates/layout.guest.php"],"function":"include"},{"file":"/var/www/html/lib/private/Template/Base.php","line":150,"function":"load","class":"OC\\Template\\Base","type":"->","args":["/var/www/html/core/templates/layout.guest.php",null]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":139,"function":"fetchPage","class":"OC\\Template\\Base","type":"->","args":[null]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":170,"function":"fetchPage","class":"OC_Template","type":"->","args":[null]},{"file":"/var/www/html/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"/var/www/html/lib/private/legacy/OC_Template.php","line":232,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"/var/www/html/lib/base.php","line":722,"function":"printGuestPage","class":"OC_Template","type":"::","args":["","error",[[["Your data directory is readable by other users.","Please change the permissions to 0770 so that the directory cannot be listed by other users."]]]]},{"file":"/var/www/html/lib/base.php","line":1200,"function":"init","class":"OC","type":"::","args":[]},{"file":"/var/www/html/status.php","line":37,"args":["/var/www/html/lib/base.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":144,"message":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist.","exception":{},"CustomMessage":"Unable to generate a URL for the named route \"photos.page.index\" as such route does not exist."}}

Shelling into pod and trying to run this command:

php occ config:system:get trusted_domains
Your data directory is readable by other users.
Please change the permissions to 0770 so that the directory cannot be listed by other users.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/html/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/html/console.php(99): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/occ(11): require_once('/var/www/html/c...')

Also found these errors higher up in the nextcloud logs:

{"reqId":"iVAu4uD2V2SKHyFDDnyl","level":3,"time":"October 19, 2024 21:48:41","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"chmod(): Operation not permitted at /var/www/html/lib/private/legacy/OC_Util.php#737","userAgent":"--","version":"28.0.11.1","data":{"app":"PHP"}}
{"reqId":"4IGZxGfLWeMQbfJB8FyF","level":3,"time":"October 19, 2024 21:48:56","remoteAddr":"127.0.0.6","user":"--","app":"PHP","method":"GET","url":"/status.php","message":"chmod(): Operation not permitted at /var/www/html/lib/private/legacy/OC_Util.php#737","userAgent":"kube-probe/1.30","version":"28.0.11.1","data":{"app":"PHP"}}
{"reqId":"bsYlvzXgthoz6NaAayh9","level":3,"time":"October 19, 2024 21:48:56","remoteAddr":"127.0.0.6","user":"--","app":"PHP","method":"GET","url":"/status.php","message":"chmod(): Operation not permitted at /var/www/html/lib/private/legacy/OC_Util.php#737","userAgent":"kube-probe/1.30","version":"28.0.11.1","data":{"app":"PHP"}}

I need to be able to run this container as nonroot. Any ideas what is going on here or what I could look into?

joelmccoy commented 1 week ago

Adding this allowed me to get the pod to startup correctly:

    custom.config.php: |
      <?php
        $CONFIG = array(
          'check_data_directory_permissions' => false, # https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/
        );

But the underlying issue seems to be related to: #335