mirror of
https://github.com/NdoleStudio/httpsms.git
synced 2026-04-27 20:05:55 +03:00
[GH-ISSUE #408] Any tutorials for Self-hosting setpup? #53
Labels
No labels
In Review
documentation
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/httpsms#53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HeinKoZin on GitHub (Apr 9, 2024).
Original GitHub issue: https://github.com/NdoleStudio/httpsms/issues/408
@AchoArnold commented on GitHub (Apr 9, 2024):
How about this https://github.com/NdoleStudio/httpsms?tab=readme-ov-file#self-host-setup---docker
@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"}@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.
@AchoArnold commented on GitHub (Apr 10, 2024):
I think there's something wrong with your setup @HeinKoZin. the
.envfile you should be using the emulator queuegithub.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.envfile properly.@HeinKoZin commented on GitHub (Apr 10, 2024):
Thanks, I will try to configure it with .env file.
@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"
@AchoArnold commented on GitHub (Apr 10, 2024):
What returns record not found? Did you restart your docker after making changes to the .env file ?
@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".
@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?
@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?
@AchoArnold commented on GitHub (Apr 11, 2024):
You can change it on the database @HeinKoZin. Under
subscription_nameuse the100k-monthlyplan.@HeinKoZin commented on GitHub (Apr 11, 2024):
Thank you very much, brother. I truly appreciate your assistance.