Skip to content
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

HTTP server does not respond #819

Open
HrachMD opened this issue Nov 16, 2024 · 3 comments
Open

HTTP server does not respond #819

HrachMD opened this issue Nov 16, 2024 · 3 comments

Comments

@HrachMD
Copy link

HrachMD commented Nov 16, 2024

The method POST /api/push returns: curl: (52) Empty reply from server

All other GET endpoints do not respond as well (empty response).

The gRPC service works well and PUSH message delivered to the device successfully.

The config:

core:
  enabled: true
  port: "8088"
  worker_num: 0
  queue_num: 0
  max_notification: 100
  sync: false
  feedback_hook_url: "http://localhost:8888"
  feedback_timeout: 30
  mode: "debug"
  ssl: false
  cert_path: "cert.pem"
  key_path: "key.pem"
  cert_base64: ""
  key_base64: ""
  http_proxy: ""
  pid:
    enabled: false
    path: "gorush.pid"
    override: true

grpc:
  enabled: true
  port: "9000"

api:
  push_uri: "/api/push"
  stat_go_uri: "/api/stat/go"
  stat_app_uri: "/api/stat/app"
  sys_stat_uri: "/sys/stats"
  metric_uri: "/metrics"
  health_uri: "/healthz"

log:
  format: "json"
  access_log: "stdout"
  access_level: "debug"
  error_log: "stderr"
  error_level: "error"
  hide_token: false
  hide_messages: false

android:
  enabled: true
  max_retry: 3
  key_path: /home/gorush/fcm.json

huawei:
  enabled: false
  max_retry: 3
  appid: ""
  appsecret: ""

ios:
  enabled: false
  production: false
  max_concurrent_pushes: 100
  max_retry: 3
  team_id: ""
  key_id: ""
  key_type: "p8"
  key_base64: ""

queue:
  engine: "local"

stat:
  engine: "memory"

How to run

docker run --rm --name gorush -v ${PWD}/config/gorush.yml:/home/gorush/config.yml -v ${PWD}/config/fcm.json:/home/gorush/fcm.json -p 8088:8088 -p 9000:9000 appleboy/gorush:1.18.8

Logs after running:

docker pull appleboy/gorush:1.18.8
1.18.8: Pulling from appleboy/gorush
Digest: sha256:1a7a7a90687ed2ee9945908aa583d9dbc21cf64ba706bea79b46dabcc7e566c6
Status: Image is up to date for appleboy/gorush:1.18.8
docker.io/appleboy/gorush:1.18.8

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview appleboy/gorush:1.18.8
docker run --rm --name gorush -v ...
Using config file: /home/gorush/config.yml
{"level":"info","msg":"Init App Status Engine as memory","time":"2024-11-16T20:27:07Z"}
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] GET    /api/stat/go              --> github.com/appleboy/gin-status-api.GinHandler (5 handlers)
[GIN-debug] GET    /api/stat/app             --> github.com/appleboy/gorush/router.routerEngine.appStatusHandler.func6 (5 handlers)
[GIN-debug] GET    /                         --> github.com/appleboy/gorush/router.routerEngine.configHandler.func7 (5 handlers)
[GIN-debug] GET    /sys/stats                --> github.com/appleboy/gorush/router.routerEngine.sysStatsHandler.func8 (5 handlers)
[GIN-debug] POST   /api/push                 --> github.com/appleboy/gorush/router.routerEngine.pushHandler.func9 (5 handlers)
[GIN-debug] GET    /metrics                  --> github.com/appleboy/gorush/router.metricsHandler (5 handlers)
[GIN-debug] GET    /healthz                  --> github.com/appleboy/gorush/router.heartbeatHandler (5 handlers)
[GIN-debug] HEAD   /healthz                  --> github.com/appleboy/gorush/router.heartbeatHandler (5 handlers)
[GIN-debug] GET    /version                  --> github.com/appleboy/gorush/router.versionHandler (5 handlers)
[GIN-debug] GET    /                         --> github.com/appleboy/gorush/router.rootHandler (5 handlers)
{"level":"info","msg":"gRPC server is running on 9000 port.","time":"2024-11-16T20:27:07Z"}

After sending the PUSH

DEBU[2024/11/16 - 15:19:00] Start push notification for Android
DEBU[2024/11/16 - 15:19:01] Android Success count: 1, Failure count: 0
INFO[2024/11/16 - 15:19:01] {"notif_id":"019336a0-d685-7082-8998-b9b947af61d3","type":"succeeded-push","platform":"android","token":"...","message":"The push tracing ID is: 019336a0-d685-7082-8998-b9b947af61d3","error":""}

! The feedback URL did not fired after sending the PUSH as well.

@appleboy
Copy link
Owner

There are two issues. Please help to confirm.

  1. The Web API Server is not working but the gRPC service works well?
  2. The feedback URL also did not fire after sending the PUSH.

@HrachMD
Copy link
Author

HrachMD commented Dec 11, 2024

Yes, I confirm that 2 issues. Thank you!

@appleboy
Copy link
Owner

The feedback URL also did not fire after sending the PUSH.

just ref: #813

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