-
Notifications
You must be signed in to change notification settings - Fork 374
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
SQLSTATE[HY010]: [Microsoft][ODBC Driver Manager] Function sequence error (again) #49
Comments
Not sure if directly related, but I am seeing the function sequence error appear randomly on different usage scenarios. All of them when trying to iterate over a client buffered result set. |
Hi david-garcia-garcia can you explain some of the usage scenarios that are causing the sequence error. I am with the team at Microsoft that own's this driver. I might be able to help you out. |
The case was too complex and would need investigation to really isolate the steps to reproduce. But it did share something similar with the sample script I provided in the same comment:
If you could get to reproduce the error with the provided script there's a chance that both of them are indeed the same bug. |
I am seeing this error consistently on Drupal 8 - MSSQL integration (and is preventing any further development because it breaks man automated tests...). Unluckily, the circumstances that lead to the error are so complex that I was unsuccessfull at isolating a test script. I even tried to PROXY all operations on Drupal's database abstraction layer to later reproduce every single operation done against the PDO driver without luck, the error simply won't reproduce. If you are interested in helping solve this out to get D8 working on MSSQL Server, I can provide the exact steps to reproduce on a clean D8 install. You will need the -dev version of the SQL Server driver for Drupal - that I can only share privately at the moment. |
I’d love to take a look at this. Can you share the repro steps and the dev version driver? Thanks From: Davvid [mailto:notifications@github.com] I am seeing this error consistently on Drupal 8 - MSSQL integration (and is preventing any further development because it breaks man automated tests...). Unluckily, the circumstances that lead to the error are so complex that I was unsuccessfull at isolating a test script. I even tried to PROXY all operations on Drupal's database abstraction layer to later reproduce every single operation done against the PDO driver without luck, the error simply won't reproduce. If you are interested in helping solve this out to get D8 working on MSSQL Server, I can provide the exact steps to reproduce on a clean D8 install. You will need the -dev version of the SQL Server driver for Drupal - that I can only share privately at the moment. — |
Steps to reproduce:
I found out that completely removing transaction management from the Drupal driver prevents the error from happening. https://drive.google.com/file/d/0B2bjxiZ1Bb4BZmxNWnd1YmFpdDg/view?usp=sharing (zip with sqlsrv driver, phpinfo() dump and screenshot of the exception) Good luck. At least the exception is consistently reproducible. Greetings |
Any luck with this? D8 is to be released before the end of the year, it would be nice to have it working on MSSQL shortly before that happens. |
I'm looking into it. I'll,keep you posted on that. Give me a week, since I was out of town. Thanks Sent from my iPad On Aug 4, 2015, at 11:03 PM, Davvid <notifications@git.luolix.topmailto:notifications@github.com> wrote: Any luck with this? D8 is to be released before the end of the year, it would be nice to have it working on MSSQL shortly before that happens. Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-127882620. |
Do not use the latest D8 HEAD, download something from the date of my original post. Recent changes in D8 have broken the MSSQL driver for Drupal. |
Updated driver to fix compatiblity with latest head: https://www.dropbox.com/s/j98z4fd8jh7wr0q/drivers2.rar?dl=0 Verified that the issue is still reproducible under the same conditions. |
I’ll take a look at this tonight, in my Mac I’ll keep you posted From: Davvid [mailto:notifications@github.com] Updated driver to fix compatiblity with latest head: https://www.dropbox.com/s/j98z4fd8jh7wr0q/drivers2.rar?dl=0 Verified that the issue is still reproducible under the same conditions. — |
When I’m trying to create the SQL Server database in Drupal 8, I’m getting the following error in the PHP56 error_log file: [11-Aug-2015 22:04:27 America/Los_Angeles] PHP Fatal error: Call to undefined function Drupal\Driver\Database\sqlsrv\wincache_ucache_get() in C:\inetpub\wwwroot\drupal\drivers\lib\Drupal\Driver\Database\sqlsrv\Connection.php on line 607 Any clue? From: Davvid [mailto:notifications@github.com] Updated driver to fix compatiblity with latest head: https://www.dropbox.com/s/j98z4fd8jh7wr0q/drivers2.rar?dl=0 Verified that the issue is still reproducible under the same conditions. — |
Hey Davvid, I used the very first connector you sent me (used both versions in total) and the error below happens: [13-Aug-2015 20:36:28 America/Los_Angeles] PHP Fatal error: Declaration of Drupal\Driver\Database\sqlsrv\Schema::addIndex() must be compatible with Drupal\Core\Database\Schema::addIndex($table, $name, $fields, array $spec) in C:\inetpub\wwwroot\drupal\drivers\lib\Drupal\Driver\Database\sqlsrv\Schema.php on line 41 From: Luiz Santos <lfsantos@microsoft.commailto:lfsantos@microsoft.com> When I'm trying to create the SQL Server database in Drupal 8, I'm getting the following error in the PHP56 error_log file: [11-Aug-2015 22:04:27 America/Los_Angeles] PHP Fatal error: Call to undefined function Drupal\Driver\Database\sqlsrv\wincache_ucache_get() in C:\inetpub\wwwroot\drupal\drivers\lib\Drupal\Driver\Database\sqlsrv\Connection.php on line 607 Any clue? From: Davvid [mailto:notifications@github.com] Updated driver to fix compatiblity with latest head: https://www.dropbox.com/s/j98z4fd8jh7wr0q/drivers2.rar?dl=0 Verified that the issue is still reproducible under the same conditions. Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-128458978. |
You need the Wincache PHP extension for the MSSQL driver to work.
I already published the driver on Drupal.org (https://www.drupal.org/project/sqlsrv). You can see that the latest commit has this issue fixed and the method has the correct signature. (line 1601) |
Got any troubles to repro the issue? The latest dev from drupal.org should be working flawlessly to get past install. |
Hi Davvid, I was out in a family trip until Sunday. I’m back to work today. Before going out, I set up the whole environment, but I could not run the test successfully. It just do not run. I did not have time to investigate the issue, which I’m planning to do today. I’ll let you know. From: Davvid [mailto:notifications@github.com] Got any troubles to repro the issue? The latest dev from drupal.org should be working flawlessly to get past install. — |
I verified that this is still reproducible on lateset dev of driver and core.
That is weird, at least you should be seeing an error of some sort. I've sometimes experienced the progress bar getting stuck forever, but those bugs were already fixed. |
That was exactly the behavior I’ve got. I’ll continue investigating on my end. Thanks From: Davvid [mailto:notifications@github.com] I verified that this is still reproducible on lateset dev of driver and core. It just do not run That is weird, at least you should be seeing an error of some sort. I've sometimes experienced the progress bar getting stuck forever, but those bugs were already fixed. — |
I just posted a repro script for another issue in #50. I have the feeling that both #49 and #50 might be the same thing as they both seem to exhibit themselves when a PDO exception is thrown (and managed by the user!) while inside a transaction. So it might be worth taking a look at #50 first given that it is an "easy" stand alone single file repro script. |
I am also getting the [Microsoft][ODBC Driver Manager] Function sequence error.
|
@agrarian What version of driver are you using? |
v4.0.1https://github.com/Azure/msphpsql/releases/tag/v4.0.1 Terry From: Meet Bhagdev [mailto:notifications@github.com] @agrarianhttps://github.com/agrarian What version of driver are you using? — |
Hi @agrarian, I'm trying to understand your script. Why did you call Hi @david-garcia-garcia do you still have function sequence error problem? I looked at the other related issue #50 and your repro script is gone. |
I am getting this error: [unixODBC][Driver Manager]Function sequence error On both the 4.3.0 release of sqlsrv and 5.1.0 preview. I am running a different framework that is mostly mentioned here (CodeIgniter rather than Drupal). I am afraid I don't know where to look for the error. Is it an error in the framework, the driver, or unixOBDC? What is the bottom line as far as fixes or workarounds? Thank you. |
Hello @rkevinburton |
I will try to put together a repro script. But it happens infrequently so it may take me some time to put together a relaiable repro. In the meantime I am connecting to
Microsoft SQL Server Developer (64-bit)
Microsoft Windows NT 6.1 (7601)
NT x64
11.0.6020.0
English (United States)
8192 MB
2 (processors)
I have tried the PHP sqlsrv driver version 4.3.0 and 5.1.0preview, and I get the error on both versions. Though, the error seems to occur less frequently with 5.1.0preview.
From: Jenny Tam [mailto:notifications@github.com]
Sent: Tuesday, October 10, 2017 10:26 AM
To: Microsoft/msphpsql <msphpsql@noreply.github.com>
Cc: Kevin (Ronald) Burton <rburton@agsource.com>; Mention <mention@noreply.github.com>
Subject: Re: [Microsoft/msphpsql] SQLSTATE[HY010]: [Microsoft][ODBC Driver Manager] Function sequence error (again) (#49)
Hello @rkevinburton<https://github.com/rkevinburton>
Function sequence error can be caused by various factors, so more info is required in addition to telling us you get this error. Therefore, please create a new issue by providing repro script(s), the platform and/or version of the SQL Server, etc. The more you provide the closer we can get to help answer your questions.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#49 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AdmtTVpIWEm_hVPqAzkdDEAoYykj5Gilks5sq4yegaJpZM4EPo38>.
|
Hello @rkevinburton regrettably it's still a bit vague and we won't be able to reproduce the problem without a concrete repro scenario. For example, when you encountered this error were you doing a simple select, or update, or insert, with or without using stored procedure, transactions, etc.? |
I mostly get errors that look like this:
<body>
<div id="content">
<h1>A Database Error Occurred</h1>
<p>Error Number: HY010</p><p>[unixODBC][Driver Manager]Function sequence error</p><p>DELETE FROM users.dbo.users_groups WHERE group_id = 1 AND user_id = 685</p><p>Filename: models/ion_auth_parent_model.php</p><p>Line Number: 1222</p> </div>
</body>
I am using CodeIgniter so admittedly the database code is buried in the MVC handling and is specific to our application.
From: Jenny Tam [mailto:notifications@github.com]
Sent: Tuesday, October 10, 2017 12:07 PM
To: Microsoft/msphpsql <msphpsql@noreply.github.com>
Cc: Kevin (Ronald) Burton <rburton@agsource.com>; Mention <mention@noreply.github.com>
Subject: Re: [Microsoft/msphpsql] SQLSTATE[HY010]: [Microsoft][ODBC Driver Manager] Function sequence error (again) (#49)
Hello @rkevinburton<https://github.com/rkevinburton> regrettably it's still a bit vague and we won't be able to reproduce the problem without a concrete repro scenario. For example, when you encountered this error were you doing a simple select, or update, or insert, with or without using stored procedure, transactions, etc.?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#49 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AdmtTYDLshjJzuGIHoxCnSN9amX9KhzXks5sq6Q4gaJpZM4EPo38>.
|
Thanks @rkevinburton. The problem likely lies in the file Please bring this problem to your application developers. FYI, function sequence error often occurs when ODBC functions are called out of the order required. You can check this page for different scenarios that caused HY010 error |
If a record doesn’t exist then I get an error that the record doesn’t exist. I am not clear on what ‘function sequence error’ is?
This is the code that is an line 1222
$this->db->delete($this->tables['users_groups'], array($this->join['groups'] => (int)$group_id, $this->join['users'] => (int)$user_id));
From: Jenny Tam [mailto:notifications@github.com]
Sent: Tuesday, October 10, 2017 3:17 PM
To: Microsoft/msphpsql <msphpsql@noreply.github.com>
Cc: Kevin (Ronald) Burton <rburton@agsource.com>; Mention <mention@noreply.github.com>
Subject: Re: [Microsoft/msphpsql] SQLSTATE[HY010]: [Microsoft][ODBC Driver Manager] Function sequence error (again) (#49)
Thanks @rkevinburton<https://github.com/rkevinburton>. The problem likely lies in the file models/ion_auth_parent_model.php, line 1222, as indicated in the error message. Looks like something went wrong when trying to delete a certain user? I'm guessing that the user with id 685 and group 1 doesn't exist.
Please bring this problem to your application developers. FYI, function sequence error often occurs when ODBC functions are called out of the order required. You can check this page <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlfetch-function> for different scenarios that caused HY010 error
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#49 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AdmtTX9i40NUU3qG6TMqFZ50ApxZOcf3ks5sq9DTgaJpZM4EPo38>.
|
@rkevinburton we cannot investigate further unless we have clear steps to reproduce the problems. I'd happily help when you can provide a repro. In your example above, the error is clearly specific to your application and how the class(es) work(s) underneath. |
Closing due to inactivity. Please reopen if necessary. |
I am close to getting buffered queries working in the Drupal database abstraction layer, with performance gains of ~30% (that's huge) on a vanilla install.
But... I am seeing again the Function sequence error :(
It took me ages to isolate the issue this time into a sample script.
Download schema and sample script from this dropbox link:
https://www.dropbox.com/s/3nd8xdf32a7dmyz/sample_sqlsrv_may.zip?dl=0
For the error to go away, simply remove the transaction related statements:
$cnn->beginTransaction();
$cnn->commit();
So it looks like you cannot have a transaction nested in a loop while iterating on a client buffered result set.
The text was updated successfully, but these errors were encountered: