run afoul of
Also, run foul of. Come into conflict with, as in If you keep parking illegally you'll run afoul of the police. This expression originated in the late 1600s, when it was applied to a vessel colliding or becoming entangled with another vessel, but at the same time it was transferred to non-nautical usage. Both senses remain current.