Can not flush cache
还没有人认领这个 Issue。
评估
调研方向
从 pkg/api/souin.go:316 开始,这里向 /souin-api/souin/flush 发起 PURGE 请求时会发生 panic,并将其与 Caddyfile 缓存 API 配置进行比较。使用提供的 curl 命令重现该请求,并检查相关的 API handler 路径。当端点返回响应且不发生 nil-pointer panic,并按预期刷新缓存时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
caddy version: 1.11.2
$ curl -v -X PURGE http://localhost:2019/souin-api/souin/flush
* Host localhost:2019 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
* Trying [::1]:2019...
* Connected to localhost (::1) port 2019
* using HTTP/1.x
> PURGE /souin-api/souin/flush HTTP/1.1
> Host: localhost:2019
> User-Agent: curl/8.14.1
> Accept: */*
>
* Request completely sent off
* Empty reply from server
* shutting down connection #0
curl: (52) Empty reply from server
log
{"level":"info","ts":1773995888.740839,"logger":"admin.api","msg":"received request","method":"PURGE","host":"localhost:2019","uri":"/souin-api/souin/flush","remote_ip":"10.88.0.112","remote_port":"54338","headers":{"Accept":["*/*"],"User-Agent":["curl/8.14.1"]}}
{"level":"info","ts":1773995888.7425144,"msg":"http: panic serving 10.88.0.112:54338: runtime error: invalid memory address or nil pointer dereference\ngoroutine 2663 [running]:\nnet/http.(*conn).serve.func1()\n\tnet/http/server.go:1907 +0xbd\npanic({0x1c7bd00?, 0x37542c0?})\n\truntime/panic.go:860 +0x13a\ngithub.com/darkweak/souin/pkg/api.(*SouinAPI).HandleRequest(0x2514e81b5020, {0x23581f0, 0x2514e9083110}, 0x2514e8130140)\n\tgithub.com/darkweak/[email protected]/pkg/api/souin.go:316 +0x931\ngithub.com/caddyserver/cache-handler.(*adminAPI).handleAPIEndpoints(0x2514e8643050?, {0x23581f0, 0x2514e9083110}, 0x2514e8130140)\n\tgithub.com/caddyserver/[email protected]/admin.go:41 +0xf2\ngithub.com/caddyserver/caddy/v2.AdminHandlerFunc.ServeHTTP(0x425234?, {0x23581f0?, 0x2514e9083110?}, 0x2514e925aab0?)\n\tgithub.com/caddyserver/caddy/[email protected]/admin.go:1360 +0x29\ngithub.com/caddyserver/caddy/v2.(*AdminConfig).newAdminHandler.(*AdminConfig).newAdminHandler.func2.func6({0x23581f0, 0x2514e9083110}, 0x2514e8130140)\n\tgithub.com/caddyserver/caddy/[email protected]/admin.go:248 +0x7b\nnet/http.HandlerFunc.ServeHTTP(0x2358580?, {0x23581f0?, 0x2514e9083110?}, 0x2514e860b750?)\n\tnet/http/server.go:2286 +0x29\ngithub.com/caddyserver/caddy/v2.(*AdminConfig).newAdminHandler.func1.instrumentHandlerCounter.1({0x2358580?, 0x2514e82fe5a0?}, 0x2514e8130140)\n\tgithub.com/caddyserver/caddy/[email protected]/metrics.go:56 +0x6f\nnet/http.HandlerFunc.ServeHTTP(0x2514e927e3c0?, {0x2358580?, 0x2514e82fe5a0?}, 0x74c47f?)\n\tnet/http/server.go:2286 +0x29\nnet/http.(*ServeMux).ServeHTTP(0x2514e8640f90?, {0x2358580, 0x2514e82fe5a0}, 0x2514e8130140)\n\tnet/http/server.go:2828 +0x1c7\ngithub.com/caddyserver/caddy/v2.adminHandler.serveHTTP({0x2514e927e3c0, 0x0, 0x0, {0x2514e7e86528, 0x1, 0x1}, 0x0}, {0x2358580, 0x2514e82fe5a0}, 0x2514e8130140)\n\tgithub.com/caddyserver/caddy/[email protected]/admin.go:891 +0x793\ngithub.com/caddyserver/caddy/v2.adminHandler.ServeHTTP({0x2514e927e3c0, 0x0, 0x0, {0x2514e7e86528, 0x1, 0x1}, 0x0}, {0x2358580, 0x2514e82fe5a0}, 0x2514e8130140)\n\tgithub.com/caddyserver/caddy/[email protected]/admin.go:816 +0x7a5\nnet/http.serverHandler.ServeHTTP({0x2514e829d180?}, {0x2358580?, 0x2514e82fe5a0?}, 0x1?)\n\tnet/http/server.go:3311 +0x8e\nnet/http.(*conn).serve(0x2514e925aa20, {0x235da70, 0x2514e85e1380})\n\tnet/http/server.go:2073 +0x650\ncreated by net/http.(*Server).Serve in goroutine 2372\n\tnet/http/server.go:3464 +0x485"}
Caddyfile
{
debug
order cache before rewrite
cache {
api {
souin
}
}
}
example.com {
@cacheable {
not path /
}
handle @cacheable {
cache {
ttl 120s
}
}
file_server
}
- 主要语言
- Go
- 星标
- 396
- 派生
- 29
- 平均合并
- 32 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
caddyserver/cache-handler 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
caddyserver/cache-handler#138 · 1 条评论 · 3 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 76/100
caddyserver/cache-handler#143 · 2 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 45/100
caddyserver/cache-handler#139 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
caddyserver/cache-handler#137 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
caddyserver/cache-handler#136 · 4 条评论 ·
查看 caddyserver/cache-handler 的全部 Issue
相似的 Issue
-
automation models
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
bug llm-stack needs-triage
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
P3 Type: Bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复
-
needs-area needs-kind needs-priority needs-status needs-triage
难度 2/5 1 小时以内 新手友好度 85/100
cncf/automation#736 ·
维护者通常 1 天内回复
-
Signing PIN can't be collected in-TUI: gpg helper never opts into credential handling, and the PIN pattern misses ssh-keygen's wording可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
jesseduffield/lazygit#6094 · 1 条评论 ·
维护者通常 1 天内回复