GoogleChromeLabs / chromeos_smart_card_connector

Smart Card Connector App for Chrome OS
https://chrome.google.com/webstore/detail/smart-card-connector/khpfeaanjngmcnplbdlpegiifgpfgdco
Apache License 2.0
133 stars 50 forks source link

Error -2146435049 since last update #1097

Closed Test18415 closed 8 months ago

Test18415 commented 9 months ago

Since the last update of smart connector reader app in the webstore (October 11), we have a problem. After using the nfc for a while, the smart card connector stops working, and from then everytime the nfc is put on the smartcardreader the smart connector app throws error "-2146435049". Only a reboot of the chromebox fixes the problem temporarily.

emaxx-google commented 9 months ago

Hello, thank you for the report. -2146435049 means SCARD_E_READER_UNAVAILABLE; I'm unaware of other reports of this problem.

Could you please share more details - the reader you're using, logs from the affected device, etc.? Feel free to reach out offline to cros-smartcard-support@google.com if you'd like to share these privately.

emaxx-google commented 9 months ago

Also how much time one needs for the error to happen? Is it minutes/hours/days of work? Does the reader have to be actively used all the time, or the breakage happens at some time point regardless of that?

Test18415 commented 9 months ago

It seems to be completely random, we have had yesterday this problem on 50 devices at completely different times (even when the app is not used, we know because we detect the error in the logs) But after the error happens once, it keeps happening until a reboot.

The reader is the "ACS ACR1252 Dual Reader" [16/10/2023 5:1:38] Connect to the reader: ACS ACR1252 Dual Reader 00 00(js/nfcreader.js startReadingCard) [16/10/2023 5:1:38] Card connect error code -2146435049(js/nfcreader.js onCardConnectError)

For logs, we use a kiosk device, the logs shown here are own custom app logs from the kiosk devices we have through the country, I will try to reproduce the problem so that I can get smart connector app logs from my chromebook, because I suspect we can't get these logs remotely.

emaxx-google commented 9 months ago

Thank you for these additional details. We'll try reproducing this on our end, although obviously we cannot recreate the same environment.

Regarding kiosk logs, it should be possible to use remote desktop admin console capabilities to connect to the device and collect the chrome://device-log extension logs, or to trigger a feedback report to send the log archive to Google.

emaxx-google commented 9 months ago

I've written a stress-test that simulates the scenario of inserting/removing a card with connection/disconnection to it, and discovered one problem: #1098. I'm working on a fix for it. Other than that, a few millions of iterations haven't exhibited any other bugs, although obviously the test scenario is very limited...

Test18415 commented 9 months ago

Okay nice, it could be related. To get the device logs we are currently running a test setup with 8 devices, it has a 1 in 10 chance possibility to happen on a given day. If we don't get any result before the end of the week, we will convert 3 production devices, until we have it reproduced.

emaxx-google commented 9 months ago

@Test18415: Hi, in your test environment, do you have possibility to switch to the Beta distribution of Smart Card Connector? (https://chromewebstore.google.com/detail/smart-card-connector/mockcojkppdndnhgonljagclgpkjbkek)

I'm about to publish the tentative fix as the 1.4.0.123 version of this Beta app.

Test18415 commented 9 months ago

@emaxx-google Thank you for the update. I think we are able to, since it is in the offical chrome webstore. I guess the best route would than be that we update the software as soon we have reproduced the error without the beta version, to have formal proof that our test works, than we install beta version to check if it has resolved the problem.

emaxx-google commented 9 months ago

The fixes are ready to land now, but in case you can confirm quickly whether that fix (already published as 1.4.0.123 of the Beta app) actually helps, I'd wait for your reply before rolling it out.

emaxx-google commented 8 months ago

Per offline communication, that fix (that went in 1.4.1) didn't help. However, I have a different suspect now: the potential culprit is #1079; the alternative way of fixing it should be #1104.

emaxx-google commented 8 months ago

We've published release 1.4.2 with another attempt to fix this bug, based on the commit https://github.com/LudovicRousseau/CCID/commit/f5a731e65f1c6b891b2be75c6e7c5e46de5e83dd.

Test18415 commented 8 months ago

Thank you for the update, I have confirmed that the bug has been solved!

emaxx-google commented 8 months ago

Thanks for confirming that! I'll work on adding regression tests.