First lets see if you can clear it by resetting SMC [https://support.apple.com/en-us/HT201295|How to reset the System Management Controller (SMC) on your Mac] also make sure you are using a real MagSafe charger and its cord or connector is not damaged. Review this Apple T/N [https://support.apple.com/en-us/HT203207|Apple Portables: Troubleshooting MagSafe adapters] & [https://beetstech.com/blog/oem-magsafe-chargers-vs-counterfeits-teardown-for-truth|OEM MagSafe Chargers vs Cheap Imposters: Teardown for Truth]
If that fails to fix things the charging logic on the main logic board needs repairs or you’ll need to replace the logic board.