Hi @Daniel Pepin
Disconnect the machine from the power and use an Ohmmeter and check if there is a circuit between one of the pins of the power cord plug and the metal frame of the coffee maker.
Don't know if you have a 2 pin or 3 pin power cord plug on the machine but if it is only a 2 pin plug then there should be no connection between either pin and any metal part of the machine as it should be what is known as “double insulated” to prevent this from occurring.
If there is a 3 pin plug then wire on the earth pin of the plug should be connected to the frame.
It may be that the heater element insulation has broken down and is touching the frame or even a frayed or pinched wire etc.
Whatever is the cause it is dangerous and needs to be fixed before someone is injured.
Here’s a video that may help with opening the machine so that it can be static tested with an Ohmmeter (no power connected to the machine) to find out where and what the problem is.
Here’s a parts list and schematic diagram which will also help to track down the problem.
Also it may be prudent to have a RCD (residual current device - aka GFCI or RCBO) installed in the premises’ power box for the power outlets feed(s), to prevent the occupants from being electrocuted in the event of a wiring or component failure in an appliance causing the appliance to become “live”.