In my case the error was caused by a change in permission settings in Version Control. I went to the gear icon --> project settings --> Version Control. I selected Git repositories on the left and under users i made sure to include 'Project Collection Build Service(project)'