User tests: Successful: Unsuccessful:
The Microsoft SQL Server driver's (hereon: sqlsrv) error messages are useless. This PR returns the full error message stack which gives INFINITELY MORE USEFUL error messages.
Screw up your MS SQL Server installation and try to install a new Joomla! site.
An error message with some clue about what is going on.
A uselesserror message Could not connect to the database. Connector returned number: Database sqlsrv_connect failed
. No crap, Sherlock, something's wrong? Gee, I'd have never guessed... Don't tell me why it failed, I like guessing :@
sqlsrv's ridiculous error message changes to something more informative. In my case:
Could not connect to the database. Connector returned number: Database sqlsrv_connect failed, Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. [message] => [Microsoft][ODBC Driver 11 for SQL Server]Named Pipes Provider: Could not open a connection to SQL Server [53]. ) [1] => Array ( [0] => HYT00 [SQLSTATE] => HYT00 [1] => 0 [code] => 0 [2] => [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired [message] => [Microsoft][ODBC Driver 11 for SQL Server]Login timeout expired ) [2] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => 53 [code] => 53 [2] => [Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. [message] => [Microsoft][ODBC Driver 11 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. ) )
A-ha! The instance name had a typo. I only lost half a day to that @#$%^&*()!!!
None
None
Status | New | ⇒ | Pending |
Category | ⇒ | MS SQL Libraries |
Labels |
Added:
?
|
I have tested this item
on code review - makes sense for our two ms sql users to have meaningful errors and then maybe we will have three ms sql users ;)
FWIW even though I could install Joomla! on MS SQL it is, leniently put, an unusable pile of dog poo :( Trying to go to Global Configuration results in a PHP warning. Fixing that results in a DB error. I am afraid it'd be too much of a rabbit hole trying to fix Joomla! on MS SQL. Even Microsoft with its Web Platform Installer doesn't use MS SQL any more, they only support running Joomla! on MySQL. The responsible thing to do is to stop pretending that Joomla! runs on MS SQL or PostgreSQL. The current state is embarrassing and I bet it loses us users :(
+10 although if memory serves me correctly (because i thought it was odd at the time) the web platform installer always used mysql
The problem is that the ms sql users only ever come out of the woodwork when we say its going to be dropped. They tell us that they have a set of fixes to apply to make it work but they never share them. https://groups.google.com/d/msg/joomla-dev-cms/VZNVSf4IfZc/c9Ha6VNXK6MJ
I think we finally dropped MSSQL for J4.0
#12198
Also the last time I really tried to use MS SQL I found too few 3rd party components supported MS SQL making only a barebones site possible. I quickly gave up after that.
@csthomas has also made a number of fixes to MS SQL in staging/J3.7beta so it's slightly less garbage.
I have tested this item
On installation process.
Before
Error Could not connect to the database. Connector returned number: Database sqlsrv_connect failed
After
Error Could not connect to the database. Connector returned number: Database sqlsrv_connect failed, Array ( [0] => Array ( [0] => 42000 [SQLSTATE] => 42000 [1] => 4060 [code] => 4060 [2] => [unixODBC][Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot open database "demo" requested by the login. The login failed. [message] => [unixODBC][Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot open database "demo" requested by the login. The login failed. ) [1] => Array ( [0] => 28000 [SQLSTATE] => 28000 [1] => 18456 [code] => 18456 [2] => [unixODBC][Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'joomla'. [message] => [unixODBC][Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'joomla'. ) )
Thanks for the PR and the testers.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-03-30 21:00:25 |
Closed_By | ⇒ | zero-24 |
@nikosdion FYI I have just fixed drone for you with b56c5bf