Exec the command in a pseudo tty
This will enable the execution of sudo commands that require a tty (and possibly help in other scenarios too.)
From the sudoers(5) man page:
requiretty If set, sudo will only run when the user is logged in to a real tty. When this flag is set, sudo can only be run from a login session and not via other means such as cron(8) or cgi-bin scripts. This flag is off by default.