Recovering from USB device driver is still in memory / USB Composite Device has error (Code 38)

Something you don’t often think about is how many devices you plug into your computer …….. until you plug-in a device and it doesn’t show up or interact as expected. This post details how I recovered from such a situation so I can find it next time, and hopefully it also helps others recover quickly, rather than the numerous dead-ends I went through to fix the problem.

My Situation

I’ve been evaluating a number of different YubiKey’s recently and out of the blue they stopped being recognised. Below is a message from the YubiKey Manager indicating that there is no device inserted (when in actual fact there is).

Insert YubiKey

To prove the point, plugging in two YubiKey’s informs me I should only have one at a time.

Insert only one YubiKey

Going into Device Manager and selecting Show hidden devices reveals the plethora of USB devices I’ve previously inserted into my computer.

Yubikey Device Manager Properties

Looking into the USB Composite Device‘s with the warning symbols reveals

Windows cannot load the device driver for this hardware because a previous instance of the device driver is still in memory. (Code 38)

USB Composite Device Manager

The Fix

After trying numerous different avenues, this is how I repaired the issue and got up and running again.

Navigate to Windows => Settings => Update and Security => Troubleshoot => Run the troubleshooter

Hardware Troubleshooter.PNG

The troubleshooter will detect the USB Composite Device has error for the devices being problematic. Select one and continue.

USB Composite Devices has error

Select Apply this fix

Apply Fix

Repeat for other USB Composite Device has error errors. Then Restart the computer.

Restart PC

After Restart you should be back in action like I was.

YubiKey Manager - Success.PNG

Hope this helps someone else, and will help me find it next time too.