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
Error: Couldn't initialize the scanner: An unknown error occurred #198
Comments
I should add, reverting to |
NPM wouldn't allow me to install |
I am setting up a new instance of my nodejs app (today) and was receiving some strange errors with the drivelist module when trying to run it. Googling led me to this issue somehow. My app fails with v5.0.27 so I reverted to v5.0.25 which I knew worked from a previous instance. Can't contribute more than this anecdote, I will need to look at what changed between these versions... |
Sorry about that. We're adopting an company wide technology to handle automated versioning and deployment, and things didn't go very smoothly on certain versions, which have not been published to npm. The new drivelist version contains a very large change, where we re-wrote the Windows drive scanning routines in C++, to workaround a bug coming from WMI itself, where the reported drive sizes were not accurate for some drives. Can you guys try to re-run drivelist with the git clone https://github.com/resin-io-modules/drivelist
cd drivelist
npm install
set DRIVELIST_DEBUG=1
node example That should provide debugging information so we can pin-point the issue. |
When I do this, all I see in the command prompt is:
Nothing else is printed. |
Thanks a lot @barchard. Can you try the |
i tried building the branch then re-building it for electron. re-building the module for electron, however, fails. do you have instructions for getting it built and installed? thanks |
What error message do you get? I'm on Windows 10 with Node.js 6.1.0 and it works fine here. Try the following: git clone https://github.com/resin-io-modules/drivelist
cd drivelist
git checkout debug-com
npm install
set DRIVELIST_DEBUG=1
node example |
My (probably unrelated) issue was fixed when I used nodejs 6.4.0 because apparently between v5.0.25 and v5.0.27 you used arrow notations and they aren't supported in 5.12.0 (what I was using before). Oops! |
I seem to get the same error @jviotti following your instructions I get this output: [drivelist] Initializing scanner |
Ok, investigated a bit further, it appears to be tripping over a mounted virtual device. I have a "boxcryptor classic" drive mounted on Z:. If I unmount that, the example runs fine. |
I can confirm what TanninOne reported. |
Running the latest debug branch with the instructions provided worked for me. Thanks. |
Awesome, thanks a lot for the help here. I'll send a PR fixing the virtual device issue and release a new version very soon! |
Drivelist currently crashes if there is a virtual drive mounted. The best solution I could find is to check that the resulting error from IOCTL_STORAGE_GET_DEVICE_NUMBER is "Invalid function." Change-Type: patch Changelog-Entry: Fix "Couldn't scan the drives: An unknown error occurred" where there is a mounted virtual drive. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
It seems as though all the various reports of this bug are from people running Windows 10. Do we know if this is because the bug (or bugs) are specific to Windows 10, or is it just because most people happen to be running Windows 10 now? |
I am running the creators update of Windows 10. Nothing I am aware of changed on the system with regards to drives. Only thing I've possibly changed is:
1. Installed a USB Bluetooth dongle
2. Rebooted
Maybe rebooting fixed it.
…Sent from my iPhone
On Jul 31, 2017, at 8:46 AM, Andrew Scheller ***@***.***> wrote:
It seems as though all the various reports of this bug are from people running Windows 10. Do we know if this is because the bug (or bugs) are specific to Windows 10, or is it just because most people happen to be running Windows 10 now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Drivelist currently crashes if there is a virtual drive mounted. The best solution I could find is to check that the resulting error from IOCTL_STORAGE_GET_DEVICE_NUMBER is "Invalid function." Change-Type: patch Changelog-Entry: Fix "Couldn't scan the drives: An unknown error occurred" where there is a mounted virtual drive. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Wouldn't be the first time that fixed a random Windows error... 🤣 |
We use global functions to initialize COM. If the client executes multiple scan operations at the same time on the same process, then COM will be initialized twice, eventually resulting in an error. The error is `RPC_E_TOO_LATE`, which according to the Windows documentation, means that COM was already initialized. This commit workarounds the initialization error by catching this HRESULT and assuming everything is fine, but the correct solution is to get rid of COM altogether. Change-Type: patch Changelog-Entry: Fix "Couldn't initialize the scanner: An unknown error occurred" error. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@barchard We eventually got to the bottom of it. The issue happens when there are multiple drivelist scans happen in parallel on the same process. COM is initialized globally for the current process, so when multiple scans happen at the same time, they both try to initialize COM at the same time, which eventually fails. |
We use global functions to initialize COM. If the client executes multiple scan operations at the same time on the same process, then COM will be initialized twice, eventually resulting in an error. The error is `RPC_E_TOO_LATE`, which according to the Windows documentation, means that COM was already initialized. This commit workarounds the initialization error by catching this HRESULT and assuming everything is fine, but the correct solution is to get rid of COM altogether. Change-Type: patch Changelog-Entry: Fix "Couldn't initialize the scanner: An unknown error occurred" error. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Nice! Good catch 👍
…Sent from my iPhone
On Jul 31, 2017, at 12:29 PM, Juan Cruz Viotti ***@***.***> wrote:
@barchard We eventually got to the bottom of it. The issue happens when there are multiple drivelist scans happen in parallel on the same process. COM is initialized globally for the current process, so when multiple scans happen at the same time, they both try to initialize COM at the same time, which eventually fails.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Drivelist currently crashes if there is a virtual drive mounted. The best solution I could find is to check the resulting error from IOCTL_STORAGE_GET_DEVICE_NUMBER. Change-Type: patch Changelog-Entry: Fix "Couldn't scan the drives: An unknown error occurred" where there is a mounted virtual drive. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Drivelist currently crashes if there is a virtual drive mounted. The best solution I could find is to check the resulting error from IOCTL_STORAGE_GET_DEVICE_NUMBER. Change-Type: patch Changelog-Entry: Fix "Couldn't scan the drives: An unknown error occurred" where there is a mounted virtual drive. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We use global functions to initialize COM. If the client executes multiple scan operations at the same time on the same process, then COM will be initialized twice, eventually resulting in an error. The error is `RPC_E_TOO_LATE`, which according to the Windows documentation, means that COM was already initialized. This commit workarounds the initialization error by catching this HRESULT and assuming everything is fine, but the correct solution is to get rid of COM altogether. Change-Type: patch Changelog-Entry: Fix "Couldn't initialize the scanner: An unknown error occurred" error. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We use global functions to initialize COM. If the client executes multiple scan operations at the same time on the same process, then COM will be initialized twice, eventually resulting in an error. The error is `RPC_E_TOO_LATE`, which according to the Windows documentation, means that COM was already initialized. This commit workarounds the initialization error by catching this HRESULT and assuming everything is fine, but the correct solution is to get rid of COM altogether. Change-Type: patch Changelog-Entry: Fix "Couldn't initialize the scanner: An unknown error occurred" error. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Drivelist currently crashes if there is a virtual drive mounted. The best solution I could find is to check the resulting error from IOCTL_STORAGE_GET_DEVICE_NUMBER. Change-Type: patch Changelog-Entry: Fix "Couldn't scan the drives: An unknown error occurred" where there is a mounted virtual drive. Fixes: #198 Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@mubed all of the discussions here have been in regards to version |
@mubed v1.1.2 is the latest version of Etcher. |
Hi, I have started receiving this error on Win10 (Creators Update) in Node + Electron. I am getting this error when calling
.list()
method in order to list devices. Strangely, this was previously working. Obviously, the error is vague so I'm not sure how to proceed. Any advice is appreciated. ThanksThe text was updated successfully, but these errors were encountered: