sodafoundation / api

SODA Terra Project API module : is an open source implementation of SODA API connecting storage to platforms like Kubernetes, OpenStack, and VMware
Apache License 2.0
828 stars 316 forks source link

osdsdock crashes while deleting attachment #917

Open kumarashit opened 5 years ago

kumarashit commented 5 years ago

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

/kind bug /kind feature

What happened: steps: a) Used orchestration to provision volume. service tgt was stopped b) Attachment for the volume went into Error state c) Deleted the attachment from osdsctl command and this led to osdsdock getting crashed root@ubuntu:/opt/orchestration-linux-amd64# osdsctl volume list +--------------------------------------+------+-------------+---------+------+-----------+--------------------------------------+ | Id | Name | Description | GroupId | Size | Status | ProfileId | +--------------------------------------+------+-------------+---------+------+-----------+--------------------------------------+ | 511cd9fe-242f-4229-be7b-fbd800398fa7 | vol0 | | | 1 | available | b9bf50ce-b18b-4e40-9b24-2f4beaa11f24 | +--------------------------------------+------+-------------+---------+------+-----------+--------------------------------------+ root@ubuntu:/opt/orchestration-linux-amd64# osdsctl volume attachment list +--------------------------------------+--------------------------------------+------------+--------+----------------+ | Id | VolumeId | Mountpoint | Status | AccessProtocol | +--------------------------------------+--------------------------------------+------------+--------+----------------+ | d155ec2b-6665-46f6-a313-2b85fc4c2e2a | 511cd9fe-242f-4229-be7b-fbd800398fa7 | | error | | +--------------------------------------+--------------------------------------+------------+--------+----------------+ root@ubuntu:/opt/orchestration-linux-amd64# osdsctl volume attachment delete d155ec2b-6665-46f6-a313-2b85fc4c2e2a panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xa9beae]

goroutine 212 [running]: github.com/opensds/opensds/contrib/drivers/lvm.(Driver).TerminateConnection(0xc0001e4ba0, 0xc00025ee00, 0x2, 0xc0001e4ba0) /root/gopath/src/github.com/opensds/opensds/contrib/drivers/lvm/lvm.go:279 +0x12e github.com/opensds/opensds/pkg/dock.(dockServer).DeleteVolumeAttachment(0xc0002282d0, 0xd9a240, 0xc0001e7d70, 0xc00025ee00, 0x0, 0x0, 0x0) /root/gopath/src/github.com/opensds/opensds/pkg/dock/dock.go:209 +0x13c github.com/opensds/opensds/pkg/model/proto._ProvisionDock_DeleteVolumeAttachment_Handler(0xc9b0e0, 0xc0002282d0, 0xd9a240, 0xc0001e7d70, 0xc000257a40, 0x0, 0x0, 0x0, 0xc0005d8800, 0x3b8) /root/gopath/src/github.com/opensds/opensds/pkg/model/proto/model.pb.go:5055 +0x23e github.com/opensds/opensds/vendor/google.golang.org/grpc.(Server).processUnaryRPC(0xc000171200, 0xd9f600, 0xc00042f980, 0xc0001fd400, 0xc000224690, 0x1531090, 0x0, 0x0, 0x0) /root/gopath/src/github.com/opensds/opensds/vendor/google.golang.org/grpc/server.go:966 +0x4a2 github.com/opensds/opensds/vendor/google.golang.org/grpc.(Server).handleStream(0xc000171200, 0xd9f600, 0xc00042f980, 0xc0001fd400, 0x0) /root/gopath/src/github.com/opensds/opensds/vendor/google.golang.org/grpc/server.go:1245 +0xd58 github.com/opensds/opensds/vendor/google.golang.org/grpc.(Server).serveStreams.func1.1(0xc0001f4c20, 0xc000171200, 0xd9f600, 0xc00042f980, 0xc0001fd400) /root/gopath/src/github.com/opensds/opensds/vendor/google.golang.org/grpc/server.go:685 +0x9f created by github.com/opensds/opensds/vendor/google.golang.org/grpc.(Server).serveStreams.func1 /root/gopath/src/github.com/opensds/opensds/vendor/google.golang.org/grpc/server.go:683 +0xa1 [2]- Exit 2 /opt/opensds-hotpot-linux-amd64/bin/osdsdock (wd: ~)

What you expected to happen: Delete volume attachment should have worked fine

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

himanshuvar commented 4 years ago

@kumarashit Few doubts, please address. Can you please share reproduction steps for this issue? Should the volume provisioning happen through orchestration services? Volume attachment delete through cli or any client? Is this issue comes only when the attachment state is error?