Solved by adding --no-tty on the apt-key adv command also;
--no-tty
apt-key adv
Any idea however why this was happening?