kubernetes-sigs / prow

Prow is a Kubernetes based CI/CD system developed to serve the Kubernetes community. This repository contains Prow source code and Hugo sources for Prow documentation site.
https://docs.prow.k8s.io
Apache License 2.0
129 stars 99 forks source link

Runtime error: slice out of range #281

Closed netomi closed 6 days ago

netomi commented 1 month ago

I am running the latest ghproxy version us-docker.pkg.dev/k8s-infra-prow/images/ghproxy:v20240923-efb534162 in an Openshift cluster and occasionally I get the following errors (similar errors were received when running it as a local docker container):

2024/09/25 15:04:22 http: panic serving 10.40.16.47:52268: runtime error: slice bounds out of range [15:10]
goroutine 280 [running]:
net/http.(*conn).serve.func1()
net/http/server.go:1898 +0xbe
panic({0x1d45460?, 0xc0009e0318?})
runtime/panic.go:770 +0x132
net/http.(*timeoutHandler).ServeHTTP(0xc000a160c0, {0x22ed0c8, 0xc0009d4c40}, 0xc0008e9320)
net/http/server.go:3601 +0x768
net/http.serverHandler.ServeHTTP({0xc0008f28a0?}, {0x22ed0c8?, 0xc0009d4c40?}, 0x6?)
net/http/server.go:3137 +0x8e
net/http.(*conn).serve(0xc000655950, {0x22fb3a8, 0xc000790870})
net/http/server.go:2039 +0x5e8
created by net/http.(*Server).Serve in goroutine 113
net/http/server.go:3285 +0x4b4

the proxy works in general, but I was just wondering about this error and how I would go about debugging it further?

the stacktrace indicates that it is related to the net/http package, any pointers or instructions would help.

xrstf commented 1 month ago

Can you share the CLI flags you're using to run ghproxy?

netomi commented 1 month ago

I am running the service with

        - --redis-address=redis:6379
        - --legacy-disable-disk-cache-partitions-by-auth-header=false
        - --throttling-time-ms=10
        - --get-throttling-time-ms=10
        - --log-level=error

I noticed these error mainly at startup, looks like the first requests.

Something worth to mention, not sure if this is related, but I use aiohttp python library and set the proxy parameter, so do not replace calls to github.com with the ghproxy address. Could this be the problem? Is the proxy mode the intended use or not?

netomi commented 6 days ago

ftr: I have only seen these error shortly after startup of the service. Not anymore if ghproxy is running for a while.

I also avoided now proxy mode and do url replacing instead. So far I did not encounter any problems, so lets close this issue for now.