you have the wires swapped somewhere along the way from the hub to the light. What brand hub is it? Many hubs have the ground shorted to the frame, and that's what I think is happening with yours. You can probably just swap the wires at the headlight.
I'm assuming you don't have a taillight. That is another path to ground