-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Container image 312293e does not connect to the database #604
Comments
I accepted a PR this morning which changed how the database connection strings worked, I'll roll it back. |
Try now.
…On Tue, 16 Jan 2024 at 19:52, Jason ***@***.***> wrote:
*Describe the bug*
When building with container image tagged 312293e
<312293e>,
the following exception occurs:
Fatal error: Uncaught mysqli_sql_exception: Connection refused in
/var/www/html/dvwa/includes/dvwaPage.inc.php:508 Stack trace: #0
/var/www/html/dvwa/includes/dvwaPage.inc.php(508):
mysqli_connect('127.0.0.1', 'dvwa', Object(SensitiveParameterValue), '',
'3306') #1 /var/www/html/login.php(8): dvwaDatabaseConnect() #2 {main}
thrown in /var/www/html/dvwa/includes/dvwaPage.inc.php on line 508
Using the previous container (1fb5078
<1fb5078>)
works normally. I have not had a chance to look into why yet (I'm working
with a class on this today) and plan to follow up with more details later.
*To Reproduce*
This is a container build issue, simply starting with the :latest
container from this repo is causing the problem for me, and simply rolling
back to :1fb5078 resolves it.
*note*: *I did not provide additional detail below - but will attempt to
fill in more detail later today.*
*Logs*
Include the last five lines of the Apache log file from directly after the
problem happened.
*Expected behaviour*
A clear and concise description of what you expected to happen.
*What have you done to help fix the issue yourself?*
What have you tried, what research have you done, what changes have you
made.
*Screenshots*
If applicable, add screenshots to help explain your problem.
*System (please complete the following information):*
- OS: [e.g. Windows, Ubuntu]
- Database and Version [e.g. MySQL, MariaDB, 10.5.12-MariaDB]
- PHP Version [e.g. 7.4.25]
- Installed PHP modules
*Additional context*
Add any other context about the problem here.
—
Reply to this email directly, view it on GitHub
<#604>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA4SWKD764HGA2NWEVBBUDYO3K65AVCNFSM6AAAAABB5LZ5UOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGA4DINZTHA4DQMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
It looks like the database server is missing from the image! I'll have a quick play but this may be above my docker skills. |
Agreed it broke after version 1fb5078 but I can't see why. If you can suggest anything I'll take it. The docker compose is working fine locally. Hope the class goes well. |
I believe I found the source of the problem. I build container labs for students using a template to dynamically generate compose files. It appears an expected environment variable passed through compose was renamed from DB_SERVER to DVWA_DB_SERVER. So I can fix this on my end by updating my template. In fact, I will simply add both keys. Sorry for the fire drill. |
Could you have a look at this PR that I reverted, should I put this back or
not?
https://github.com/digininja/DVWA/compare/master...revert-605-revert-592-env-config?expand=1
…On Wed, 17 Jan 2024 at 12:29, Jason ***@***.***> wrote:
I believe I found the source of the problem. I build container labs for
students using a template
<https://github.com/SamuraiWTF/shogun/blob/main/lab_configs/docker_compose_templates/dvwa.yaml>
to dynamically generate compose files. It appears an expected environment
variable passed through compose was renamed from DB_SERVER to
DVWA_DB_SERVER.
So I can fix this on my end by updating my template. In fact, I will
simply add both keys. Sorry for the fire drill.
—
Reply to this email directly, view it on GitHub
<#604 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA4SWMS536ICLHWC4PWAADYO672DAVCNFSM6AAAAABB5LZ5UOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJVG4YTCNZYGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Describe the bug
When building with container image tagged 312293e, the following exception occurs:
Fatal error: Uncaught mysqli_sql_exception: Connection refused in /var/www/html/dvwa/includes/dvwaPage.inc.php:508 Stack trace: #0 /var/www/html/dvwa/includes/dvwaPage.inc.php(508): mysqli_connect('127.0.0.1', 'dvwa', Object(SensitiveParameterValue), '', '3306') #1 /var/www/html/login.php(8): dvwaDatabaseConnect() #2 {main} thrown in /var/www/html/dvwa/includes/dvwaPage.inc.php on line 508
Using the previous container (1fb5078) works normally. I have not had a chance to look into why yet (I'm working with a class on this today) and plan to follow up with more details later.
To Reproduce
This is a container build issue, simply starting with the :latest container from this repo is causing the problem for me, and simply rolling back to :1fb5078 resolves it.
note: I did not provide additional detail below - but will attempt to fill in more detail later today.
Logs
Include the last five lines of the Apache log file from directly after the problem happened.
Expected behaviour
A clear and concise description of what you expected to happen.
What have you done to help fix the issue yourself?
What have you tried, what research have you done, what changes have you made.
Screenshots
If applicable, add screenshots to help explain your problem.
System (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: