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

Deployment to rancher fails #1

Closed
neerdoc opened this issue May 26, 2021 · 4 comments
Closed

Deployment to rancher fails #1

neerdoc opened this issue May 26, 2021 · 4 comments

Comments

@neerdoc
Copy link
Contributor

neerdoc commented May 26, 2021

Trying to deploy the helm chart in a vanilla rancher installation.

  1. Added this repo as Chart Repository in rancher by adding https://robjuz.github.io/helm-charts/
  2. Tried deploying it totally vanilla. No changes to anything in the values.yaml.

This results for me in:

  • 4 secrets
  • 2 PVCs
  • 3 ConfigMaps
  • 2 Services
  • 2 Pods
  • 1 StatefulSet
  • 1 Deployment
    of which everything except the pod from the image kimai/kimai2:apache works.

kimai/kimai2:apache is in a "Crashloopback" state, and examining the logs it shows that during deployment, just after it connects to the database the first time, it tries to create a folder named /opt/kimai/var/cache/prod which fails 5 times with the same message: "In Kernel.php line 688: Unable to create the "cache" directory (/opt/kimai/var/cache/prod).". Next, it fails (which I assume is a follow-up problem) with the message: "/startup.sh: line 53: /opt/kimai/var/installed: Permission denied". It then states "Kimai2 ready" and goes into the Crashloopback state with continuing messages:

[Wed May 26 12:53:04.873550 2021] [php7:error] [pid 59] [client 10.42.4.1:39814] PHP Fatal error: Uncaught RuntimeException: Unable to create the "cache" directory (/opt/kimai/var/cache/prod). in /opt/kimai/vendor/symfony/http-kernel/Kernel.php:688\nStack trace:\n#0 /opt/kimai/vendor/symfony/http-kernel/Kernel.php(595): Symfony\\Component\\HttpKernel\\Kernel->buildContainer()\n#1 /opt/kimai/vendor/symfony/http-kernel/Kernel.php(136): Symfony\\Component\\HttpKernel\\Kernel->initializeContainer()\n#2 /opt/kimai/vendor/symfony/http-kernel/Kernel.php(196): Symfony\\Component\\HttpKernel\\Kernel->boot()\n#3 /opt/kimai/public/index.php(32): Symfony\\Component\\HttpKernel\\Kernel->handle()\n#4 {main}\n thrown in /opt/kimai/vendor/symfony/http-kernel/Kernel.php on line 688

Not sure where to start debugging...

@neerdoc
Copy link
Contributor Author

neerdoc commented May 26, 2021

Found something! Entering the container to check the permissions, it seems like the PVC is mounted correctly to /opt/kimai/var but is owned by root, whereas the user of the container is www-data, thus the "Permission denied."

Is it set somehow in the helm chart what the ownership of the PVCs are?

I checked the mariadb PVC for comparison, and the mount is still owned by root, but the group is set to 1001 and the group also has write permissions.

@robjuz
Copy link
Owner

robjuz commented May 26, 2021 via email

@robjuz
Copy link
Owner

robjuz commented May 26, 2021

@neerdoc please try again

@neerdoc
Copy link
Contributor Author

neerdoc commented May 27, 2021

That solved this issue! Thank you!

I can now follow the instructions in the "Release Notes" of the helm chart and connect to my fresh kimai2 installation! Great work!

I shall now continue and see if I can figure out how to leverage rancher's ingress (traefik by default) and let'sEncrypt certificates to access kimai externally.

@neerdoc neerdoc closed this as completed May 27, 2021
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

2 participants