Thanks guys, appreciate the help. Managed to get it all working, the error handling was definitely a good call.
Thanks Haggar for the tip.
But when I went to use his tip he had more updates to do, I made the updates and it returned to function normally in both Ubuntu and Debian.
Thank you anyway for the tip.