A robot responsible for distributing medication to different parts of a French hospital has sent drugs and medical devices worth millions of euros to an incinerator as a result of a computer bug.

The malfunction has affected the Centre Hospitalialier Universitaire (CHU) in Rennes for several years but was only revealed following an investigation by local magazine Le Mensuel de Rennes.

The management of CHU has admitted that the problem is still ongoing.

"The hospital admits to not having solved the problem in its entirety," the hospital confirmed in a statement. "There is therefore medication being destroyed."

The distribution robot is estimated by the hospital to have misdelivered around 2% of all drugs on an annual budget of €100 million (£80.5 million), representing a loss of around €2m annually since the system was put in place in 2010.

The bug led to duplication and storage problems, which caused pallet-loads of medication to be destroyed.

"We understand the moral outrage that this can generate," said Andre Fritz, director of the CHU.

According to Fritz, the desire to streamline the distribution process of prescription drugs has meant that such a problem is common in many institutions.

"There will always be an irreducible part that makes it impossible to correctly deliver certain medication," he said. "It is common to French hospitals."