t3n / helm-charts

Helm charts
MIT License
73 stars 85 forks source link

Permission denied for laravel.log for snipeit #182

Open yavorivanov-cw opened 1 year ago

yavorivanov-cw commented 1 year ago

We are trying to install snipeit with helm on our k8s cluster but we are getting the following error: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied

Our values.yaml :

replicaCount: 1

  config:
    snipeit:
      env: production
      url: example.at
      timezone: Europe/Vienna
      locale: en
      envConfig:
        MAIL_HOST: mail.example.at
        MAIL_PORT: 587
        MAIL_USERNAME: snipeit@example.at
        MAIL_FROM_ADDR: snipeit@example.at
        MAIL_FROM_NAME: Snipe-IT

  mysql:
    enabled: true
    mysqlUser: example
    mysqlDatabase: example
    persistence:
      enabled: true
      storageClass: "ceph-filesystem"
      accessMode: ReadWriteOnce
      size: 2Gi

  persistence:
    enabled: true
    storageClass: "ceph-filesystem"
    accessMode: ReadWriteOnce
    size: 2Gi
    annotations: { "helm.sh/resource-policy": keep }

  revisionHistoryLimit: 4

  service:
    type: ClusterIP

  ingress: 
    enabled: false

Our Chart.yaml

...
dependencies:
  - name: snipeit
    version: 3.4.0
    repository: https://storage.googleapis.com/t3n-helm-charts

One workaround is to do chmod 777 storage/logs/laravel.log on fresh install but after that is almost impossible to do.

mschmidt291 commented 1 year ago

Hi @yavorivanov-cw I just installed the Helm Chart in version 3.4.0 on empty k8s cluster and I can't see a message similiar to yours. Could you perhaps elaborate if you see the error in the pod-logs of the snipeit container?

I can only imagine it could be because of using ceph, maybe the default permissions are handled differently unless specified?

luciano-buono commented 6 months ago

Hi I'm also facing the same issue with accesing the laravel.log file using default helm chart configs.

Only thing I'm thinking, I'm on ARM infra, so maybe there is a change there?


EDIT: I'm not sure what changed, but now the pod is starting normally.

What changed:

What I suspect is that the initContainer/PVC were messing with the permissions somehow, I removed the initContainer and then everything started working. After I added it back and it kept on working

yavorivanov-cw commented 6 months ago

Hi @yavorivanov-cw I just installed the Helm Chart in version 3.4.0 on empty k8s cluster and I can't see a message similiar to yours. Could you perhaps elaborate if you see the error in the pod-logs of the snipeit container?

I can only imagine it could be because of using ceph, maybe the default permissions are handled differently unless specified?

Hi, we created our own chart and it is working since then, tbh I am not sure anymore what we changed, but we still use ceph