Printer cartridges have a chip on them which interfaces with the printer. If either interface is damaged, you can get this problem.
Replacing the cartridge is generally way to test this - the faulty cartridge can then be returned. The problem with this is that if the problem persists with a different cartridge, the issue must be with the printer, leaving you with two perfectly fine open cartridges - and a faulty printer!