[GH-ISSUE #585] Cannot make events tasks work on GCP #62

Closed
opened 2026-03-03 16:36:20 +03:00 by kerem · 1 comment
Owner

Originally created by @fullbright on GitHub (Dec 4, 2024).
Original GitHub issue: https://github.com/NdoleStudio/httpsms/issues/585

Hello,

First of all, thanks for the amazing work with the HttpSMS app.

I have deployed the HttpSMS app on GCP.

Here is my environment variables values (I redacted some parts)

Attempt 1:
EVENTS_QUEUE_TYPE=emulator
EVENTS_QUEUE_NAME=events-local
EVENTS_QUEUE_ENDPOINT=http://localhost:8000/v1/events

Attempt 2:
EVENTS_QUEUE_TYPE=gcp_tasks
EVENTS_QUEUE_NAME=
EVENTS_QUEUE_ENDPOINT=projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/send-sms

Attempt 3:
EVENTS_QUEUE_TYPE=gcp_tasks
EVENTS_QUEUE_NAME=
EVENTS_QUEUE_ENDPOINT=https://cloudtasks.googleapis.com/v2/projects//locations/europe-west1/queues/

When I try to send a message, I get this error message:

cannot send http request to [http://0.0.0.0:8000/v1/events] for queue task [85e47423-4418-4e2d-8de7-cfcef65a434b]
 --- at /http-sms/pkg/services/emulator_push_queue.go:77 (emulatorPushQueue.Enqueue.(*emulatorPushQueue).push.func1) ---
Caused by: ErrTransport: Post "http://0.0.0.0:8000/v1/events": POST http://0.0.0.0:8000/v1/events giving up after 1 attempt(s): context deadline exceeded

What I tried:

  • use the emulator = gives me an error saying that the http://localhost:8000/v1/events is not reachable
  • use the projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/send-sms = also get an error. I think it is because the url is not valid.
  • try to read the go code to understand better but difficult since I am not a go developer.

how can I setup the queue?

let me know if you need more input.

Originally created by @fullbright on GitHub (Dec 4, 2024). Original GitHub issue: https://github.com/NdoleStudio/httpsms/issues/585 Hello, First of all, thanks for the amazing work with the HttpSMS app. I have deployed the HttpSMS app on GCP. Here is my environment variables values (I redacted some parts) Attempt 1: EVENTS_QUEUE_TYPE=emulator EVENTS_QUEUE_NAME=events-local EVENTS_QUEUE_ENDPOINT=http://localhost:8000/v1/events Attempt 2: EVENTS_QUEUE_TYPE=gcp_tasks EVENTS_QUEUE_NAME=<my google cloud tasks queue name here> EVENTS_QUEUE_ENDPOINT=projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/send-sms Attempt 3: EVENTS_QUEUE_TYPE=gcp_tasks EVENTS_QUEUE_NAME=<my google cloud tasks queue name here> EVENTS_QUEUE_ENDPOINT=https://cloudtasks.googleapis.com/v2/projects/<my gcp project id>/locations/europe-west1/queues/<my google cloud queue name> When I try to send a message, I get this error message: ``` cannot send http request to [http://0.0.0.0:8000/v1/events] for queue task [85e47423-4418-4e2d-8de7-cfcef65a434b] --- at /http-sms/pkg/services/emulator_push_queue.go:77 (emulatorPushQueue.Enqueue.(*emulatorPushQueue).push.func1) --- Caused by: ErrTransport: Post "http://0.0.0.0:8000/v1/events": POST http://0.0.0.0:8000/v1/events giving up after 1 attempt(s): context deadline exceeded ``` What I tried: - use the emulator = gives me an error saying that the http://localhost:8000/v1/events is not reachable - use the projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/send-sms = also get an error. I think it is because the url is not valid. - try to read the go code to understand better but difficult since I am not a go developer. how can I setup the queue? let me know if you need more input.
kerem closed this issue 2026-03-03 16:36:21 +03:00
Author
Owner

@AchoArnold commented on GitHub (Dec 5, 2024):

Use this environment settings.

EVENTS_QUEUE_NAME=projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/send-sms
EVENTS_QUEUE_ENDPOINT=https://example.com/v1/events

The URL https://example.com/v1/events cannot be localhost since it has to be accessible from the internet.

You can remove the EVENTS_QUEUE_TYPE=gcp_tasks env variable.

You also have to ensure that the service account in FIREBASE_CREDENTIALS has permissions to create cloud tasks You can ask chatGPT on how to do this.

See github.com/NdoleStudio/httpsms@be58689d8f/api/pkg/di/container.go (L425C1-L434C1)

Btw, You DO NOT have to use GCP by default the application works with the emulator and it doesn't require GCP.

<!-- gh-comment-id:2520833195 --> @AchoArnold commented on GitHub (Dec 5, 2024): Use this environment settings. ```.env EVENTS_QUEUE_NAME=projects/[PROJECT_ID]/locations/[LOCATION_ID]/queues/send-sms EVENTS_QUEUE_ENDPOINT=https://example.com/v1/events ``` The URL `https://example.com/v1/events` cannot be `localhost` since it has to be accessible from the internet. You can remove the `EVENTS_QUEUE_TYPE=gcp_tasks` env variable. You also have to ensure that the service account in `FIREBASE_CREDENTIALS` has permissions to create cloud tasks You can ask chatGPT on how to do this. See https://github.com/NdoleStudio/httpsms/blob/be58689d8fd0f9a106bb1f2c5cadf05c13853e89/api/pkg/di/container.go#L425C1-L434C1 Btw, You DO NOT have to use GCP by default the application works with the emulator and it doesn't require GCP.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/httpsms#62
No description provided.