The flash does sometimes does not work when it is connected to the USB port?
The flash drive sometimes does not work when it is connected to the USB hub?
If the answer is yes to both of these I'd blame the USB ports. You might want
to try some other devices as well. See if it is just the USB flash drive.
Getting some consistency is probably a good start.
If there was a point when the flash drive worked (with an older
distribution/different distribution/different OS) I'd probably try testing it
with that again (if possible) and see if it is still being unreliable.
I tend to replace hardware when things start to fail. It just isn't worth the
time and energy to put too much into it. Hardware is being made cheaper and
cheaper. Particularly post 2000. Even if it isn't free of cost it will
ultimately fail. The chemicals used to make hardware last were outlawed by
the European Union. It doesn't mean everything fails immediately although it
does mean older hardware is pretty much guaranteed to fail sooner and don't
ever expect hardware to last 20 years. While a system 20 years ago might
still be ticking today much more of what was made just 10 years ago is
already dead.