This is a blend of “rub the wrong way” (irritate someone) and “barking up the wrong tree” (wrong about the reason for something), resulting in perhaps embarrassment to the speaker. A rubber tree image or thought might also be in the mix. A special thanks to Allen Muir for sending this one in!
The speaker was obviously meaning to say “every cloud has a silver lining”, but where did the tree come from? Possibly he was thinking of a silver maple, those messy trees that every yard seems to have. Or, as my “ol pal” suggests, the word “sliver” instead of “silver” floated up in the brain soup, suggesting wood. “Barking up the wrong tree” also might have been in the mix, even though the meaning is not remotely close to the intended meaning. Any other suggestions out there? Thanks to Art for sending this one to the site.
This is a conflation of “barking up the wrong tree” (making the wrong choice) and “up a blind alley” (at a dead end). The confusion seems to lie in the shared word “up”, and that both idioms describe frustration and negativity. “Right up my alley” may also be in play here, juxtaposing wrong and right. And lets not forget those dogs that bark incessantly in alleys.