Cloud Functions stopped having access to Firestore

After adding automatic backup to a Firebase project I am working on, Cloud Functions started getting an error when accessing Firestore:

Error code 7: 'Missing or insufficient permissions.'

The solution was to add the Editor role to the default service account.

Service account with editor roles