Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Error panic: runtime error: slice bounds out of range #3067

Closed
mcortinas opened this issue Jul 17, 2017 · 1 comment
Closed

Error panic: runtime error: slice bounds out of range #3067

mcortinas opened this issue Jul 17, 2017 · 1 comment

Comments

@mcortinas
Copy link

Hi,
I booted a weave instance and I can see this error:

INFO: 2017/07/17 17:16:51.167079 Command line options: map[docker-bridge:docker0 ipalloc-default-subnet:x.y.z.0/24 nickname:PREFIX_NODE-236.SUFIX_DATACENTER plugin:true datapath:datapath dns-effective-listen-address:172.17.0.1 dns-listen-address:172.17.0.1:53 http-addr:127.0.0.1:6784 port:6783 resolv-conf:/var/run/weave/etc/resolv.conf H:[unix:///var/run/weave/weave.sock] host-root:/host ipalloc-range:x.y.z.0/24 proxy:true trusted-subnets:10.2.160.0/19 weave-bridge:weave dns-domain:service.bcn1.sdisc.odigeo.com. status-addr:10.2.160.102:7070]
INFO: 2017/07/17 17:16:51.167153 weave  git-448518d50090
INFO: 2017/07/17 17:16:51.168630 Docker API on unix:///var/run/docker.sock: &[Version=17.03.1-ce ApiVersion=1.27 MinAPIVersion=1.12 GitCommit=c6d412e Os=linux Arch=amd64 KernelVersion=3.10.0-514.26.2.el7.x86_64 GoVersion=go1.7.5 BuildTime=2017-03-24T00:36:45.846383257+00:00]
INFO: 2017/07/17 17:16:51.168822 Using docker bridge IP for DNS: 172.17.0.1
INFO: 2017/07/17 17:16:51.172817 proxy listening on unix:///var/run/weave/weave.sock
INFO: 2017/07/17 17:16:51.175151 Bridge type is bridged_fastdp
INFO: 2017/07/17 17:16:51.175174 Communication between peers via untrusted networks is encrypted.
INFO: 2017/07/17 17:16:51.231989 Our name is 9e:1f:d3:7e:72:ef(PREFIX_NODE-236.SUFIX_DATACENTER)
INFO: 2017/07/17 17:16:51.232021 Launch detected - using supplied peer list: []
INFO: 2017/07/17 17:16:51.233269 Docker API on unix:///var/run/docker.sock: &[Version=17.03.1-ce GitCommit=c6d412e GoVersion=go1.7.5 Arch=amd64 BuildTime=2017-03-24T00:36:45.846383257+00:00 ApiVersion=1.27 MinAPIVersion=1.12 Os=linux KernelVersion=3.10.0-514.26.2.el7.x86_64]
INFO: 2017/07/17 17:16:51.233706 Checking for pre-existing addresses on weave bridge
INFO: 2017/07/17 17:16:51.234806 weave bridge has address x.y.z.17/24
INFO: 2017/07/17 17:16:51.255198 [allocator 9e:1f:d3:7e:72:ef] Initialising with persisted data
INFO: 2017/07/17 17:16:51.255242 Assuming quorum size of 1
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
github.com/weaveworks/weave/ipam.(*Allocator).tryOps(0xc42148c140, 0xc42148c1e0)
        /go/src/github.com/weaveworks/weave/ipam/allocator.go:255 +0x1b0
github.com/weaveworks/weave/ipam.(*Allocator).Start(0xc42148c140)
        /go/src/github.com/weaveworks/weave/ipam/allocator.go:174 +0x23c
main.createAllocator(0xc420014c80, 0x7fffd4042dc5, 0xc, 0x7fffd4042ed5, 0xc, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /go/src/github.com/weaveworks/weave/prog/weaver/main.go:617 +0x3cd
main.main()
        /go/src/github.com/weaveworks/weave/prog/weaver/main.go:391 +0x2ec3

[31267:31263 2:749] 19:17:09 Mon Jul 17 [root@PREFIX_NODE-236.SUFIX_DATACENTER: +1] ~ 
(1:749)# Jul 17 19:17:37 PREFIX_NODE-236.SUFIX_DATACENTER clean_weave_stop.sh[7950]: /usr/bin/docker rm 6e362a553c06
Jul 17 19:17:37 PREFIX_NODE-236.SUFIX_DATACENTER clean_weave_stop.sh[7950]: 6e362a553c06
Jul 17 19:17:37 PREFIX_NODE-236.SUFIX_DATACENTER clean_weave_stop.sh[7950]: /usr/bin/docker rm a67b96ad3da5
Jul 17 19:17:37 PREFIX_NODE-236.SUFIX_DATACENTER clean_weave_stop.sh[7950]: a67b96ad3da5
Jul 17 19:17:37 PREFIX_NODE-236.SUFIX_DATACENTER clean_weave_stop.sh[7950]: /usr/bin/docker rm 7b2a165600c8
Jul 17 19:17:37 PREFIX_NODE-236.SUFIX_DATACENTER clean_weave_stop.sh[7950]: 7b2a165600c8
Job for weave.service failed because the control process exited with error code. See "systemctl status weave.service" and "journalctl -xe" for details.

Let me share my environment

[31267:31263 1:753] 19:26:01 Mon Jul 17 [root@nodeSUFIX_DATACENTER: +1] ~ 
(1:753)# /usr/local/bin/weave version
weave script unreleased
weave git-448518d50090

[31267:31263 1:754] 19:26:11 Mon Jul 17 [root@nodeSUFIX_DATACENTER: +1] ~ 
(1:754)# docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Fri Mar 24 00:36:45 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Fri Mar 24 00:36:45 2017
 OS/Arch:      linux/amd64
 Experimental: false

[31267:31263 1:755] 19:26:14 Mon Jul 17 [root@nodeSUFIX_DATACENTER: +1] ~ 
(1:755)# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core) 

[31267:31263 1:756] 19:26:17 Mon Jul 17 [root@nodeSUFIX_DATACENTER: +1] ~ 
(1:756)# uname -a
Linux nodeSUFIX_DATACENTER 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
@bboreham
Copy link
Contributor

It seems it loaded persisted data, but the persisted data was empty, and the logic doesn't account for that case.

The call sequence leading to the crash is:

Allocator.Start()
Allocator.tryOps()
Claim.Try()
Allocator.establishRing()
Allocator.createRing()
Allocator.ringUpdated()
Allocator.tryPendingOps()
Allocator.tryOps()

So this is very similar to #2892.

I cannot see a code path where it would persist an empty data set, so I don't know how it got into this state.

To remove the persisted data as a work-around do docker rm -v weavedb, or just weave reset and launch again.

murali-reddy added a commit that referenced this issue Sep 25, 2018
Fixes #3067 Error panic: runtime error: slice bounds out of range
murali-reddy added a commit that referenced this issue Sep 26, 2018
@bboreham bboreham added this to the 2.5 milestone Nov 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants