It's certainly different from Afghanistan. The invasion of Afghanistan by the United States was preceded by an attack by Al Qaeda on New York City. The attack by Russia on Ukraine is completely unprovoked.
I'm not aware of Ukraine kicking out weapons inspectors from known previous WMD sites, or bluffing about having CBRN weapons. The invasion of Iraq was bumbling and based on piss-poor intelligence, but the belief in a threat wasn't groundless. https://www.csmonitor.com/layout/set/amphtml/World/Global-Ne...
The current Russian claims about Ukraine, however, do appear groundless, based on the consensus of international media.
The belief in a threat was manufactured by cherry-picking any weak scraps of intelligence that could be assembled into a believable marketing pitch for an invasion. Your average mouthbreathing intel analyst wouldn’t recommend invading a taco stand based on the shady sources and thin reporting used to justify this war.
Although I am certainly not well informed, as I could not predict this scale of military operation, I'd like to say that "consensus of international media" is not worth much at times of war. Because I feel like there is never a lot of disagreement in media during such crises. Maybe after, when the situation calmed.
It's a closer match than Afganistan at least, although I don't think that Ukraine under Zelenskyy is remotely similar to Iraq under Saddam Hussein. Let's hope that Ukraine backfires on Russia at least as severely as Iraq did on the US.
I also feel like I'm being obvious here: Al Qaeda was sheltered by Afghanistan during and after the attack on NYC. (I agree that there were essentially no ties between Al Qaeda and Iraq.)