Skip to content
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

Permission denied for laravel.log for snipeit #182

Open
yavorivanov-cw opened this issue Feb 21, 2023 · 3 comments
Open

Permission denied for laravel.log for snipeit #182

yavorivanov-cw opened this issue Feb 21, 2023 · 3 comments

Comments

@yavorivanov-cw
Copy link

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: [email protected]
        MAIL_FROM_ADDR: [email protected]
        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
Copy link
Contributor

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
Copy link

luciano-buono commented Mar 12, 2024

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:

  • NOW: I see that the file permissions are:
    -rw-r--r-- 1 docker staff 24K Mar 12 16:37 laravel.log
  • BEFORE:
    -rw-r--r-- 1 root root 24K Mar 12 16:37 laravel.log

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants