Closed (fixed)
Project:
Drupal vB
Version:
5.x-2.0-rc1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
30 Apr 2008 at 12:45 UTC
Updated:
22 May 2008 at 10:11 UTC
Jump to comment: Most recent file
After transferring our site to another server, we were unable to access to Drupal. Every time we tried to load our site we received a Drupal error page that stated, "Unable to connect to database server".
With some research, we found that the problem was "drupalvb_db" in the variable table in our Drupal database. Drupal vB seems to hardcode the MySQL connection string and store it in the database. However if Drupal is moved to another server with a different connection string, the site does not work.
I would think DB connection strings should not be stored in the database, especially ones that cause the site to crash.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | drupalvb-DRUPAL-5--2.db-valid.patch | 1.12 KB | sun |
| #7 | drupalvb-DRUPAL-5--2.db-valid.patch | 714 bytes | sun |
| #2 | drupalvb.dbconnect.patch | 3.36 KB | sun |
Comments
Comment #1
sunThat should not happen. I'll try to come up with a patch.
Comment #2
sunSince Drupal's current database layer does not provide a separate function to check a database connection without displaying a maintenance page, this patch needs to implement custom connection checks into Drupal vB.
Please test.
Comment #3
sunThanks, committed.
Comment #4
sgdev commentedI hadn't tested it out yet ... was going to do so shortly. Not sure how this was ready to be committed without testing?
Comment #5
sunI tested this patch myself. It not only fixed this bug, but also increased performance of Drupal vB.
Feel free to re-open this issue if you still encounter this bug.
Comment #6
sgdev commentedAfter I transferred the site to our secondary server, I was able to log in but I received lots of errors. One of the errors said Drupal vB was not referencing the right database and I needed to change it. I made the change and the errors went away. I just wanted to verify that this is the expected functionality?
Comment #7
sunThere should be exactly one error message from Drupal vB if the database connection to vB is not valid, including a link to Drupal vB's database settings to fix it.
Heck, your mention of "log in" revealed that implementation of hook_user() does not yet check whether the database connection is valid.
Comment #8
sunAnother one bites in the dust...
Comment #9
sgdev commentedJust so I understand, the patch in #8 replaces the one in #7?
Comment #10
sunYes, patch in #8 includes all necessary changes.
Comment #11
sunReviews, tests, anyone?
Comment #12
sgdev commentedSorry I haven't had the need to transfer the site in the past few days. I have been working on handling other Drupal issues. I might have the chance to do so before long. I will let you know if I do.
Comment #13
sunSorry, 5.x-2.0 needs to be released. These checks work as claimed at least for me. If there are some more missing at another point, we can add them later.
Committed, thanks.
Comment #14
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.