Bam Margera's friends are trying to get him help as his alarming behavior continues, but an attempted intervention on his behalf didn't take ... TMZ has learned.
Sources close to Bam tell us ... a couple of Bam's longtime friends organized the intervention earlier this month, while he was in San Diego, on the heels of his L.A.-area arrest for public intoxication.
Our sources say Bam's buddies told him they loved him and were worried about him and wanted to help get him back into rehab.
We're told Bam seemed receptive at first, but ultimately a couple of factors blew the whole thing up.
For starters, our sources say Bam's current girlfriend was not receptive to the idea, and didn't want him to leave for treatment, because she would have nowhere to live if he went to rehab.
What's more, we're told Bam's estranged wife Nikki was called during the intervention and made it clear she was willing to let him back into her and their son Phoenix's life, contingent on Bam getting sober. Our sources say this upset the girlfriend, and she kicked everyone out.
The failed intervention went down shortly after we obtained video of Bam screaming at Nikki as she ate with Phoenix in a Burbank restaurant ... an outburst that came minutes before Bam was busted for public intoxication.
The former 'Jackass' star -- who has been in and out of rehab for years due to addiction and substance abuse issues -- is in more legal trouble, this time on the other side of the country.
TMZ broke the story ... the Pennsylvania State Police say Bam got into an altercation with his family and then made a getaway into the woods ... and there's a warrant out for his arrest.