assuming it is a mosin. it is likely built up cosmoline in the chamber. Easiest way I know to take care of it is find a cheap deep pot you don't care about. Fill it full of boiling water, and stick the chamber end in the water for a few minutes. Conversely you can pour the boiling water down the barrel.
Then hit is with a chamber brush, and your choice of solvent.
If there is gunk in the bolt itself, you can make a mix of mineral spirits and ATF fluid (3:1 or 4:1 ratio, work well. ) and soak the gunked up part overnight. I don't recommend this if there are any plastic parts in the bolt. The stuff can eat plastic. But I use it to clean old cosmo, or oils that have turned to shellac frequently.