Open miltonh26 opened 2 years ago
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Ran the same docker-compose on a Fedora VM and it too had the same error. Here is the docker-compose log output:
$ docker-compose logs -f Attaching to snipe-it_snipe-it_2_1, snipe-mysql snipe-it_2_1 | Module ssl disabled. snipe-it_2_1 | To activate the new configuration, you need to run: snipe-it_2_1 | service apache2 restart snipe-it_2_1 | snipe-it_2_1 | Illuminate\Database\QueryException snipe-it_2_1 | snipe-it_2_1 | SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known (SQL: select * from information_schema.tables where table_schema = snipeit and table_name = migrations and table_type = 'BASE TABLE') snipe-it_2_1 | snipe-it_2_1 | at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712 snipe-it_2_1 | 708▕ // If an exception occurs when attempting to run a query, we'll format the error snipe-it_2_1 | 709▕ // message to include the bindings with SQL, which will make this exception a snipe-it_2_1 | 710▕ // lot more helpful to the developer instead of just the database's errors. snipe-it_2_1 | 711▕ catch (Exception $e) { snipe-it_2_1 | ➜ 712▕ throw new QueryException( snipe-it_2_1 | 713▕ $query, $this->prepareBindings($bindings), $e snipe-it_2_1 | 714▕ ); snipe-it_2_1 | 715▕ } snipe-it_2_1 | 716▕ } snipe-it_2_1 | snipe-it_2_1 | +36 vendor frames snipe-it_2_1 | 37 artisan:35 snipe-it_2_1 | Illuminate\Foundation\Console\Kernel::handle() snipe-it_2_1 | Configuration cache cleared! snipe-it_2_1 | Configuration cache cleared! snipe-it_2_1 | Configuration cached successfully! snipe-it_2_1 | 2022-08-25 01:10:18,011 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. snipe-it_2_1 | 2022-08-25 01:10:18,015 INFO supervisord started with pid 1 snipe-it_2_1 | 2022-08-25 01:10:19,017 INFO spawned: 'exit_on_any_fatal' with pid 56 snipe-it_2_1 | 2022-08-25 01:10:19,027 INFO spawned: 'apache' with pid 57 snipe-it_2_1 | 2022-08-25 01:10:19,039 INFO spawned: 'run_schedule' with pid 58 snipe-it_2_1 | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message snipe-it_2_1 | No scheduled commands are ready to run. snipe-it_2_1 | 2022-08-25 01:10:20,107 INFO success: exit_on_any_fatal entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) snipe-it_2_1 | 2022-08-25 01:10:20,107 INFO success: apache entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) snipe-it_2_1 | 2022-08-25 01:10:20,108 INFO success: run_schedule entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) snipe-it_2_1 | No scheduled commands are ready to run. snipe-it_2_1 | No scheduled commands are ready to run. snipe-it_2_1 | No scheduled commands are ready to run. snipe-it_2_1 | No scheduled commands are ready to run. snipe-it_2_1 | [2022-08-25T08:15:21+07:00] Running scheduled command: '/usr/bin/php7.4' 'artisan' auth:clear-resets > '/dev/null' 2>&1 snipe-it_2_1 | No scheduled commands are ready to run. [remainder truncated]
Started over once more with "docker run" and this time it worked using maria:latest and snipe:latest. My old DB content was picked up. So, still not understanding what happened, but at least it is running again. Could be that my previous APP_KEY was left behind and not deleted before running "docker run" and docker-compose. If that is the case, then a more meaningful error message would be most helpful.
Just ran docker-compose in the Fedora VM and made certain the APP_KEY was not set using the env file. Containers were created but the webapp would not run. Got a 404 error.
So glad you got yourself back up and running! But I do think I need to do some work here, regardless, so I’ll keep this open and assigned to me.
Debug mode
Describe the bug
Snipe Docker version:
OS OS: Linux, Manjaro Plasma
Issue: The environment file not found when creating containers using "docker run" and docker-compose.
Expected behavior: That the environment file be found no matter which method is used to create containers.
Description: Ran Snipe-IT successfully creating and running the 2 containers (snipe-it, mariadb) with "docker run" following the snipe online instructions. Started and restarted the containers manually many times and everything worked correctly.
Next, attempted to use docker-compose (after removing the 2 containers) and encountered an issue where the environment file was not recognized, though the file had worked previously when using "docker run". The containers started OK:
When I accessed using the webapp I received a DB error in PHP because the env file was not found:
Here is the docker-compose.yml file contents:
Next, went back to creating the containers manually using "docker run" and both snipe-it and mariadb containers reported they could not find the env file:
Next, started over completely by deleting both the snipe/snipe-it and maria:latest images and ran again using "docker run" for each. They ran and both containers were created successfully, The same PHP DB error occurred from the webapp as above.
I confirmed that docker is not the issue by creating a temp container using an env file and it worked perfectly, so it appears to be an issue with snipe and not docker.
I am at a loss as to why this is happening. Clearly, I did something to trip it up but am not certain what that was with all the changes. Any ideas or suggestions on how to correct to ensure the env is found? Is this a bug?
Thanks.
Reproduction steps
See above
Expected behavior
See above
Screenshots
No response
Snipe-IT Version
docker latest
Operating System
Manjaro
Web Server
none
PHP Version
in docker
Operating System
No response
Browser
No response
Version
No response
Device
No response
Operating System
No response
Browser
No response
Version
No response
Error messages
No response
Additional context
No response