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

Error running backup #61

Closed
ChrisDoernen opened this issue May 26, 2023 · 3 comments
Closed

Error running backup #61

ChrisDoernen opened this issue May 26, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@ChrisDoernen
Copy link

Hi,

I get an error when the backup is running (stack trace below).

I don't know Go, but I believe the issue is the evaluation of this regex.

The output of running the mongodump command inside the container contains the following lines before the error is thrown:

basmongodump --gzip --host *** --port 27017 -u *** -p *** --db minds-q --authenticationDatabase admin
2023-05-26T10:03:36.578+0000    writing minds-q.fs.files to dump/minds-q/fs.files.bson.gz
2023-05-26T10:03:36.579+0000    writing minds-q.fs.chunks to dump/minds-q/fs.chunks.bson.gz
2023-05-26T10:03:36.586+0000    done dumping minds-q.fs.files (1 document)
2023-05-26T10:03:36.595+0000    done dumping minds-q.fs.chunks (1 document)

The collections are MongoDB collections to store files. Maybe the regex can't handle two dots in the collection name?

Help is much appreciated. This tool is really useful, I'd be very nice to use it!

Best

Chris

Stack trace:

2023/05/26 09:59:31 http: panic serving 172.24.0.2:39012: runtime error: slice bounds out of range [-1:]
goroutine 68 [running]:
net/http.(*conn).serve.func1()
        /usr/local/go/src/net/http/server.go:1850 +0xbf
panic({0xc05c20, 0xc0002cc1c8})
        /usr/local/go/src/runtime/panic.go:890 +0x262
github.com/go-chi/chi/middleware.prettyStack.decorateFuncCallLine({}, {0xc000410178, 0x1f}, 0xd9?, 0x6)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/recoverer.go:130 +0x545
github.com/go-chi/chi/middleware.prettyStack.decorateLine({}, {0xc000410178?, 0xc0002c2c00?}, 0x8?, 0x1?)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/recoverer.go:106 +0x15d
github.com/go-chi/chi/middleware.prettyStack.parse({}, {0xc0002ff000, 0xec4, 0xad23bf?}, {0xc05c20, 0xc0002cc198})
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/recoverer.go:89 +0x4d5
github.com/go-chi/chi/middleware.PrintPrettyStack({0xc05c20, 0xc0002cc198})
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/recoverer.go:46 +0x45
github.com/go-chi/chi/middleware.Recoverer.func1.1()
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/recoverer.go:30 +0xdd
panic({0xc05c20, 0xc0002cc198})
        /usr/local/go/src/runtime/panic.go:884 +0x212
github.com/stefanprodan/mgob/pkg/backup.getDumpedDocMap({0xc000282800, 0x3ef})
        /go/src/github.com/stefanprodan/mgob/pkg/backup/local.go:98 +0x245
github.com/stefanprodan/mgob/pkg/backup.dump({{0xc0002cc038, 0x5}, {{0xc0002922b8, 0x7}, {0xc000292290, 0xc}, {0x0, 0x0}, {0xc0002cc0a8, 0x18}, ...}, ...}, ...)
        /go/src/github.com/stefanprodan/mgob/pkg/backup/local.go:70 +0x630
github.com/stefanprodan/mgob/pkg/backup.Run({{0xc0002cc038, 0x5}, {{0xc0002922b8, 0x7}, {0xc000292290, 0xc}, {0x0, 0x0}, {0xc0002cc0a8, 0x18}, ...}, ...}, ...)
        /go/src/github.com/stefanprodan/mgob/pkg/backup/backup.go:21 +0x12d
github.com/stefanprodan/mgob/pkg/api.postBackup({0x7fac3927a9f8, 0xc0002abf00}, 0xc0002c6400)
        /go/src/github.com/stefanprodan/mgob/pkg/api/backup.go:42 +0x428
net/http.HandlerFunc.ServeHTTP(0xb85fe0?, {0x7fac3927a9f8?, 0xc0002abf00?}, 0xc0002921c6?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/go-chi/chi.(*Mux).routeHTTP(0xc000284600, {0x7fac3927a9f8, 0xc0002abf00}, 0xc0002c6400)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/mux.go:436 +0x1f9
net/http.HandlerFunc.ServeHTTP(0xe19ef8?, {0x7fac3927a9f8?, 0xc0002abf00?}, 0xe11fc0?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/stefanprodan/mgob/pkg/api.configCtx.func1.1({0x7fac3927a9f8, 0xc0002abf00}, 0xc0002c6200)
        /go/src/github.com/stefanprodan/mgob/pkg/api/backup.go:24 +0x2f6
net/http.HandlerFunc.ServeHTTP(0xc000403798?, {0x7fac3927a9f8?, 0xc0002abf00?}, 0xc000403778?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000284600, {0x7fac3927a9f8, 0xc0002abf00}, 0xc0002c6200)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/mux.go:70 +0x371
github.com/go-chi/chi.(*Mux).Mount.func1({0x7fac3927a9f8, 0xc0002abf00}, 0xc0002c6200)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/mux.go:311 +0x19c
net/http.HandlerFunc.ServeHTTP(0xb85fe0?, {0x7fac3927a9f8?, 0xc0002abf00?}, 0xc0002a0045?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/go-chi/chi.(*Mux).routeHTTP(0xc000284120, {0x7fac3927a9f8, 0xc0002abf00}, 0xc0002c6200)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/mux.go:436 +0x1f9
net/http.HandlerFunc.ServeHTTP(0xc0002c6100?, {0x7fac3927a9f8?, 0xc0002abf00?}, 0x8?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/go-chi/chi/middleware.RequestLogger.func1.1({0xe19338, 0xc0002d0000}, 0xc0002c6100)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/logger.go:57 +0x3aa
net/http.HandlerFunc.ServeHTTP(0x0?, {0xe19338?, 0xc0002d0000?}, 0xf8?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/go-chi/chi/middleware.Recoverer.func1({0xe19338?, 0xc0002d0000?}, 0x129e701?)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/middleware/recoverer.go:37 +0x83
net/http.HandlerFunc.ServeHTTP(0xe19e50?, {0xe19338?, 0xc0002d0000?}, 0x129e7d0?)
        /usr/local/go/src/net/http/server.go:2109 +0x2f
github.com/go-chi/chi.(*Mux).ServeHTTP(0xc000284120, {0xe19338, 0xc0002d0000}, 0xc0002c6000)
        /go/pkg/mod/github.com/go-chi/chi@v1.5.4/mux.go:87 +0x32a
net/http.serverHandler.ServeHTTP({0xc000288d80?}, {0xe19338, 0xc0002d0000}, 0xc0002c6000)
        /usr/local/go/src/net/http/server.go:2947 +0x30c
net/http.(*conn).serve(0xc0002879a0, {0xe19ef8, 0xc000288c90})
        /usr/local/go/src/net/http/server.go:1991 +0x607
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:3102 +0x4db
@ChrisDoernen
Copy link
Author

ChrisDoernen commented Jun 30, 2023

It seems like the problem is a dash in the database name. After renaming ("minds-q" to "mindsQ"), the backup did run.

@maxisam
Copy link
Owner

maxisam commented Jul 21, 2023

Thanks for reporting it. I will find some time to fix it. Thanks!

@maxisam maxisam added the bug Something isn't working label Jul 21, 2023
maxisam added a commit that referenced this issue Sep 9, 2023
🐞 fix: handle  db collection w/ dash in regex  #61
@maxisam maxisam self-assigned this Sep 9, 2023
@maxisam
Copy link
Owner

maxisam commented Sep 9, 2023

it is fixed in #70, thx for reporting !

@maxisam maxisam closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants