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

API calls randomly failing #26

Open
aarqon opened this issue Feb 21, 2025 · 1 comment
Open

API calls randomly failing #26

aarqon opened this issue Feb 21, 2025 · 1 comment
Labels
more-information-needed More information is needed

Comments

@aarqon
Copy link

aarqon commented Feb 21, 2025

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/[email protected]/src/net/http/server.go:1947 +0xbe
panic({0x86ea20?, 0xc0003b0378?})
        /home/bryan/go/pkg/mod/golang.org/[email protected]/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/[email protected]/src/net/http/server.go:2220 +0x29
net/http.(*ServeMux).ServeHTTP(0x46a1b9?, {0x94d1b0, 0xc0001aa0e0}, 0xc000026f00)
        /home/bryan/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2747 +0x1ca
net/http.serverHandler.ServeHTTP({0xc0001b26c0?}, {0x94d1b0?, 0xc0001aa0e0?}, 0x6?)
        /home/bryan/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:3210 +0x8e
net/http.(*conn).serve(0xc00020c630, {0x94d848, 0xc000226a20})
        /home/bryan/go/pkg/mod/golang.org/[email protected]/src/net/http/server.go:2092 +0x5d0
created by net/http.(*Server).Serve in goroutine 1
        /home/bryan/go/pkg/mod/golang.org/[email protected]/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
)
@mlech-reef
Copy link
Collaborator

Hi!

No error in iterator.Err()?

Best regards,
Maciej

@mlech-reef mlech-reef added the more-information-needed More information is needed label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed More information is needed
Projects
None yet
Development

No branches or pull requests

2 participants