Lately I've been spending most of my time fixing bugs and maintaining legacy code

Lately I've been spending most of my time fixing bugs and maintaining legacy code, with hardly any chance to build new features. Every day feels the same and I'm not learning much. Has anyone else dealt with this? How do you stay motivated and find ways to grow when you're stuck doing maintenance?