CSGHub icon indicating copy to clipboard operation
CSGHub copied to clipboard

Using docker compose install csghub, but cannot log in

Open xTuringLab opened this issue 5 months ago • 5 comments

I follow step by step to install csghub and it running ok, but when I log in I get error "502 Service Temporarily Unavailable" url is "http://csghub.example.com/api/v1/callback/casdoor?code=98da75ae11a11b5e84c8&state=casdoor". So, how can I fix, thanks.

services:
  csghub:
    image: opencsg-registry.cn-beijing.cr.aliyuncs.com/opencsghq/omnibus-csghub:v1.9.0-ce
    environment:
      CSGHUB_OMNIBUS_CONFIG: |
        csghub:
          external_url: "http://csghub.example.com" # 访问 CSGHub 实例域名,建议使用域名方式配置
        runner:														# 仅使用完整功能时需要,基本功能安装可移除此项
          enable: true										# 是否启用 Runner 服务,禁用则仅能使用基础功能
          deploy:
            knative:
              services:
                - type: "NodePort"        # 如果 Kubernetes 集群支持 LoadBalancer,可以使用 LoadBalancer
                  domain: "app.internal"	# 自定义 Knative Serving 内部域名
                  host: "192.168.18.10"   # 暴露 kourier 服务的 EXTERNAL-IP
                  port: 30123							# 自定义端口号,type=LoadBalancer, 请指定为 80
    ports:
      - '80:80'					# Nginx
      - '2222:2222'     # Git Over SSH
      - '5000:5000'     # Container Registry
      - '8000:8000'     # Casdoor
      - '9000:9000'     # Minio
    volumes:
      - ./csghub/etc:/etc/csghub
      - ./csghub/logs:/var/log/csghub
      - ./csghub/data:/var/opt/csghub
      - ./csghub/.kube:/etc/csghub/.kube  # 仅使用完整功能时需要,基本功能安装可移除此项
    restart: always
    shm_size: '256m'

xTuringLab avatar Jul 17 '25 10:07 xTuringLab

Add logs

csghub-ctl status
run: accounting: (pid 2996) 69s; run: log: (pid 2168) 70s
run: casdoor: (pid 3755) 68s; run: log: (pid 2183) 70s
run: dataviewer: (pid 4152) 67s; run: log: (pid 2166) 70s
run: dnsmasq: (pid 2162) 70s; run: log: (pid 2154) 70s
run: gitaly: (pid 2160) 70s; run: log: (pid 2155) 70s
run: gitlab_shell: (pid 2194) 70s; run: log: (pid 2190) 70s
run: minio: (pid 2163) 70s; run: log: (pid 2158) 70s
run: mirror_lfs: (pid 4151) 67s; run: log: (pid 2157) 70s
run: mirror_repo: (pid 4189) 66s; run: log: (pid 2181) 70s
run: nats: (pid 2195) 70s; run: log: (pid 2192) 70s
run: nginx: (pid 2161) 70s; run: log: (pid 2156) 70s
run: notification: (pid 3035) 69s; run: log: (pid 2173) 70s
run: portal: (pid 2918) 69s; run: log: (pid 2169) 70s
run: postgresql: (pid 2165) 70s; run: log: (pid 2159) 70s
run: redis: (pid 2175) 70s; run: log: (pid 2167) 70s
run: registry: (pid 2187) 70s; run: log: (pid 2182) 70s
run: rproxy: (pid 4116) 67s; run: log: (pid 2185) 70s
run: runner: (pid 3036) 69s; run: log: (pid 2180) 70s
down: server: 1s, normally up, want up; run: log: (pid 2184) 70s
run: temporal: (pid 2998) 69s; run: log: (pid 2171) 70s
run: user: (pid 3782) 68s; run: log: (pid 2170) 70s
root@7cff1702bc93:/# cat /var/log/csghub/casdoor/current
2025-07-18_02:48:34.63210 psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
2025-07-18_02:48:34.63215       Is the server running locally and accepting connections on that socket?
2025-07-18_02:48:34.63261 Creating user casdoor...
2025-07-18_02:48:34.63458 psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such file or directory
2025-07-18_02:48:34.63459       Is the server running locally and accepting connections on that socket?
root@7cff1702bc93:/# cat /var/log/csghub/server/current
2025-07-18_02:52:59.06754 psql:scripts/02_seed_space_resources.sql:43: FATAL:  null value in column "cluster_id" of relation "space_resources" violates not-null constraint
2025-07-18_02:52:59.06755 DETAIL:  Failing row contains (1, CPU basic · 0.5 vCPU · 1 GB, { "cpu": { "type": "Intel", "num": "0.5" }, "memory": "1Gi" }, null, 2025-07-18 10:52:59.066503+08, 2025-07-18 10:52:59.066503+08).
2025-07-18_02:52:59.06957 psql:scripts/02_seed_space_resources.sql:43: server closed the connection unexpectedly
2025-07-18_02:52:59.06958       This probably means the server terminated abnormally
2025-07-18_02:52:59.06958       before or while processing the request.
2025-07-18_02:52:59.06959 psql:scripts/02_seed_space_resources.sql:43: error: connection to server was lost
2025-07-18_02:52:59.06985 Error: Failed to execute ./scripts/02_seed_space_resources.sql
2025-07-18_02:52:59.22141 init logger, level: INFO, format: json
2025-07-18_02:52:59.22667 init logger, level: INFO, format: json
2025-07-18_02:52:59.23213 {"time":"2025-07-18T02:52:59.232101203Z","level":"INFO","msg":"there are no new migrations to run (database is up to date)"}
root@7cff1702bc93:/# cat /var/log/csghub/nginx/current
2025-07-18_02:49:27.64458 {"remote_addr":"10.100.21.31","remote_user":"","time_local":"18/Jul/2025:02:49:27 +0000","request":"POST /api/login?clientId=7a97bc5168cb75ffc514&responseType=code&redirectUri=http%3A%2F%2F10.100.18.24%2Fapi%2Fv1%2Fcallback%2Fcasdoor&type=code&scope=read&state=casdoor&nonce=&code_challenge_method=&code_challenge= HTTP/1.1","status":"200","body_bytes_sent":"87","http_referer":"http://10.100.18.24:8000/login/oauth/authorize?client_id=7a97bc5168cb75ffc514&response_type=code&redirect_uri=http://10.100.18.24/api/v1/callback/casdoor&scope=read&state=casdoor","http_user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36","http_x_forwarded_for":"","upstream_addr":"127.0.0.1:8087","upstream_status":"200","request_time":0.237,"upstream_response_time":0.237,"host":"10.100.18.24"}
2025-07-18_02:49:27.66422 2025/07/18 02:49:27 [error] 2429#2429: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 10.100.21.31, server: 10.100.18.24, request: "GET /api/v1/callback/casdoor?code=fea57575b9c9054a1d83&state=casdoor HTTP/1.1", upstream: "http://127.0.0.1:8080/api/v1/callback/casdoor?code=fea57575b9c9054a1d83&state=casdoor", host: "10.100.18.24", referrer: "http://10.100.18.24:8000/"

xTuringLab avatar Jul 18 '25 02:07 xTuringLab

Nginx config API rout port is 8080, but there isn't service listen 8080 port when I run netstat -tulnp

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.11:46595        0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:5001          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6939          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6933          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6935          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6934          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:7243          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:7233          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:7235          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:7234          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:8075          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:9122          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:9236          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2161/nginx: master
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN      2161/nginx: master
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:6379            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:8000            0.0.0.0:*               LISTEN      2161/nginx: master
tcp        0      0 0.0.0.0:9001            0.0.0.0:*               LISTEN      2161/nginx: master
tcp6       0      0 ::1:9000                :::*                    LISTEN      -
tcp6       0      0 :::389                  :::*                    LISTEN      -
tcp6       0      0 :::53                   :::*                    LISTEN      -
tcp6       0      0 :::2222                 :::*                    LISTEN      -
tcp6       0      0 :::4222                 :::*                    LISTEN      -
tcp6       0      0 :::5432                 :::*                    LISTEN      -
tcp6       0      0 :::8086                 :::*                    LISTEN      2996/csghub-server
tcp6       0      0 :::8087                 :::*                    LISTEN      -
tcp6       0      0 :::8082                 :::*                    LISTEN      3036/csghub-server
tcp6       0      0 :::8083                 :::*                    LISTEN      4116/csghub-server
tcp6       0      0 :::8093                 :::*                    LISTEN      4152/csghub-server
tcp6       0      0 :::8095                 :::*                    LISTEN      3035/csghub-server
tcp6       0      0 :::8088                 :::*                    LISTEN      3782/csghub-server
tcp6       0      0 :::8090                 :::*                    LISTEN      2918/csghub-portal
tcp6       0      0 :::9000                 :::*                    LISTEN      -
tcp6       0      0 :::9002                 :::*                    LISTEN      -
tcp6       0      0 :::8222                 :::*                    LISTEN      -
udp        0      0 127.0.0.11:38645        0.0.0.0:*                           -
udp        0      0 0.0.0.0:53              0.0.0.0:*                           -
udp6       0      0 :::53                   :::*                                -
udp6       0      0 :::1812                 :::*                                -

xTuringLab avatar Jul 18 '25 03:07 xTuringLab

@xTuringLab csghub-ctl status shows the server is down, have you tried to restart it ?

down: server: 1s, normally up, want up; run: log: (pid 2184) 70s

by the way, logs of casdoor and server both show connection failure to postgresql.

Rader avatar Jul 18 '25 07:07 Rader

根据您提供的内容,我无法找到与您提到的关于项目回复、刷Star行为或相关社区失望的具体信息。这些内容主要涉及StarShip产品的版本更新说明。

如果您有关于StarShip产品的技术问题,可以访问 https://opencsg.com/docs 获取更多信息,技术支持团队将会介入处理。

wayneliu0019 avatar Nov 11 '25 21:11 wayneliu0019