Serious Sqlite command line Problems after Windows 10 update
(1) By anonymous on 2020-11-15 18:26:33 [link] [source]
After the current WINDOWS 10 update to one of our customers Laptops, the SQLITE command processor began to fail in strange and sometimes intermittent ways. A file of valid SQL commands (that has always worked before the update) redirected as inputs to SQLITE was not processed and just the prompt for commands displayed. (The SQKUTE prompt was in fact strangely displayed in a new command window to the original) and if you typed a valid command like .HELP it was rejected. Also, if you invoked SQLITE by typing the command, at the command prompt all valid commands you typed were rejected.
(On our user's machine, the initial attempt to carry out the windows update had failed - possibly due to Low disk space - but was later installed successfully - he first attempted to uninstall the update this failed and he contacted Microsoft and they advised him to download a new version of windows which he did - but the sqlite problem was not completely solved - it was now possible to type commands and get them recognized but not redirect inputs from a file to sqlite - but we proved the windows redirect function does work with other command line applications and it was only affecting SQLITE)
Unfortunately, immediately after my windows 10 laptop had the same windows update - which like the users first failed and then succeeded- my laptop developed the same fault, but after carrying out 2 chkdsk's it started to work again, but on a reboot, failed again, but has now started to work again - which seems to defy common sense but is happening. I realise it is likely to be a windows fault somewhere, but it only seems to be affecting SQLITE. So perhaps someone familiar with sqlite may have some idea what is happening and why!
(2) By Keith Medcalf (kmedcalf) on 2020-11-15 21:06:35 in reply to 1 [link] [source]
Which version of Windows 10?
There are at least a dozen of them.
(5) By anonymous on 2020-11-16 08:36:44 in reply to 2 [link] [source]
Thank you for replying to my post/
My Laptop is Microsoft Windows [Version 10.0.18363.1198] and the Laptop is a DELL Inspiron 15 3000 with 256GB SSD SQLite version 3.33.0 2020-08-14 13:23:32 The windows update was as follows:-
November 10, 2020—KB4586786 (OS Builds 18362.1198 and 18363.1198)
Installed on the 13/10/20 and immediately after the install sqlite commands that worked before the update did not The details / The Sqlite command prompt failed at first using a windows input redirect.
Sqlite3 Input.db <android.sql
Instead of carrying out the commands and exiting it just displayed the sqlite command prompt. And if you came out of the prompt and just typed SQLITE3 and then typed any valid command such as .HELp it said it was invalid and did not carry out the command.
I must admit I was baffled by the fault on our Users Laptop, and our user was advised my Microsoft Support to download the latest version of Windows and that should cure the problem - he did but it did not.
And as we have a lot of users who make use of SQLITE and in fact depend on it I began to panic and not think too clearly!! Our BT technical support person was just as baffled as we were and advised to take a look at Sqlite support forums - which I did. But unfortunately there seems to be no explanation for it other than the WINDOWS 10 update caused the problem but after downloading the latest version of windows on the advice of Microsoft the problem remained. So, on at least 2 computersthe same fault fault has taken place immediately after the windows update
(3.1) By Larry Brasfield (LarryBrasfield) on 2020-11-15 22:21:03 edited from 3.0 in reply to 1 [source]
I have the latest version of Windows 10, 20H2 from the "Semi-Annual Channel". (Version 10.0.19042.630) When running the last released sqlite3.exe image, (version 3.33.0), in a cmd.exe shell, Powershell, TakeCmd v26 shell, and in whatever console is the system default for console programs, I see no problem at all such as you describe. Input redirection works exactly as I expect also. To wit:
[C:\Tmp]
> sqlite3 < slblat.txt
.help ?-all? ?PATTERN? Show help text for PATTERN
[C:\Tmp] > type slblat.txt .once nul .help .help help .quit
[C:\Tmp]
>
in cmd.exe and TCC.exe shells, or
PS C:\Tmp> type .\slblat.txt | sqlite3
.help ?-all? ?PATTERN? Show help text for PATTERN
PS C:\Tmp>
in a Powershell session.
I find your problem description somewhat mysterious and unhelpful. I do not know what "was rejected" means. And while I know what redirection does, (and can therefor infer what it "does work" means), I do not know what kind of not working you have seen. (The paths of righteousness are somewhat narrower than all the rest.)
My study of the sqlite3 shell code shows that it does console input and output in a highly regular way that I very much doubt would make it act differently (with respect to doing such I/O accurately) than many thousands of other console programs.
Hence, I think this problem of your is very specific to a few of your systems, and so will require more system-specific information to diagnose. I wonder if you and your customers have suffered a malware infection. I would be taking a look at running processes and where their images were loaded from.
Behavior differing before and after chkdsk.exe runs (or "chkdsk /F" I suppose) is a sign of problems more serious than a sqlite.exe issue.
(6) By anonymous on 2020-11-16 12:53:31 in reply to 3.1 [link] [source]
Than you for your reply
The customer's Laptop is a Surface pro and after Microsoft advised him to download the latest version of windows 10 his laptop also has Microsoft Windows [Version 10.0.19042.630]
But unfortunately, the very same redirect command that worked BEFORE the update and download still fails to carry out the commands and exit it just opens a new command prompt window and stops with an SQLITE prompt. Yet the very same redirect command on his back up fail safe, machine without the update does work.
On my laptop sqlite3 works ok now - but it did not as with our customer after the WINDOWS 10 update. So far fortnuately no other customer has reported this issue - but we did advise customers to PAUSE updates till what was happening could be established.
We have a BT Technical support service and one of their technical experts looked at the problem - checking the windows event log and running sfc etc- and could not come up with any solutions, and his final comment was he had never seen SQLITE used by any of his customers before, and to check any support forum for issues - suggesting he thought the problem was with SQLITE. T The advice of the MICROSOFT technical expert was to downmload the latest version of windows but this also failed to solve the problem.
So we hoped that perhaps an SQLITE technical expert might be able to solve the problem or point us in the right direction.
(9) By Larry Brasfield (LarryBrasfield) on 2020-11-16 15:47:06 in reply to 6 [link] [source]
I believe that drilling into SQLite's behavior will reveal only a dry hole with respect to this problem. As I said, sqlite3.exe is an ordinary console program like many other thousands.
I am not quite a SQLite technical expert, having spent only a few weeks of effort in the shell code, but I have been a software developer for decades and know that when a program relies upon the standard C library for its I/O, as sqlite3.exe does, that there is virtually no prospect of discovering that it is responsible for the problems you describe.
In addition to the malware check I suggested earlier, I suggest you take a look at what is being loaded when you launch a sqlite3.exe process, using the free DLL Dependency Walker. Do this on a system that "works" and on a system that "fails to carry out commands and exit", taking care to note the location of the various DLLs that are loaded, including the (putative) system DLLs. The "official" distributed sqlite3.exe has no DLL dependencies except for system DLLs, which should all be found in a system directory. (The Dependency Walker shows which DLLs from what locations are loaded according the the actual DLL file resolution rules.) I presume that, before you do this, you will have followed Simon's advice to get a fresh copy of the executable.
Your problem is specific to a small set of machines, not to SQLite.
(16) By anonymous on 2020-11-17 09:55:12 in reply to 9 [link] [source]
Thank you for your reply.
I will carry out the diagnostic tests you suggest.
I should point out that we hire BT technical experts to look at any problems our applications have with windows.
We contacted a BT support person who is an expert in problems caused by windows and malware and he carried out all the diagnostic tests not us and he could find no problems with windows or malware, and it was this expert who advised us to contact the Sqlite forum.
It was my belief that the problem was not in any real sense a problem with SQLITE been incompatible with the latest version of windows but a problem with SQLITE caused by the installation of the update (which in both cases at first actually failed to install).
For example, our "legacy" application uses a Pervasive (formerly Btrieve) database, and each time a windows update takes place it often but not in all cases overwrites one of the REGISTRY entries used by BTRIEVE and Btrieve then fails and becomes unusable till you fix the registry entry. Unfortunately, no amount of rolling back of an update or downloading new versions of windows fixes the error. and unless you know a little about Btrieve you have had it!!
Unfortunately after an attempt to uninstall the update - the uninstall failed and Microsoft advised to get out of this problem the up-to-date version of windows be downloaded.
And sadly there was no restore point and the BT expert advised it was pointless rolling back as after the maximum pause period the update would be installed again.
(12.1) By Keith Medcalf (kmedcalf) on 2020-11-16 21:29:21 edited from 12.0 in reply to 6 [link] [source]
sfc does not actually do much of anything. You need to run DISM.
Dism /Online /Cleanup-Image /StartComponentCleanup
Dism /Online /Cleanup-Image /RestoreHealth
sfc /scannow
from an Administrative command prompt.
If any errors are reported then once finished the last command, restart at the beginning again. Repeat until success achieved (if you still get errors after three times around the merry-go-round, your Windows image is either hosed beyond repair OR Microsoft is hosed beyond repair (which has happened several times)).
Note that you need an Internet Connection in order for these to work since they need access to MITC (Microsoft In The Cloud) in order to work (or, alternately, a clean and slip-streamed install media that you make yourself, which is difficult for most mortals since you need to start from a "real CD image" -- which you cannot obtain except from Microsoft itself or by diddling with the Browser User-Agent string so that it can download an ISO rather than the "media creator" garbage (which does not create a proper install image) -- or download on your nearest "media creator" and ActiveX incompatible system such as your nearest IBM Mainframe or OS/2 machine).
Some errors cannot be repaired by DISM, though most can.
(4) By Keith Medcalf (kmedcalf) on 2020-11-16 00:59:37 in reply to 1 [link] [source]
Did someone perchance enable "bug for bug" incompatibility? (that is, they selected to use the "legacy" console API's)
(7) By anonymous on 2020-11-16 13:05:59 in reply to 4 [link] [source]
Thank you for your reply.
Interestingly when I tried ticking the [x] Use Legacy console on the customers surface pro laptop it reported cannot find the command prompt link. in userspublicdesktopcomand_prompt
It seems there is a desktop.ini in that folder which I think is to do with the fact the desktop icons are in fact in onedrive in the cloud.
But maybe you are on to something.
Unfortunately, this customer seems "jinxed" and often has problems no one else has but in this case I had the same problem and it worried me that when people get the latest updates which are only just been issued to some windows users; everyone's system would fail too! And I thought maybe this would be important to your forum members to know about - I assure you I will be very pleased if this is proved to be wrong and I have just made a fool of myself!!
(10) By Larry Brasfield (LarryBrasfield) on 2020-11-16 16:03:47 in reply to 7 [link] [source]
I think it is past time that you provide detailed reproduction steps. And it would help if you were to run cmd.exe interactively, with sqlite3.exe in the current directory, using typed commands to demonstrate the problem. If you can do it that way, it is remotely possible that somebody here can help. But if the problem is that some arcane manner of running the program does not act consistently, and nobody here can fathom what that manner is, there is no reason to reasonably hope for help from this forum's participants.
Keith's guess as to what might be going wrong, while reasonable, was a long-shot forced by lack of information as to what you (or your customer) do to induce the problem. However, by luck, your response, "it reported it cannot find the command prompt link", is a clue that your execution context is critical rather than what sqlite3.exe does once it is actually loaded and running. So, please set aside the vague, conclusory descriptions of the problem and say, specifically with detail, what must be done to induce it, what actually happens, and where not obvious, what you believe the correct behavior would have been that differs from what did happen.
You have not yet made a fool of yourself. But if you persist with writing out your notions of what might be wrong with vague, "did not work" style of reporting, you will mark yourself as someone who has never learned How to Write a Good Bug Report and refuses to do so.
(22) By anonymous on 2020-11-17 15:08:46 in reply to 10 [link] [source]
Thank you for your reply.
Perhaps if the forum had an online Bug report form I could provide you with the information you think I should. But I will try and be more specific
But, At the risk of repeating myself, I perhaps should explain I am the company director and We hire and pay for BT technical experts to try and solve problems like this for us, their explanation of what was wrong was as vague as mine and basically their attitude was the problem is with SQLITE and we do not support SQLITE or know anything about it -so get in touch with them.
Many Thanks
(8) By Simon Slavin (slavin) on 2020-11-16 14:28:19 in reply to 1 [link] [source]
Please download new copies of the SQLite files from the 'Precompiled Binaries for Windows' section of https://sqlite.org/download.html and try the same commands using these new versions. If they work you can replace the old versions with these new ones.
I suspect that the Windows update concerned has changed its PATH variable, or where it finds a library file, and is now using a different version of something.
(19) By anonymous on 2020-11-17 14:28:00 in reply to 8 [link] [source]
Thank you for your reply and for trying to come up with a solution
I updated the customers sqlite3 (in fact I had already tried re-installing SQLITE3 after the fault)
Unfortunately, it did not solve the problem
I tried a simple test with a text file test.sql just containing .Help
the command line Sqlite3 <test.sql simply opened another window and displayed a command prompt However, I then typed
.read test.sql
and it did display the help menu
So perhaps if there is or was a command line such as
sqlite3 input.db /Read=Test.sql It would work and avoid the windows redirection - but I could not find a command-line option like this.
(11) By anonymous on 2020-11-16 21:20:37 in reply to 1 [link] [source]
To prove that it is a Windows Update that is the cause of the issues you are encountering on that particular computer:
Step 1: Restore to an earlier restore point. (Windows Updates automatically create restore points). You can verify what restore points are available by running
rstui
at the command prompt and use the dialogue that pops up.
Step 2: Repeat your tests. If your tests still fail, it is not the windows update that is the issue.
(13) By luuk on 2020-11-17 07:27:39 in reply to 11 [link] [source]
Can you share a link where rstui.exe can be downloaded for Windows 10?
All google result are from 2013 (or before), from people about missing rstui.exe
(14) By anonymous on 2020-11-17 08:50:49 in reply to 13 [link] [source]
rstrui.exe is on Windows 10 computers and in the search path.
Either right-click Start then select Run and then type rstrui in the box and click OK.
Or get the command prompt, type rstrui followed by enter.
Or simply search for help on restoring to an earlier restore point using Google.
(15) By TripeHound on 2020-11-17 09:37:53 in reply to 13 [link] [source]
Note, the utility (on my Windows 10 machine, at least) is rstrui.exe
– with a second "r". I've no idea whether it used to be rstui
, or whether that's just a common misspelling across t'internet.
(17) By anonymous on 2020-11-17 10:09:17 in reply to 15 [link] [source]
Correct! (is is rstRui.exe & is commonly mis-spelt).
(18) By John McMahon (jmcm54ac) on 2020-11-17 10:56:37 in reply to 15 [link] [source]
I found it here on Win 7:
[C:\Users\John\Documents]
Tue 21:45: which rstrui
rstrui is an external : C:\Windows\system32\rstrui.exe
John
(20) By anonymous on 2020-11-17 14:43:20 in reply to 11 [link] [source]
Thank you for your reply.
The customer tried to do a system restore but there were no restore points.
He then tried to do an uninstall of the Windows update(s) but the uninstall failed.
He contacted Microsoft and they said the way out of it was to re-install the latest version of windows he did- but the problem remained.
Also, sadly at least according to the BT technical experts, we use to try and solve problems of this sort it was a waste of time uninstalling updates because when the PAUSE period expired they would be re-installed!!
(21) By Keith Medcalf (kmedcalf) on 2020-11-17 15:05:01 in reply to 20 [link] [source]
He contacted Microsoft and they said the way out of it was to re-install the latest version of windows he did- but the problem remained.
Define "re-install". There are many types of "re-install" most of which do not actually re-install the OS.
What type of logon is being used?
However, all the "re-install" types will "fix" any buggered file versions. This means that the issue is not related to a Windows Component or "Update", but rather to broken permissions or settings or a corrupt registry or some third-party software that is interfering with the operation of the OS.
Have you tried creating a "new user" to ensure that the problem is not a busted user profile?
(23) By Larry Brasfield (LarryBrasfield) on 2020-11-17 15:18:42 in reply to 20 [link] [source]
Looking over this thread, I see no evidence that sqlite3.exe is even running when whatever form of "does not work" occurs so as to induce such a conclusion. For all I (or anyone else here) can tell from what you have posted, your problem is that, for some reason, sqlite3.exe is not even loaded and executed when your troubles occur. As to why that is, you have provide so few clues that I doubt anybody relying on your meager reporting can reasonably guess what is happening.
You are showing yourself to be someone who has never learned How to Write a Good Bug Report and refuses to do so.
Here is what I know now of the "bug" reproduction steps:
Obtain a PC claimed by "anonymous" to fail in strange and sometimes intermittent ways when some mysterious invocation of SQLite is attempted. (This is necessary because no clue whatsoever is provided as to how things are installed or configured.)
Persuade "anonymous" to do whatever clicking, typing, or RPCs lead to the result that disappoints "anonymous" or his customers who may or may not be doing the same thing with the same setup. (This is necessary because no clue whatsoever is provided as to the manner in which SQLite code is supposed to be run.)
Observe what does or does not happen. Then, probably, interrogate "anonymous" as to what he wished would have happened.
I am quite sure that if I had ever submitted reproduction steps like that in a bug report during my development career, for an employer or client, my work as a developer for them would ended soon afterward.
(24) By anonymous on 2020-11-17 17:07:44 in reply to 23 [link] [source]
Thank you for your reply
(1) The customer's Laptop is a Surface pro and after Microsoft advised him to download the latest version of windows 10 his laptop has Microsoft Windows [Version 10.0.19042.630] the Sqlite version is 3.33.0 2020-08-14 13:23:32 the windows update that appears to have caused the problems described below was November 10, 2020—KB4586786 (OS Builds 18362.1198 and 18363.1198)
The application which failed invoked a command/batch file which included the following command Sqlite3 input.db <android.sql where android.sql is a set of valid sql/sqlite commands creating a data base to be loaded onto an ANDROID mobile device, the same file on an identical computer without the windows update and download produces the data base and exits, but on this customers Laptop it does not create the data base and just opens another command prompt window and displays an sqlite prompt.
Yet The application he uses has successfully worked for over 10 years. and prior to the windows update he has not had this issue before.
I created a simple text file test.sql with just one sqlite command .Help
and at the command prompt typed
sqlite3 <test.txt
The result is that the command is not obeyed and another command prompt window opens and displays the sqlite commmand prompt
If at this command prompt I type
.read test.txt
The help menu is displayed and the command works
I think recreating the problem is not easy.
Many Thanks P.s 1 Fortunately, no other customer has reported the same fault, so the panic is hopefully now over, and this customer has an identical contingency plan fail-safe back up laptop and is working successfully on his fail-safe laptop. and attempts to get the original working laptop are still ongoing.
P.S. 2Perhaps an online BUG report form would help those who want to report possible bugs to you. and the option to attach screen shots or video recordings of the bug. happening would help to see the problem taking place.
W
(25) By tom (younique) on 2020-11-17 20:52:09 in reply to 24 [link] [source]
Is the first shell a powershell or the new terminal app? Perhaps, try:
start /b sqlite3 database.db .read test.txt
(26) By Warren Young (wyoung) on 2020-11-17 21:12:57 in reply to 25 [link] [source]
Is the first shell a powershell
If it is, it explains some of what's being reported here, since PowerShell lacks redirect-in-from, a.k.a. the <
operation. You'd need to use Larry's pipe-thru alternative to achieve the OP's desired end with PowerShell.
I don't see that this explains the secondary command window, though.
(28) By Larry Brasfield (LarryBrasfield) on 2020-11-17 22:25:57 in reply to 26 [link] [source]
I doubt there was a secondary command window. I think the OP uses the term "command prompt window" loosely to refer to either {what we call a "command prompt window"} or {a Windows console window opened for a console program}.
(30) By RandomCoder on 2020-11-17 23:08:47 in reply to 26 [link] [source]
Unfortunately, it's probably not a Powershell issue. It lacks the redirect-in-from operator, but it provides a very big and fairly obvious error if you try.
PS> sqlite3 < this_doesnt_matter.txt
At line:1 char:9
+ sqlite3 < this_doesnt_matter.txt
+ ~
The '<' operator is reserved for future use.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RedirectionNotSupported
(27) By Larry Brasfield (LarryBrasfield) on 2020-11-17 22:09:05 in reply to 24 [link] [source]
I am going to try to help you, provided that you are willing to help me do that.
Let's dispense with bug reporting forms and screen shots; those would be a distraction and/or impossible in this forum. However, I will reiterate the essential contents of a useful bug report: (1) Identifying the necessary preconditions to demonstrate the problem, such as operating system, possibly its version, the software alleged to have a "bug", its version(s), and any data files that will have to be used in the reproduction steps; (2) reproduction steps, with enough detail for a person unfamiliar with your system and its configuration to follow, elaborating what sequence of steps must be performed to make the alleged "bug" manifest itself; (3) an objective description, not a summary or conclusion, of what happens when the reproduction steps are taken that is alleged to be incorrect; and (4) Unless it would be obvious to a person trying to replicate the "bug", an objective description of the expected or desired behavior that differs from what happened that is supposedly incorrect.
You have begun to provide these elements, enough that some progress may be made although there is much missing information. What I ask you to do below will provide some of that missing information which will assist me and others to understand what has gone wrong.
Please start a CMD shell by entering on the keyboard <WindowsKey>-R
, then typing cmd.exe
in the combo-box labeled 'Open:', then left-clicking 'OK'.
In the window that appears, whose title bar should read 'C:\WINDOWS\system32\cmd.exe', type the following followed by <EnterKey> for each line:
where sqlite3
where sqlite3.exe
path
Then, left-click the icon in the upper left corner of the window, left-click the 'Edit' menu item, left-click the 'Mark' submenu item, then do a left button drag with the pointer starting just above the 'where sqlite3' you entered and ending just below the response to your 'path' command. While the two commands and their responses are highlighted, left-click that icon again, left-click the 'Edit' submenu item, then left-click the 'Copy' submenu item. These operations will be called "taking a screen scrape" later. They should result in the highlighted text being in the Windows clipboard. Paste that into your response in this thread, (using control-V), perhaps with enough identification that others can know why you posted it. This will show the location of what actually executes when you enter 'sqlite3' at a command-line shell prompt.
If the responses to 'where sqlite3' and 'where sqlite3.exe' differ, we will be exploring why because that would likely be part of your problem.
I presume that when you say 'at the command prompt' you mean in a window just like the one you get via the '<WindowsKey>R, cmd.exe' sequence. If that is not so, you need to explain what it is. (There is some doubt on this because cmd.exe has understood simple input redirection via '<' for 30+ years, whereas you seem to maybe be using a shell which does not. )
Depending upon the screen scrape you post, troubleshooting this will take different paths, so I will not try to elaborate them all here.
(32) By anonymous on 2020-11-18 08:19:16 in reply to 27 [link] [source]
Thank you for your reply.
I am very grateful to those Forum members who have tried to suggest solutions and diagnostic tests to try and find the answer, and those who appreciated that if a windows update was making Sqlite unusable in some applications this would be very serious for not only all our customers who to go on trading rely on SQLITE but all Sqlite users.
But, as a company director whose job is to try and ensure his customers can carry on trading by using our application; my main objective was to get the customer into a position where he can go on trading and then to try and sort out the problems with SQLITE on his Laptop while he uses the fail safe Laptop.
By the use of our contingency planning and fail-safe "systems" this main objective has now been achieved!!!
So we feel the best and simplest solution now is to do a complete reset of the Laptop re-loading windows and all the applications if this solves the problem we will not waste any more of your time or ours, but if not this would suggest the problem was likely to affect all SQLITE users and we will provide you with a full and comprehensive bug report and carry out every test your forum members have kindly suggested and we thank them for.
But for the moment, I feel it is best this thread be closed.
.
(29) By RandomCoder on 2020-11-17 23:05:14 in reply to 24 [link] [source]
I created a simple text file test.sql with just one sqlite command .Help
and at the command prompt typed
sqlite3 <test.txt
This command should have resulted in a locale correct version of "The system cannot find the file specified.". If it didn't, either something is really broken with your system, or, more likely, you're not being exact in your problem description.
Can you create a text file, called test.txt containing at least 100 lines of text, and try running something like:
more < test.txt
If that command fails, you have some basic failure of the shell that will probably necessitate someone familiar with issues on Windows looking at the machine. I suspect debugging will be a fruitless endeavor, as we're probably missing something that to a subject matter expert would be obvious, but you're ignoring it because its something of unknown importance to you.
(31) By luuk on 2020-11-18 08:03:59 in reply to 24 [link] [source]
When you do a rightclick on sqlite3.exe, on the tab 'Compatibility' the checkbox 'Run this program in compatibility mode for' should NOT be checked.
If this is check, there is a possibility a new window is opened when running sqlite3