Skip to content

Errror 500 after dispatch a job in laravel 7 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
titosobabas opened this issue Jul 23, 2021 · 1 comment
Closed

Errror 500 after dispatch a job in laravel 7 #26

titosobabas opened this issue Jul 23, 2021 · 1 comment

Comments

@titosobabas
Copy link

titosobabas commented Jul 23, 2021

I'm recieving the next error 500:

The principal (user or service account) lacks IAM permission \"cloudtasks.tasks.create\" for the resource \"projects\/myproject\/locations\/us-central1\/queues\/cuentas\" (or the resource may not exist).", "code": 7, "status": "PERMISSION_DENIED

I have created a service account

image

Also, i have generated a json file

image

Then, i have added ENV variable

GOOGLE_APPLICATION_CREDENTIALS=/var/www/html/credentials/cloudtasksaularun.json

My full .env is:

QUEUE_CONNECTION=cloudtasks
STACKKIT_CLOUD_TASKS_PROJECT=xxxxxxxxxxxxxxxxx
STACKKIT_CLOUD_TASKS_LOCATION=us-east1
STACKKIT_CLOUD_TASKS_HANDLER=https://xxxxxxxxxxxxxxxxxx/handle-task
STACKKIT_CLOUD_TASKS_QUEUE=cuentas
STACKKIT_CLOUD_TASKS_SERVICE_EMAIL=cloudtasksaularun@xxxxxxxxxxxxxxxx.iam.gserviceaccount.com
GOOGLE_APPLICATION_CREDENTIALS=/var/www/html/credentials/cloudtasksaularun.json

And i have created cuentas queue inside my Google SDK into my project

image

Finally, i have created a new folder where i'd save the json service account at this level:

image

Can you help me to know what i did wrong in order to fix this issue?

@marickvantuil
Copy link
Member

Did you manage to fix this? This is a permission thing within IAM.

The service account that is configured ([email protected]) needs to have the correct permissions in order to add tasks to the queue and read them back. Inside IAM Edit Permissions ensure the service account has the following roles (at least these 4 are necessary to make it work):

Screenshot 2021-08-08 at 16 01 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants