Could also be you're squeezing to hard with your fretting hand, and digging in too hard with your plucking hand, all while too tense, with bad posture.
If that's the case, as physical therapists say, "Motion is Lotion."
- Find some exercises that move, strengthen, and stretch your fingers, wrists, forearms and shoulders.
- Stretch your hamstrings. Not even joking. Had incredible shoulder pain & discomfort, that would go down to the elbow and even to the hand causing weakness when it was really acting up. Stretching my hamstrings was the number 1 thing to improve that shoulder/elbow/hand issue.
- If you have a Theragun, they're magical at beating out knots and tightness. They're not a "fix" but they definitely help in the short term to lessen the knots & pain, and help the other exercises. A Tens machine can be helpful too. Again, not going to fix the problem, per se, but will help loosen it up so you can do proper stretches and exercises to fix the problem.
- If possible, see a physical therapist. There are even PTs who work with musicians, to help them modify their playing style and posture to stop causing harm to their bodies that prevent them from playing.
- Play as relaxed as possible. Your fretting hand should only squeeze enough so that the note plays clearly without fretbuzz. If you squeeze too hard your fingers, hand, and forearm are gonna stiffen up and cramp.
- Stretch & warm up before you play. Not just warm up a few musical phrases on your bass. Literally warm up your muscles by doing stretching before you play. Chopin used to literally soak his wrists in warm water to warm up his muscles before recitals.
- Make sure you're drinking enough water (and not undoing it by drinking too many diuretics or things that dehydrate.)
- Like others have said, vitamins and minerals are important. And also, i've started taking collagen powder supplement & protein powder for my climbing gym training. They both promote muscle and tendon recovery.
- Turmeric + black pepper + ibuprofen will help reduce inflamation.
- Don't use your computer keyboard/trackpad/mouse, your phone, or your bass for a bit. Those are only going to further irritate the injury and make it take longer to heal.
Of course, none of this guarantees you'll be 100% for your gig tonight. It might take quite a bit of stretching and exercising over time to get rid of the current issue. But the good news is they'll all be helpful in preventing it from happening again. If you do have access to a Theragun. Take it to the show and pound out your stiff areas all the way from your hand up through your shoulder and neck, and even down your back a bit. Do it before you go on. If you have breaks between sets, give yourself a few minutes of theragun then too. And then after you play a bit to prevent it from tightening back up again, to some extent.
--
This next bit isn't directed at you, OP. It's more a general statement:
When people point out "bad ergonomic technique" online, it's not because we feel the need to tell other people how to play, or mansplain, or criticize. There is no "bad technique" unless it prevents you from playing the bassline, or it causes injury. I always see people getting defensive about their injury-prone-technique getting criticized. But really, the damage and pain it causes is real.
And you might play with that bad technique for years and think there's nothing wrong with it, until something debilitating happens. These injuries go from "i feel fine" to "i can't use my hand and it's incredibly painful and will take years of rehab to get the pain to stop" seemingly overnight, after years of "it feels fine, i don't see what the problem is," or, "well this is just the way i do it!" Doing it your own way is fine, except for when it's not.
I've always been cognizant of my wrist position and not squeezing too hard. Of course, i never paid much mind to my posture. I'd wear my bass on my shoulder for 3, 4, 5, 6 hour jams and practices and shows without taking breaks or stretching or doing anything to strengthen the muscles. I was young and thick-headed and though i could handle it; thought it made me strong, powering through like that. Well, I am VERY feeling it now, decades later. It's taken several years of seeing different doctors and PTs/Physios and MRIs, and Xrays, and physical tests & exams just to figure out exactly what the root cause of the problem is, and it's taken years of stretching and gym time to get me back to baseline. (And it'll probably take that for the rest of my life.) And if you saw me, you'd think i was an incredibly healthy in-shape person.
So,
@PennyroyalWe i hope you can get this fixed asap. And i hope it doesn't become a chronic injury. Seriously. And i hope any of our suggestions help it feel better. And if at all possible, i hope you can see a doctor & PT and they can tell you what could have triggered this, and how to prevent it. I'm gonna go stretch now, because just talking about pains makes me hurt a little.