Error: Could not get 'template_root' option. Does it exist?

I have resolved this error now too, after reading through this post: Deployment issues with php-fpm

The wrong php-fpm version was specified in my /etc/sudoers.d/web-services file. I changed it from 7.1 to 7.2 and it worked