Export to GitHub

weed-fs - issue #13

Slice bounds out of range, when deleting all images in store 0.26


Posted on Dec 31, 2012 by Swift Lion

It seems when you delete all of the images, you get a error, and I could not add any more images:

http: panic serving [::1]:60851: runtime error: slice bounds out of range 56/usr/local/go/src/pkg/net/http/server.go:589 (0x80b928a) 57/usr/local/go/src/pkg/runtime/proc.c:1443 (0x8060363) 58/usr/local/go/src/pkg/runtime/runtime.c:128 (0x8060e7b) 59/usr/local/go/src/pkg/runtime/runtime.c:91 (0x8060d59) 60/home/rootcoma/git-repos/weed-fs/weed-fs/src/pkg/storage/needle_read_write.go:78 (0x80876fc) 61/home/rootcoma/git-repos/weed-fs/weed-fs/src/pkg/storage/volume.go:135 (0x808c643) 62/home/rootcoma/git-repos/weed-fs/weed-fs/src/pkg/storage/store.go:190 (0x808b677) 63/home/rootcoma/git-repos/weed-fs/weed-fs/src/cmd/weed/volume.go:120 (0x804dbe7) 64/home/rootcoma/git-repos/weed-fs/weed-fs/src/cmd/weed/volume.go:90 (0x804d5bb) 65/usr/local/go/src/pkg/net/http/server.go:703 (0x80ae0a5) 66/usr/local/go/src/pkg/net/http/server.go:941 (0x80aeca6) 67/usr/local/go/src/pkg/net/http/server.go:669 (0x80adef1) 68/usr/local/go/src/pkg/runtime/proc.c:271 (0x805e6e1)

Steps: 1. add 5 or 6 images 2. delete them all

Expected output would be to allow further storing of files at least, and not display error hopefully.

0.26, windows 64bit and linux 32bit

Comment #1

Posted on Dec 31, 2012 by Swift Lion

Also ran this with 1 volume server with max=5, so I would add at least one image to all 5 volumes, then empty them of images completely.

Comment #2

Posted on Dec 31, 2012 by Grumpy Cat

This is related to the automatic reclaiming free spaces. By default, weedfs created 5 volumes, and with maximum also set to 5. If every volume has only one deleted file, all of the volumes will be in read-only mode.

Before the fix, the workaround would be to increase the default max, from max=5 to max=15, for example.

Comment #3

Posted on Jan 2, 2013 by Grumpy Cat

Fixed in the master branch.

Status: Fixed

Labels:
Type-Defect Priority-Medium