server
server copied to clipboard
Permission issue when running with docker-compose
When just using the provided docker compose in the repository root, there seems to be a permission issue
Steps:
docker-compose build
docker-compose up
After the Hashtopolis installation is done, when trying to register a new agent, it results in a internal server error when registering an agent:
[Mon Aug 22 12:24:16.016214 2022] [php:error] [pid 34] [client 172.18.0.1:46202] PHP Fatal error: Uncaught Exception: Could not open lockfile '/var/www/html/inc/utils/locks/log.lock'! in /var/www/html/inc/utils/Lock.class.php:19
Stack trace:
#0 /var/www/html/inc/utils/LockUtils.class.php(17): Lock->__construct()
#1 /var/www/html/inc/defines/log.php(14): LockUtils::get()
#2 /var/www/html/inc/api/APIRegisterAgent.class.php(40): DServerLog::log()
#3 /var/www/html/api/server.php(141): APIRegisterAgent->execute()
#4 {main}\n thrown in /var/www/html/inc/utils/Lock.class.php on line 19
It seems that in the source directory, the permissions are not proper, even though the owner in the Dockerfile COPY command is set (COPY --chown=www-data:www-data ./src/ /var/www/html/).