? Pending

User tests: Successful: Unsuccessful:

avatar nikosdion
nikosdion
30 Mar 2017

Summary of Changes

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.

Testing Instructions

Screw up your MS SQL Server installation and try to install a new Joomla! site.

Expected result

An error message with some clue about what is going on.

Actual result

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 :@

After applying the PR

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 @#$%^&*()!!!

Documentation Changes Required

None

Backwards compatibility breaks

None

avatar nikosdion nikosdion - open - 30 Mar 2017
avatar nikosdion nikosdion - change - 30 Mar 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Mar 2017
Category MS SQL Libraries
avatar zero-24 zero-24 - change - 30 Mar 2017
Labels Added: ?
avatar zero-24
zero-24 - comment - 30 Mar 2017

@nikosdion FYI I have just fixed drone for you with b56c5bf

avatar nikosdion
nikosdion - comment - 30 Mar 2017

@zero-24 Thank you!

avatar brianteeman brianteeman - test_item - 30 Mar 2017 - Tested successfully
avatar brianteeman
brianteeman - comment - 30 Mar 2017

I have tested this item successfully on b56c5bf

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 ;)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15003.

avatar nikosdion
nikosdion - comment - 30 Mar 2017

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 :(

avatar brianteeman
brianteeman - comment - 30 Mar 2017

+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

avatar photodude
photodude - comment - 30 Mar 2017

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.

avatar csthomas csthomas - test_item - 30 Mar 2017 - Tested successfully
avatar csthomas
csthomas - comment - 30 Mar 2017

I have tested this item successfully on b56c5bf

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'. ) )


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15003.

avatar zero-24
zero-24 - comment - 30 Mar 2017

Thanks for the PR and the testers. ?

avatar zero-24 zero-24 - change - 30 Mar 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-03-30 21:00:25
Closed_By zero-24
avatar zero-24 zero-24 - close - 30 Mar 2017
avatar zero-24 zero-24 - merge - 30 Mar 2017

Add a Comment

Login with GitHub to post a comment