No rule for this one
No ending or word group predicts the article of Bug. Learn it as a pair and say it out loud: der Bug.
der Bug
It's der Bug. Bug is masculine, plural die Bugs.
Es gibt einen Bug.
There is a bug.
No ending or word group predicts the article of Bug. Learn it as a pair and say it out loud: der Bug.