Pre-flight for docker image isn't connecting to database #17657
Replies: 11 comments
-
👋 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. |
Beta Was this translation helpful? Give feedback.
-
BREAKING CHANGE: This release requires PHP 7.2.5 or greater.
|
Beta Was this translation helpful? Give feedback.
-
Wanted to chime in and say I am running into the exact same error running the docker container. I'm using podman on a CentOS box rather than Docker, but identical preflight error to @rstaudmyer I also tried connecting instead to an external mysql installation rather than a container as expected and am getting the same results. @JakubPiasekAGH This is running from the docker container, which the latest version installs PHP 7.2.24 Edit: Connecting to an external DB works as expected. PEBCAK error. However using the internalDB still does not work. I think it may be down to a container dns issue. @rstaudmyer Can you get a shell into the snipe-it container and try to resolve the container name for the database? That may give a clue as to why it's not working. Though it's just a hunch. |
Beta Was this translation helpful? Give feedback.
-
Hi! has anyone found a solution? I am having the same problem here! |
Beta Was this translation helpful? Give feedback.
-
I mean, every time I spin up a Docker container and hook into a database and follow our instructions (which I wrote), it works for me. I can't replicate your error case here. I could also be too close to the metal here and could be missing something big; that's not only possible but is quite likely. But I'd need more details to work from. |
Beta Was this translation helpful? Give feedback.
-
I faced this issue, and resolved it by adding the following lines to my .env file :
where snipeit_db is the container_name of my mariadb instance. |
Beta Was this translation helpful? Give feedback.
-
anyone get this fixed? I am running on CentOS Stream 8 using podman 4.2.0. I have tried @tperrindell 's fix and am still getting nowhere. I am able to ping the sql container from my snipe-it container, but still get this same error in the pre-flight check. snipe-it containter label: v6.0.14 |
Beta Was this translation helpful? Give feedback.
-
What if you try with mariadb instead? |
Beta Was this translation helpful? Give feedback.
-
Podman have a few peculiarities, I remember I faced something similar, even if I map the ports in my MySQL container. I think it has something to do with rootles containers... to be honest I didn't investigate enough the cause, just a solution. So I just used the
Where you can substitute for your own values everything between '<>' characters. |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, the |
Beta Was this translation helpful? Give feedback.
-
Same problem happened with me, for me the mysql container name is "snipe-mysql" , so I corrected first line and it worked for me. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please confirm you have done the following before posting your bug report:
Describe the bug
After setting up a Docker image of Snipe IT, I am getting the following on the pre-flight page. I checked all the .env files I can find but nothing is associated with that container ID. There's clearly a .env somewhere as I can access the URL. Any insight on this? Here is the error message:
D'oh! Looks like we can't connect to your database. Please update your database settings in your .env file. Your database says: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No address associated with hostname (SQL: select 2 + 2)
To Reproduce
Steps to reproduce the behavior:
Install snipe-it and mysql in containers
Configure app
Reboot VM
Expected behavior
Snipe-it should work with all data from existing database.
Server (please complete the following information):
Snipe-IT Version: Latest docker image
OS: Ubuntu 20.04 LTS
Web Server: Apache
PHP Version 7.2.24
Desktop (please complete the following information):
OS: MacOS Big Sur/Ubuntu 20.04
Browser Chrome, Firefox
Error Messages
D'oh! Looks like we can't connect to your database. Please update your database settings in your .env file. Your database says: SQLSTATE[HY000] [2002] Connection refused (SQL: select 2 + 2)
Additional context
Is this a fresh install or an upgrade? - Fresh
What OS and web server you're running Snipe-IT on - Ubuntu 20.04, Apache 2.4
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc) - Docker
Beta Was this translation helpful? Give feedback.
All reactions