Service Account needs Cloud Tasks Task Deleter role
s1351 opened this issue · 1 comments
When the handle-task route is called the task itself is executed succesfully.
But each "succesful" execution gives the following 500 error:
The principal (user or service account) lacks IAM permission "cloudtasks.tasks.delete"
Apparently gcloud wants to delete the task after completing it, when this fails this causes the task to be repeatedly called until the Max attempts limit is reached.
Adding the Cloud Tasks Task Deleter role to the Service Account resolved the issue for me.
But is this the expected behavior? If so this role should be added to the required roles in the readme.
Added the Cloud Tasks Task Deleter bit to the README, it is indeed necessary for the package!
However, I am confused why the job is being deleted. As far as I am aware, this should only happen when the job has reached the max attempts (retry time or max tries). This is all part of the inner workings of the Laravel queue: markJobAsFailedIfAlreadyExceedsMaxAttempts (checks before job is executed) and markJobAsFailedIfWillExceedMaxAttempts (checks after job is executed). If it's possible to share more of the used queue settings, that would make it easier to find the problem.