siyuan-note / siyuan

A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.
https://b3log.org/siyuan
GNU Affero General Public License v3.0
18.37k stars 1.37k forks source link

在不支持birthtime的filesystem下statAsset报错 #10802

Closed zsxsoft closed 5 months ago

zsxsoft commented 5 months ago

Is there an existing issue for this?

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

Could the issue be due to extensions?

Describe the problem

我在Linux+Docker下使用思源,数据使用NFS挂载,statAsset API 出现报错birthtime not available

经查,根据依赖库 https://github.com/djherbis/times 的提示:

Linux btime requires kernel 4.11 and filesystem support

确认问题出在NFS处。

Expected result

无报错

Screenshot or screen recording presentation

No response

Version environment

v3.0.5

Log file

siyuan-1             | 2024/03/30 20:36:23 http: panic serving 172.27.0.1:40700: birthtime not available
siyuan-1             | goroutine 12336 [running]:
siyuan-1             | net/http.(*conn).serve.func1()
siyuan-1             |  /usr/local/go/src/net/http/server.go:1898 +0xbe
siyuan-1             | panic({0x1e53b60?, 0x28f2e80?})
siyuan-1             |  /usr/local/go/src/runtime/panic.go:770 +0x132
siyuan-1             | github.com/djherbis/times.nobtime.BirthTime(...)
siyuan-1             |  /go/pkg/mod/github.com/djherbis/times@v1.6.0/times.go:74
siyuan-1             | github.com/siyuan-note/siyuan/kernel/api.statAsset(0xc00016e900)
siyuan-1             |  /go/src/github.com/siyuan-note/siyuan/kernel/api/asset.go:76 +0x45d
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(...)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
siyuan-1             | github.com/siyuan-note/siyuan/kernel/model.CheckAuth(0xc00016e900)
siyuan-1             |  /go/src/github.com/siyuan-note/siyuan/kernel/model/session.go:241 +0x1142
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(0xc00016e900)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
siyuan-1             | github.com/siyuan-note/siyuan/kernel/server.Serve.Sessions.func4(0xc00016e900)
siyuan-1             |  /go/pkg/mod/github.com/gin-contrib/sessions@v0.0.5/sessions.go:54 +0x169
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(...)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
siyuan-1             | github.com/gin-contrib/gzip.(*gzipHandler).Handle(0xc000d22090, 0xc00016e900)
siyuan-1             |  /go/pkg/mod/github.com/gin-contrib/gzip@v0.0.6/handler.go:60 +0x2d6
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(0xc00016e900)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174 +0x2b
siyuan-1             | github.com/siyuan-note/siyuan/kernel/server.Serve.corsMiddleware.func2(0xc00016e900)
siyuan-1             |  /go/src/github.com/siyuan-note/siyuan/kernel/server/serve.go:575 +0x11f
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(...)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
siyuan-1             | github.com/siyuan-note/siyuan/kernel/model.Recover(0xc00016e900)
siyuan-1             |  /go/src/github.com/siyuan-note/siyuan/kernel/model/session.go:331 +0x62
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(...)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
siyuan-1             | github.com/siyuan-note/siyuan/kernel/model.Timing(0xc00016e900)
siyuan-1             |  /go/src/github.com/siyuan-note/siyuan/kernel/model/session.go:304 +0x27d
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(...)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
siyuan-1             | github.com/siyuan-note/siyuan/kernel/model.ControlConcurrency(0xc00016e900)
siyuan-1             |  /go/src/github.com/siyuan-note/siyuan/kernel/model/session.go:375 +0x3fb
siyuan-1             | github.com/gin-gonic/gin.(*Context).Next(...)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/context.go:174
siyuan-1             | github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000d26000, 0xc00016e900)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:620 +0x66e
siyuan-1             | github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000d26000, {0x2900c48, 0xc00334ca80}, 0xc0033e86c0)
siyuan-1             |  /go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:576 +0x1b2
siyuan-1             | net/http.serverHandler.ServeHTTP({0x28faeb8?}, {0x2900c48?, 0xc00334ca80?}, 0x6?)
siyuan-1             |  /usr/local/go/src/net/http/server.go:3137 +0x8e
siyuan-1             | net/http.(*conn).serve(0xc0030f2870, {0x2906de0, 0xc000d22810})
siyuan-1             |  /usr/local/go/src/net/http/server.go:2039 +0x5e8
siyuan-1             | created by net/http.(*Server).Serve in goroutine 50
siyuan-1             |  /usr/local/go/src/net/http/server.go:3285 +0x4b4

More information

No response

88250 commented 5 months ago

这个就不拉到版本中了,感谢反馈和贡献代码,已经合并。