Kimai - var/log not writable from webserver - causing error 500 on API #555

Closed
opened 2026-02-04 19:47:39 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @kernest on GitHub (Feb 26, 2025).

Have you read and understood the above guidelines?

yes

📜 What is the name of the script you are using?

Kimai

📂 What was the exact command used to execute the script?

bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/kimai.sh)"

📝 Provide a clear and concise description of the issue.

When trying to add a time registering and selecting the customer, I receive an Internal server error:

GET https://xxx.xxx.xx/api/projects?customer=3&visible=1&start=2025-02-25T21:41:00&end= 500 (Internal Server Error)

After running chmod -R 777 /opt/kimai/var/ it is working without any error.

So seems like the permissions needs to be added in the script (similar to this: https://github.com/kimai/kimai/issues/1601#issuecomment-606730636)

⚙️ What settings are you using?

  • Default Settings
  • Advanced Settings

🖥️ Which Linux distribution are you using?

Debian 12

🔄 Steps to reproduce the issue.

  1. Add a customer + project
  2. Add time registration
  3. Select customer
  4. Error 500 and no projects are found

Paste the full error output (if available).

"request_uri":"https://time.ernest.co/api/projects?customer=3&end=&start=2025-02-25T21%3A41%3A00&visible=1","method":"GET"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "e8ac525c14c13853e380eb41c0539227" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"e8ac525c14c13853e380eb41c0539227","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "02d44c00479af1305664b202edf2403e" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"02d44c00479af1305664b202edf2403e","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "8532caf8180e0ee8304ef9a929609890" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"8532caf8180e0ee8304ef9a929609890","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "dbe5e1c65e23d63634cfe2324b439372" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"dbe5e1c65e23d63634cfe2324b439372","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] INFO: Lock acquired, now computing item "configurations" {"key":"configurations"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "f7747fd002beacb997e1fd40a1f8cc43" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"f7747fd002beacb997e1fd40a1f8cc43","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "configurations" of type : fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied {"key":"configurations","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\FilesystemAdapter"} []
[2025-02-25 21:41:48] [cache] INFO: Lock acquired, now computing item "permissions" {"key":"permissions"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "2b0f4e8cfe29186a50229ec7d67fccd7" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"2b0f4e8cfe29186a50229ec7d67fccd7","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "permissions" of type : fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied {"key":"permissions","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\FilesystemAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "eff1334fedb96010051dece9d7242b99" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"eff1334fedb96010051dece9d7242b99","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "a732ba06e07a3bcbde86a9c5d024bece" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"a732ba06e07a3bcbde86a9c5d024bece","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [cache] WARNING: Failed to save key "652b1be3cf2e016c03f4e6cc3be1e1be" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"652b1be3cf2e016c03f4e6cc3be1e1be","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\Component\Cache\Adapter\PhpFilesAdapter"} []
[2025-02-25 21:41:48] [request] CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/opt/kimai/var/cache/prod/jms_serializer_default" is not writable." at FileCache.php line 49 {"exception":"[object] (InvalidArgumentException(code: 0): The directory "/opt/kimai/var/cache/prod/jms_serializer_default" is not writable. at /opt/kimai/vendor/jms/metadata/src/Cache/FileCache.php:49)"} []

🖼️ Additional context (optional).

No response

Originally created by @kernest on GitHub (Feb 26, 2025). ### ✅ Have you read and understood the above guidelines? yes ### 📜 What is the name of the script you are using? Kimai ### 📂 What was the exact command used to execute the script? bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/kimai.sh)" ### 📝 Provide a clear and concise description of the issue. When trying to add a time registering and selecting the customer, I receive an Internal server error: GET https://xxx.xxx.xx/api/projects?customer=3&visible=1&start=2025-02-25T21:41:00&end= 500 (Internal Server Error) After running chmod -R 777 /opt/kimai/var/ it is working without any error. So seems like the permissions needs to be added in the script (similar to this: https://github.com/kimai/kimai/issues/1601#issuecomment-606730636) ### ⚙️ What settings are you using? - [x] Default Settings - [ ] Advanced Settings ### 🖥️ Which Linux distribution are you using? Debian 12 ### 🔄 Steps to reproduce the issue. 1. Add a customer + project 2. Add time registration 3. Select customer 4. Error 500 and no projects are found ### ❌ Paste the full error output (if available). "request_uri":"https://time.ernest.co/api/projects?customer=3&end=&start=2025-02-25T21%3A41%3A00&visible=1","method":"GET"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "e8ac525c14c13853e380eb41c0539227" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"e8ac525c14c13853e380eb41c0539227","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "02d44c00479af1305664b202edf2403e" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"02d44c00479af1305664b202edf2403e","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "8532caf8180e0ee8304ef9a929609890" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"8532caf8180e0ee8304ef9a929609890","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "dbe5e1c65e23d63634cfe2324b439372" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"dbe5e1c65e23d63634cfe2324b439372","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] INFO: Lock acquired, now computing item "configurations" {"key":"configurations"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "f7747fd002beacb997e1fd40a1f8cc43" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"f7747fd002beacb997e1fd40a1f8cc43","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "configurations" of type : fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied {"key":"configurations","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter"} [] [2025-02-25 21:41:48] [cache] INFO: Lock acquired, now computing item "permissions" {"key":"permissions"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "2b0f4e8cfe29186a50229ec7d67fccd7" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"2b0f4e8cfe29186a50229ec7d67fccd7","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "permissions" of type : fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied {"key":"permissions","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/app/vl6nzGcpxe/elX2kal6): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "eff1334fedb96010051dece9d7242b99" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"eff1334fedb96010051dece9d7242b99","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "a732ba06e07a3bcbde86a9c5d024bece" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"a732ba06e07a3bcbde86a9c5d024bece","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [cache] WARNING: Failed to save key "652b1be3cf2e016c03f4e6cc3be1e1be" of type Doctrine\ORM\Query\ParserResult: fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied {"key":"652b1be3cf2e016c03f4e6cc3be1e1be","exception":"[object] (ErrorException(code: 0): fopen(/opt/kimai/var/cache/prod/pools/system/-zSvM4yc9c/BFwHvvj9): Failed to open stream: Permission denied at /opt/kimai/vendor/symfony/cache/Traits/FilesystemCommonTrait.php:95)","cache-adapter":"Symfony\\Component\\Cache\\Adapter\\PhpFilesAdapter"} [] [2025-02-25 21:41:48] [request] CRITICAL: Uncaught PHP Exception InvalidArgumentException: "The directory "/opt/kimai/var/cache/prod/jms_serializer_default" is not writable." at FileCache.php line 49 {"exception":"[object] (InvalidArgumentException(code: 0): The directory \"/opt/kimai/var/cache/prod/jms_serializer_default\" is not writable. at /opt/kimai/vendor/jms/metadata/src/Cache/FileCache.php:49)"} [] ### 🖼️ Additional context (optional). _No response_
OVERLORD added the bug label 2026-02-04 19:47:39 +03:00
Author
Owner

@michelroegl-brunner commented on GitHub (Feb 26, 2025):

Fix merged.

@michelroegl-brunner commented on GitHub (Feb 26, 2025): Fix merged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ProxmoxVE#555