[GH-ISSUE #408] Any tutorials for Self-hosting setpup? #53

Closed
opened 2026-03-03 16:36:15 +03:00 by kerem · 12 comments
Owner

Originally created by @HeinKoZin on GitHub (Apr 9, 2024).
Original GitHub issue: https://github.com/NdoleStudio/httpsms/issues/408

Originally created by @HeinKoZin on GitHub (Apr 9, 2024). Original GitHub issue: https://github.com/NdoleStudio/httpsms/issues/408
kerem closed this issue 2026-03-03 16:36:16 +03:00
Author
Owner

@AchoArnold commented on GitHub (Apr 9, 2024):

How about this https://github.com/NdoleStudio/httpsms?tab=readme-ov-file#self-host-setup---docker

<!-- gh-comment-id:2046088113 --> @AchoArnold commented on GitHub (Apr 9, 2024): How about this https://github.com/NdoleStudio/httpsms?tab=readme-ov-file#self-host-setup---docker
Author
Owner

@HeinKoZin commented on GitHub (Apr 10, 2024):

I tried with it, but api return 500 error when sending sms from api.

{"severity":"ERROR","logging.googleapis.com/trace":"projects/httpsms-c4103/traces/00000000000000000000000000000000","logging.googleapis.com/spanId":"0000000000000000","logging.googleapis.com/trace_sampled":false,"hostname":"9c44e32c80fb","service.name":"*handlers.MessageHandler","pid":"7","error":"cannot send message with paylod [{\"to\":\"09421161686\",\"from\":\"+959950668891\",\"content\":\"fewf\",\"sim\":\"DEFAULT\"}]\n --- at /http-sms/pkg/handlers/message_handler.go:102 (MessageHandler.PostSend) ---\nCaused by: cannot dispatch event type [message.api.sent] and id [055278dc-9a51-49f3-ac96-230b271e63d4]\n --- at /http-sms/pkg/services/message_service.go:412 (MessageService.SendMessage) ---\nCaused by: cannot enqueue event with ID [055278dc-9a51-49f3-ac96-230b271e63d4] and type [message.api.sent]\n --- at /http-sms/pkg/services/event_dispatcher_service.go:81 (EventDispatcher.DispatchWithTimeout) ---\nCaused by: All attempts fail:\n#1: cannot schedule task [{\"specversion\":\"1.0\",\"id\":\"055278dc-9a51-49f3-ac96-230b271e63d4\",\"source\":\"/v1/messages/send\",\"type\":\"message.api.sent\",\"datacontenttype\":\"application/json\",\"time\":\"2024-04-09T21:15:40.282369649Z\",\"data\":{\"message_id\":\"b13469cc-644b-406f-8144-99b484c0f5b2\",\"user_id\":\"nWmccPMloyOkDckutqrlmLrLLZQ2\",\"owner\":\"+959950668891\",\"request_id\":null,\"max_send_attempts\":2,\"contact\":\"+09421161686\",\"scheduled_send_time\":null,\"request_received_at\":\"2024-04-09T21:15:40.281710958Z\",\"content\":\"fewf\",\"encrypted\":false,\"sim\":\"SIM1\"}}] to URL []\n --- at /http-sms/pkg/services/google_cloud_push_queue_service.go:85 (googlePushQueue.enqueueImpl) ---\nCaused by: rpc error: code = DeadlineExceeded desc = context deadline exceeded\n#2: cannot schedule task [{\"specversion\":\"1.0\",\"id\":\"055278dc-9a51-49f3-ac96-230b271e63d4\",\"source\":\"/v1/messages/send\",\"type\":\"message.api.sent\",\"datacontenttype\":\"application/json\",\"time\":\"2024-04-09T21:15:40.282369649Z\",\"data\":{\"message_id\":\"b13469cc-644b-406f-8144-99b484c0f5b2\",\"user_id\":\"nWmccPMloyOkDckutqrlmLrLLZQ2\",\"owner\":\"+959950668891\",\"request_id\":null,\"max_send_attempts\":2,\"contact\":\"+09421161686\",\"scheduled_send_time\":null,\"request_received_at\":\"2024-04-09T21:15:40.281710958Z\",\"content\":\"fewf\",\"encrypted\":false,\"sim\":\"SIM1\"}}] to URL []\n --- at /http-sms/pkg/services/google_cloud_push_queue_service.go:85 (googlePushQueue.enqueueImpl) ---\nCaused by: rpc error: code = DeadlineExceeded desc = context deadline exceeded\n#3: cannot schedule task [{\"specversion\":\"1.0\",\"id\":\"055278dc-9a51-49f3-ac96-230b271e63d4\",\"source\":\"/v1/messages/send\",\"type\":\"message.api.sent\",\"datacontenttype\":\"application/json\",\"time\":\"2024-04-09T21:15:40.282369649Z\",\"data\":{\"message_id\":\"b13469cc-644b-406f-8144-99b484c0f5b2\",\"user_id\":\"nWmccPMloyOkDckutqrlmLrLLZQ2\",\"owner\":\"+959950668891\",\"request_id\":null,\"max_send_attempts\":2,\"contact\":\"+09421161686\",\"scheduled_send_time\":null,\"request_received_at\":\"2024-04-09T21:15:40.281710958Z\",\"content\":\"fewf\",\"encrypted\":false,\"sim\":\"SIM1\"}}] to URL []\n --- at /http-sms/pkg/services/google_cloud_push_queue_service.go:85 (googlePushQueue.enqueueImpl) ---\nCaused by: rpc error: code = DeadlineExceeded desc = context deadline exceeded","time":"2024-04-09T21:15:43.664138158Z","caller":"/http-sms/pkg/handlers/message_handler.go:102"}

<!-- gh-comment-id:2046349377 --> @HeinKoZin commented on GitHub (Apr 10, 2024): I tried with it, but api return 500 error when sending sms from api. ` {"severity":"ERROR","logging.googleapis.com/trace":"projects/httpsms-c4103/traces/00000000000000000000000000000000","logging.googleapis.com/spanId":"0000000000000000","logging.googleapis.com/trace_sampled":false,"hostname":"9c44e32c80fb","service.name":"*handlers.MessageHandler","pid":"7","error":"cannot send message with paylod [{\"to\":\"09421161686\",\"from\":\"+959950668891\",\"content\":\"fewf\",\"sim\":\"DEFAULT\"}]\n --- at /http-sms/pkg/handlers/message_handler.go:102 (MessageHandler.PostSend) ---\nCaused by: cannot dispatch event type [message.api.sent] and id [055278dc-9a51-49f3-ac96-230b271e63d4]\n --- at /http-sms/pkg/services/message_service.go:412 (MessageService.SendMessage) ---\nCaused by: cannot enqueue event with ID [055278dc-9a51-49f3-ac96-230b271e63d4] and type [message.api.sent]\n --- at /http-sms/pkg/services/event_dispatcher_service.go:81 (EventDispatcher.DispatchWithTimeout) ---\nCaused by: All attempts fail:\n#1: cannot schedule task [{\"specversion\":\"1.0\",\"id\":\"055278dc-9a51-49f3-ac96-230b271e63d4\",\"source\":\"/v1/messages/send\",\"type\":\"message.api.sent\",\"datacontenttype\":\"application/json\",\"time\":\"2024-04-09T21:15:40.282369649Z\",\"data\":{\"message_id\":\"b13469cc-644b-406f-8144-99b484c0f5b2\",\"user_id\":\"nWmccPMloyOkDckutqrlmLrLLZQ2\",\"owner\":\"+959950668891\",\"request_id\":null,\"max_send_attempts\":2,\"contact\":\"+09421161686\",\"scheduled_send_time\":null,\"request_received_at\":\"2024-04-09T21:15:40.281710958Z\",\"content\":\"fewf\",\"encrypted\":false,\"sim\":\"SIM1\"}}] to URL []\n --- at /http-sms/pkg/services/google_cloud_push_queue_service.go:85 (googlePushQueue.enqueueImpl) ---\nCaused by: rpc error: code = DeadlineExceeded desc = context deadline exceeded\n#2: cannot schedule task [{\"specversion\":\"1.0\",\"id\":\"055278dc-9a51-49f3-ac96-230b271e63d4\",\"source\":\"/v1/messages/send\",\"type\":\"message.api.sent\",\"datacontenttype\":\"application/json\",\"time\":\"2024-04-09T21:15:40.282369649Z\",\"data\":{\"message_id\":\"b13469cc-644b-406f-8144-99b484c0f5b2\",\"user_id\":\"nWmccPMloyOkDckutqrlmLrLLZQ2\",\"owner\":\"+959950668891\",\"request_id\":null,\"max_send_attempts\":2,\"contact\":\"+09421161686\",\"scheduled_send_time\":null,\"request_received_at\":\"2024-04-09T21:15:40.281710958Z\",\"content\":\"fewf\",\"encrypted\":false,\"sim\":\"SIM1\"}}] to URL []\n --- at /http-sms/pkg/services/google_cloud_push_queue_service.go:85 (googlePushQueue.enqueueImpl) ---\nCaused by: rpc error: code = DeadlineExceeded desc = context deadline exceeded\n#3: cannot schedule task [{\"specversion\":\"1.0\",\"id\":\"055278dc-9a51-49f3-ac96-230b271e63d4\",\"source\":\"/v1/messages/send\",\"type\":\"message.api.sent\",\"datacontenttype\":\"application/json\",\"time\":\"2024-04-09T21:15:40.282369649Z\",\"data\":{\"message_id\":\"b13469cc-644b-406f-8144-99b484c0f5b2\",\"user_id\":\"nWmccPMloyOkDckutqrlmLrLLZQ2\",\"owner\":\"+959950668891\",\"request_id\":null,\"max_send_attempts\":2,\"contact\":\"+09421161686\",\"scheduled_send_time\":null,\"request_received_at\":\"2024-04-09T21:15:40.281710958Z\",\"content\":\"fewf\",\"encrypted\":false,\"sim\":\"SIM1\"}}] to URL []\n --- at /http-sms/pkg/services/google_cloud_push_queue_service.go:85 (googlePushQueue.enqueueImpl) ---\nCaused by: rpc error: code = DeadlineExceeded desc = context deadline exceeded","time":"2024-04-09T21:15:43.664138158Z","caller":"/http-sms/pkg/handlers/message_handler.go:102"}`
Author
Owner

@zaknick commented on GitHub (Apr 10, 2024):

Must be in the documentation. Read the source code to see what it's doing.

cannot enqueue event with ID [055278dc-9a51-49f3-ac96-230b271e63d4] and type [message.api.sent]\n --- at /http-sms/pkg/services/event_dispatcher_service.go:81 (EventDispatcher.DispatchWithTimeout) ---\nCaused by: All attempts fail:\n#1: cannot schedule task

Have fun.

<!-- gh-comment-id:2046374445 --> @zaknick commented on GitHub (Apr 10, 2024): Must be in the documentation. Read the source code to see what it's doing. cannot enqueue event with ID [055278dc-9a51-49f3-ac96-230b271e63d4] and type [message.api.sent]\n --- at /http-sms/pkg/services/event_dispatcher_service.go:81 (EventDispatcher.DispatchWithTimeout) ---\nCaused by: All attempts fail:\n#1: cannot schedule task Have fun.
Author
Owner

@AchoArnold commented on GitHub (Apr 10, 2024):

I think there's something wrong with your setup @HeinKoZin. the .env file you should be using the emulator queue github.com/NdoleStudio/httpsms@4234693f20/api/.env.docker (L8) But from th error message you're attempting to use the google cloud push queue. Follow the instructions in the documentation and setup the .env file properly.

<!-- gh-comment-id:2046552108 --> @AchoArnold commented on GitHub (Apr 10, 2024): I think there's something wrong with your setup @HeinKoZin. the `.env` file you should be using the emulator queue https://github.com/NdoleStudio/httpsms/blob/4234693f20e0f4730a380d4d34f4e80f6ca35b7a/api/.env.docker#L8 But from th error message you're attempting to use the google cloud push queue. Follow the instructions in the documentation and setup the `.env` file properly.
Author
Owner

@HeinKoZin commented on GitHub (Apr 10, 2024):

Thanks, I will try to configure it with .env file.

<!-- gh-comment-id:2047318736 --> @HeinKoZin commented on GitHub (Apr 10, 2024): Thanks, I will try to configure it with .env file.
Author
Owner

@HeinKoZin commented on GitHub (Apr 10, 2024):

EVENTS_QUEUE_USER_API_KEY=system-user-api-key
EVENTS_QUEUE_USER_ID=system-user-id

I created a user in database and put in .env but it return "record not found"

<!-- gh-comment-id:2048343072 --> @HeinKoZin commented on GitHub (Apr 10, 2024): EVENTS_QUEUE_USER_API_KEY=system-user-api-key EVENTS_QUEUE_USER_ID=system-user-id I created a user in database and put in .env but it return "record not found"
Author
Owner

@AchoArnold commented on GitHub (Apr 10, 2024):

What returns record not found? Did you restart your docker after making changes to the .env file ?

<!-- gh-comment-id:2048386314 --> @AchoArnold commented on GitHub (Apr 10, 2024): What returns record not found? Did you restart your docker after making changes to the .env file ?
Author
Owner

@HeinKoZin commented on GitHub (Apr 10, 2024):

Yeah, I restarted the server when .env has changed. When I send a message, the logs of api server show "record not found".

<!-- gh-comment-id:2048400834 --> @HeinKoZin commented on GitHub (Apr 10, 2024): Yeah, I restarted the server when .env has changed. When I send a message, the logs of api server show "record not found".
Author
Owner

@AchoArnold commented on GitHub (Apr 10, 2024):

It will be nice to get the full error message to debug the issue. Which log line? Which file? Which method etc stacktrace?

<!-- gh-comment-id:2048404732 --> @AchoArnold commented on GitHub (Apr 10, 2024): It will be nice to get the full error message to debug the issue. Which log line? Which file? Which method etc stacktrace?
Author
Owner

@HeinKoZin commented on GitHub (Apr 10, 2024):

Sorry, brother. I was connecting the wrong database. Now, I can send sms via rest api. Is there any way to change user plan?

<!-- gh-comment-id:2048435056 --> @HeinKoZin commented on GitHub (Apr 10, 2024): Sorry, brother. I was connecting the wrong database. Now, I can send sms via rest api. Is there any way to change user plan?
Author
Owner

@AchoArnold commented on GitHub (Apr 11, 2024):

You can change it on the database @HeinKoZin. Under subscription_name use the 100k-monthly plan.

<!-- gh-comment-id:2048960519 --> @AchoArnold commented on GitHub (Apr 11, 2024): You can change it on the database @HeinKoZin. Under `subscription_name` use the `100k-monthly` plan.
Author
Owner

@HeinKoZin commented on GitHub (Apr 11, 2024):

Thank you very much, brother. I truly appreciate your assistance.

<!-- gh-comment-id:2048972312 --> @HeinKoZin commented on GitHub (Apr 11, 2024): Thank you very much, brother. I truly appreciate your assistance.
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#53
No description provided.