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

Server panics while trying to access through publish port #14122

Open
3 tasks done
rukh-debug opened this issue Feb 17, 2025 · 2 comments
Open
3 tasks done

Server panics while trying to access through publish port #14122

rukh-debug opened this issue Feb 17, 2025 · 2 comments

Comments

@rukh-debug
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

When i try to access the server through publish port, it panicks.

Image


siyuan  | 2025/02/16 19:50:57 http: panic serving 100.124.181.41:37998: runtime error: invalid memory address or nil pointer dereference
siyuan  | goroutine 3052 [running]:
siyuan  | net/http.(*conn).serve.func1()
siyuan  |       /usr/local/go/src/net/http/server.go:1947 +0xbe
siyuan  | panic({0x246ae20?, 0x3df3090?})
siyuan  |       /usr/local/go/src/runtime/panic.go:787 +0x132
siyuan  | net/http/httputil.(*ReverseProxy).copyBuffer(0x3e3fd60, {0x2be99c0, 0xc001a9c2c0}, {0x0, 0x0}, {0x0?, 0x26b48c0?, 0xc001740fc0?})
siyuan  |       /usr/local/go/src/net/http/httputil/reverseproxy.go:648 +0xd3
siyuan  | net/http/httputil.(*ReverseProxy).copyResponse(0x3e3fd60, {0x2bf9930, 0xc0004d61c0}, {0x0, 0x0}, 0xffffffffffffffff)
siyuan  |       /usr/local/go/src/net/http/httputil/reverseproxy.go:636 +0x1e5
siyuan  | net/http/httputil.(*ReverseProxy).ServeHTTP(0x3e3fd60, {0x2bf9930, 0xc0004d61c0}, 0xc0014fcc80)
siyuan  |       /usr/local/go/src/net/http/httputil/reverseproxy.go:520 +0x10ab
siyuan  | net/http.serverHandler.ServeHTTP({0xc001740f00?}, {0x2bf9930?, 0xc0004d61c0?}, 0x1?)
siyuan  |       /usr/local/go/src/net/http/server.go:3301 +0x8e
siyuan  | net/http.(*conn).serve(0xc001bce6c0, {0x2c00198, 0xc001740ab0})
siyuan  |       /usr/local/go/src/net/http/server.go:2102 +0x625
siyuan  | created by net/http.(*Server).Serve in goroutine 1999
siyuan  |       /usr/local/go/src/net/http/server.go:3454 +0x485
networks:
  proxy:
    external: true
    name: "traefik_network"

services:
  main:
    image: b3log/siyuan
    container_name: siyuan
    command: ['--workspace=/siyuan/workspace/', '--accessAuthCode=${AuthCode}']
    ports:
      - 6806:6806
      - 6808:6808
    volumes:
      - ${DATA_ROOT_DIR}/data/workspace:/siyuan/workspace
    networks:
      - proxy
    restart: unless-stopped
    environment:
      # A list of time zone identifiers can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      - TZ=${TIME_ZONE}
      - PUID=${PUID}
      - PGID=${PGID}
    labels:
      - "traefik.enable=true"
      # Privately exposed
      - "traefik.http.routers.note.rule=Host(`notes.${DOMAIN}`)"
      - "traefik.http.routers.note.entrypoints=web-secure"
      - "traefik.http.routers.note.tls.certresolver=selfresolver"
      - "traefik.http.routers.note.tls.domains[0].main=*.${DOMAIN}"
      - "traefik.http.routers.note.service=noteService"
      - "traefik.http.services.noteService.loadbalancer.server.port=6806"
      # - 'traefik.http.routers.note.middlewares=proxyheaders@docker,authelia@docker'
      - "traefik.docker.network=traefik_network"
      # Public domain (publish.domain)
      #- "traefik.http.routers.note-public.rule=Host(`publish.${DOMAIN}`)"
      #- "traefik.http.routers.note-public.entrypoints=cloudflare"
      #- "traefik.http.routers.note-public.tls=false"
      #- "traefik.http.routers.note-public.tls.certresolver=selfresolver"
      #- "traefik.http.routers.note.service=notePublishService"
      #- "traefik.http.services.notePublishService.loadbalancer.server.port=6808"
    healthcheck:
      test: ["CMD", "nc", "-z", "localhost", "6806"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s

Expected result

Should serve me web page of some kind

Screenshot or screen recording presentation

Image

Version environment

- Version: latest?
- Operating System: NixOS
- Browser (if used): Firefox (zen)

Log file

  ___                                   ___           ___           ___
 /  /\        ___           ___        /__/\         /  /\         /__/\
/  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\

/ /:/ /\ / /:/ | |:| \ :\ / /:/:\ \ :
/ /:/ /::\ //::\ | |:| ___ \ :\ / /:/~/::\ __:
//:/ /:/:\ _/:_ ||:| /
/\ __:\ /
/:/ /:/:\ /
/::::::::
\ :/:/~/:/ \ :/\ /
/::::\ \ :\ / /:/ \ :/:// \ :~~/
\ ::/ /:/ _::/ ~:\ \ :\ /:/ \ ::/ \ :\ ~~~
_
/ /:/ /
/:/ \ :\ \ :/:/ \ :\ \ :
/
_/:/ _/ _/ \ ::/ \ :\ \ :
_/ _/ _/ _/
I 2025/02/16 19:53:06 runtime.go:87: kernel is booting:
* ver [3.1.22]
* arch [amd64]
* os [alpine]
* pid [1]
* runtime mode [prod]
* working directory [/opt/siyuan]
* read only [false]
* container [docker]
* database [ver=20220501]
* workspace directory [/siyuan/workspace/]
I 2025/02/16 19:53:06 conf.go:129: loaded conf [/siyuan/workspace/conf/conf.json]
I 2025/02/16 19:53:06 runtime.go:139: use network proxy [system]
I 2025/02/16 19:53:06 serve.go:209: kernel [pid=1] http server [0.0.0.0:6806] is booting
I 2025/02/16 19:53:06 working.go:515: database [/siyuan/workspace/temp/siyuan.db] size [8.48 MB]
I 2025/02/16 19:53:06 working.go:515: database [/siyuan/workspace/temp/blocktree.db] size [704.52 kB]
I 2025/02/16 19:53:06 working.go:515: database [/siyuan/workspace/temp/history.db] size [86.02 kB]
I 2025/02/16 19:53:06 working.go:515: database [/siyuan/workspace/temp/asset_content.db] size [24.58 kB]
I 2025/02/16 19:53:06 conf.go:865: tree/block count [13/245]
I 2025/02/16 19:53:06 working.go:196: kernel booted
I 2025/02/16 19:53:06 font.go:58: loaded system fonts [0] in [0ms]
I 2025/02/16 19:53:06 box.go:77: auto stat [trees=13, blocks=245, dataSize=131.3 MB, assetsSize=2.44 kB]
I 2025/02/16 19:53:07 publish.go:110: publish service [0.0.0.0:6808] is running

More information

No response

@rukh-debug rukh-debug changed the title Server panics while trying to access publish server Server panics while trying to access through publish port Feb 17, 2025
@88250
Copy link
Member

88250 commented Feb 17, 2025

Please provide the complete log file, thank you.

@rukh-debug
Copy link
Author

The error I see through docker logs when I try to access the publish's port is not available in the saved log file.

But this is exactly what i see on docker logs

--------------------------------siyuan  | 2025/02/17 07:31:44 http: panic serving 100.124.181.41:50836: runtime error: invalid memory address or nil pointer dereference
siyuan  | goroutine 44982 [running]:
siyuan  | net/http.(*conn).serve.func1()
siyuan  |       /usr/local/go/src/net/http/server.go:1947 +0xbe
siyuan  | panic({0x246ae20?, 0x3df3090?})
siyuan  |       /usr/local/go/src/runtime/panic.go:787 +0x132
siyuan  | net/http/httputil.(*ReverseProxy).copyBuffer(0x3e3fd60, {0x2be99c0, 0xc00159e5c0}, {0x0, 0x0}, {0x0?, 0x26b48c0?, 0xc00172ab70?})
siyuan  |       /usr/local/go/src/net/http/httputil/reverseproxy.go:648 +0xd3
siyuan  | net/http/httputil.(*ReverseProxy).copyResponse(0x3e3fd60, {0x2bf9930, 0xc001350000}, {0x0, 0x0}, 0xffffffffffffffff)
siyuan  |       /usr/local/go/src/net/http/httputil/reverseproxy.go:636 +0x1e5
siyuan  | net/http/httputil.(*ReverseProxy).ServeHTTP(0x3e3fd60, {0x2bf9930, 0xc001350000}, 0xc00172c3c0)
siyuan  |       /usr/local/go/src/net/http/httputil/reverseproxy.go:520 +0x10ab
siyuan  | net/http.serverHandler.ServeHTTP({0xc00172aae0?}, {0x2bf9930?, 0xc001350000?}, 0x6?)
siyuan  |       /usr/local/go/src/net/http/server.go:3301 +0x8e
siyuan  | net/http.(*conn).serve(0xc0015bc240, {0x2c00198, 0xc00172a390})
siyuan  |       /usr/local/go/src/net/http/server.go:2102 +0x625
siyuan  | created by net/http.(*Server).Serve in goroutine 122
siyuan  |       /usr/local/go/src/net/http/server.go:3454 +0x485

Also,

Image

It asks me for username and password which I have not set anywhere.

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