Thanks for posting your question on this site. Do you mean HP Officejet D135 ?
Thanks for the confirmation. The problem is caused due to a defective printhead because the printhead or the carraige is the chamber in which we insert the cartridges and then, it help the printer to communicate with the cartridges. When the contacts on the carriage is dirty, the printer cannot detect the cartridges, even if the cartridges inserted properly or if the carriage is defective. Now, the final solution for this problem is replacing the carriage from any repair shop, but before that follow the steps below and check if the problem get solved or not.
Remove all the cartridges then, clean the contacts on them as well as on the carriage with a Q-tip dampened in distilled water or IP alcohol. Until the contacts are clean completely. After that reinsert the cartridges and check the result.
If the problem persists then unfortunately, the carriage is defective and you have to replace it.
Now, the main problem is the cost of replacement, because the model of the printer is too old and that is the spare will not be easily available. So that replacement cost may go high and can cross the price of a new printer, so take an estimate before going for a repair. Let me know if you need any further information, otherwise please remember to give a positive rating, as that is the only way I am compensated for my time and effort.