This happens when your soil gets too wet and has bad drainage. The soil "rots". The smell can transfer to your plants and becomes especially noticeable if you have incorrectly cured. There's a good chance you stopped drying too early.
If you're lucky, you can leave your jars open for a day or two then restart the curing process. This may fix it. Also some strains just smell like "cat piss" (ammonia).