Skip to content

API calls randomly failing #26

@aarqon

Description

@aarqon

Description

Trying to deploy a small web file browser for a public bucket at https://cdn.vastuncharted.space and it seems like either bucket.List or the ObjectIterator is sometimes returning a zero-length array? This doesn't seem to happen at all on my local machine, only on the server where it is deployed, and you can eventually get any given directory to come up by refreshing, so I'm not really sure where the error lies or how to troubleshoot it.

Error Message

2025/02/21 17:09:14 http: panic serving [::1]:34246: runtime error: index out of range [0] with length 0
goroutine 147 [running]:
net/http.(*conn).serve.func1()
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/net/http/server.go:1947 +0xbe
panic({0x86ea20?, 0xc0003b0378?})
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/runtime/panic.go:785 +0x132
main.Handler({0x94d1b0, 0xc0001aa0e0}, 0xc000026f00)
        /home/bryan/b2-browser/main.go:49 +0x345
net/http.HandlerFunc.ServeHTTP(0xc19a20?, {0x94d1b0?, 0xc0001aa0e0?}, 0x7523d6?)
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/net/http/server.go:2220 +0x29
net/http.(*ServeMux).ServeHTTP(0x46a1b9?, {0x94d1b0, 0xc0001aa0e0}, 0xc000026f00)
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/net/http/server.go:2747 +0x1ca
net/http.serverHandler.ServeHTTP({0xc0001b26c0?}, {0x94d1b0?, 0xc0001aa0e0?}, 0x6?)
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc00020c630, {0x94d848, 0xc000226a20})
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 1
        /home/bryan/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.23.5.linux-amd64/src/net/http/server.go:3360 +0x485

go.mod

module vastuncharted/b2-browser

go 1.23.5

require (
	github.com/Backblaze/blazer v0.7.2
	gopkg.in/yaml.v2 v2.4.0
)

require (
	github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
	gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions