René's URL Explorer Experiment


Title: onlykey-agent fails after another app uses the OnlyKey · Issue #88 · trustcrypto/python-onlykey · GitHub

Open Graph Title: onlykey-agent fails after another app uses the OnlyKey · Issue #88 · trustcrypto/python-onlykey

X Title: onlykey-agent fails after another app uses the OnlyKey · Issue #88 · trustcrypto/python-onlykey

Description: On Linux, onlykey-agent intermittently fails to open the OnlyKey's HID interface with a OSError: open failed error. It then works fine on the next invocation. The issue can be reliably reproduced when the OnlyKey was just used by another...

Open Graph Description: On Linux, onlykey-agent intermittently fails to open the OnlyKey's HID interface with a OSError: open failed error. It then works fine on the next invocation. The issue can be reliably reproduced w...

X Description: On Linux, onlykey-agent intermittently fails to open the OnlyKey's HID interface with a OSError: open failed error. It then works fine on the next invocation. The issue can be reliably reproduc...

Opengraph URL: https://github.com/trustcrypto/python-onlykey/issues/88

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"onlykey-agent fails after another app uses the OnlyKey","articleBody":"On Linux, `onlykey-agent` intermittently fails to open the OnlyKey's HID interface with a `OSError: open failed` error. It then works fine on the next invocation. \n\nThe issue can be reliably reproduced when the OnlyKey was just used by another application (e.g. KeePassXC HMAC-SHA1 challenge-response) or after a previous onlykey-agent run was interrupted with CTRL-C.\n\n## Environment\n\nArch Linux, [`hidapi`](https://archlinux.org/packages/extra/x86_64/hidapi/) with the [cython backend](https://github.com/trezor/cython-hidapi) resolving to `libusb` (`libhidapi-libusb`).\n\n```bash\n$ B=/home/fidel/.local/share/uv/tools/onlykey-agent/lib/python3.13/site-packages\n$ ldd \"$B/hid.cpython-313-x86_64-linux-gnu.so\"    | grep -i usb\n# uses libusb\nlibusb-1-150b88da.0.so.0.1.0 =\u003e /home/fidel/.local/share/uv/tools/onlykey-agent/lib/python3.13/site-packages/hidapi.libs/libusb-1-150b88da.0.so.0.1.0 (0x00007efee2c00000)\n$ ldd \"$B/hidraw.cpython-313-x86_64-linux-gnu.so\" | grep -i usb\n# no libusb\n```\n\n## Symptoms\n\n```\n# Do one of these things:\n# 1. Open a KeepassXC DB using Onlykey for HMAC\n# 2. Run `onlykey-agent` but abort with CTRL-C when seeing the button challenge.\n#    Then complete the challenge in OnlyKey and try onlykey-agent again.\n\n$ onlykey-agent \u003cidentity\u003e -- ssh \u003cserver\u003e\nERROR  failed to connect  [client.py]\nTraceback (most recent call last):\n  File \".../onlykey/client.py\", line ..., in _connect\n    self._hid.open_path(self.path)\n  File \"hid.pyx\", line 158, in hid.device.open_path\nOSError: open failed\n```\n\nRe-running the exact same command immediately afterward succeeds. Notably, waiting any amount of time does not help, only running the command a second time does.\n\n## The problem: libusb-backed hidapi\n\nOn my setup, `hid.enumerate()` returned `libusb`-style paths and zeroed usage pages:\n```\npath=b'1-3:1.2' usage_page=0x0 interface_number=2 ...\n```\n\nThe `hidraw` backend uses the device directly:\n```\npath=b'/dev/hidraw14' usage_page=0xf1d0 interface_number=2 ...\n```\n\nRunning `udevadm monitor --udev --subsystem-match=hidraw` when using the libusb-backed hidapi shows how the device id increments every time (0026, 0027, 0028...) as libusb detaches/reattaches the kernel driver:\n```\nUDEV  [6514.362533] remove   /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:13:00.0/usb1/1-3/1-3:1.0/0003:1D50:60FC.0026/hidraw/hidraw12 (hidraw)\nUDEV  [6514.478417] add      /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:13:00.0/usb1/1-3/1-3:1.0/0003:1D50:60FC.0027/hidraw/hidraw12 (hidraw)\nUDEV  [6515.641427] remove   /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:13:00.0/usb1/1-3/1-3:1.0/0003:1D50:60FC.0027/hidraw/hidraw12 (hidraw)\nUDEV  [6515.980519] add      /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:13:00.0/usb1/1-3/1-3:1.0/0003:1D50:60FC.0028/hidraw/hidraw12 (hidraw)\nUDEV  [6516.220419] remove   /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:13:00.0/usb1/1-3/1-3:1.0/0003:1D50:60FC.0028/hidraw/hidraw12 (hidraw)\nUDEV  [6516.565550] add      /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:13:00.0/usb1/1-3/1-3:1.0/0003:1D50:60FC.0029/hidraw/hidraw12 (hidraw)\n```\n\nUsing `hidraw` there is no detaching and reattaching.\n\n## Fix\n\nPrefer the `hidraw` backend on Linux, with a fallback to the current `hid` one. The change is minimal in *onlykey/client.py*. I will submit a PR with this fix.\n\nThe `hidraw` module exposes the same API, so no other code changes should be needed.","author":{"url":"https://github.com/haplo","@type":"Person","name":"haplo"},"datePublished":"2026-06-07T21:31:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/88/python-onlykey/issues/88"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8bebfd9b-732f-f5e6-3740-be5fb2e90f6f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCE42:56614:4A1345:652821:6A5CC700
html-safe-nonce25ab31123eda84469332e8014a35b7382ae334beae442c95dbbb8bcfdfec4fff
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTQyOjU2NjE0OjRBMTM0NTo2NTI4MjE6NkE1Q0M3MDAiLCJ2aXNpdG9yX2lkIjoiOTA5OTA0NTI5MzkwNDQxNDQ2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaccd155b4d8a99ccb96c5ac6d39dd1937b761fa0a8a9f1d44243cc0263ae02f124
hovercard-subject-tagissue:4608785780
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/trustcrypto/python-onlykey/88/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4104df4726a3bf399450ba73de3b211f0efe9cf83a0add88f614f06ba287e4a7/trustcrypto/python-onlykey/issues/88
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4104df4726a3bf399450ba73de3b211f0efe9cf83a0add88f614f06ba287e4a7/trustcrypto/python-onlykey/issues/88
og:image:altOn Linux, onlykey-agent intermittently fails to open the OnlyKey's HID interface with a OSError: open failed error. It then works fine on the next invocation. The issue can be reliably reproduced w...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehaplo
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
go-importgithub.com/trustcrypto/python-onlykey git https://github.com/trustcrypto/python-onlykey.git
octolytics-dimension-user_id22034835
octolytics-dimension-user_logintrustcrypto
octolytics-dimension-repository_id67296372
octolytics-dimension-repository_nwotrustcrypto/python-onlykey
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id67296372
octolytics-dimension-repository_network_root_nwotrustcrypto/python-onlykey
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/trustcrypto/python-onlykey/issues/88#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftrustcrypto%2Fpython-onlykey%2Fissues%2F88
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftrustcrypto%2Fpython-onlykey%2Fissues%2F88
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=trustcrypto%2Fpython-onlykey
Reloadhttps://github.com/trustcrypto/python-onlykey/issues/88
Reloadhttps://github.com/trustcrypto/python-onlykey/issues/88
Reloadhttps://github.com/trustcrypto/python-onlykey/issues/88
Please reload this pagehttps://github.com/trustcrypto/python-onlykey/issues/88
trustcrypto https://github.com/trustcrypto
python-onlykeyhttps://github.com/trustcrypto/python-onlykey
Notifications https://github.com/login?return_to=%2Ftrustcrypto%2Fpython-onlykey
Fork 26 https://github.com/login?return_to=%2Ftrustcrypto%2Fpython-onlykey
Star 52 https://github.com/login?return_to=%2Ftrustcrypto%2Fpython-onlykey
Code https://github.com/trustcrypto/python-onlykey
Issues 20 https://github.com/trustcrypto/python-onlykey/issues
Pull requests 14 https://github.com/trustcrypto/python-onlykey/pulls
Actions https://github.com/trustcrypto/python-onlykey/actions
Projects https://github.com/trustcrypto/python-onlykey/projects
Security and quality 0 https://github.com/trustcrypto/python-onlykey/security
Insights https://github.com/trustcrypto/python-onlykey/pulse
Code https://github.com/trustcrypto/python-onlykey
Issues https://github.com/trustcrypto/python-onlykey/issues
Pull requests https://github.com/trustcrypto/python-onlykey/pulls
Actions https://github.com/trustcrypto/python-onlykey/actions
Projects https://github.com/trustcrypto/python-onlykey/projects
Security and quality https://github.com/trustcrypto/python-onlykey/security
Insights https://github.com/trustcrypto/python-onlykey/pulse
#89https://github.com/trustcrypto/python-onlykey/pull/89
onlykey-agent fails after another app uses the OnlyKeyhttps://github.com/trustcrypto/python-onlykey/issues/88#top
#89https://github.com/trustcrypto/python-onlykey/pull/89
https://github.com/haplo
haplohttps://github.com/haplo
on Jun 7, 2026https://github.com/trustcrypto/python-onlykey/issues/88#issue-4608785780
hidapihttps://archlinux.org/packages/extra/x86_64/hidapi/
cython backendhttps://github.com/trezor/cython-hidapi
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.