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

library is using panic intead of retuning error #33

Open
depohmel opened this issue Apr 4, 2019 · 6 comments
Open

library is using panic intead of retuning error #33

depohmel opened this issue Apr 4, 2019 · 6 comments

Comments

@depohmel
Copy link
Contributor

depohmel commented Apr 4, 2019

there are many places when the library is panicking this is not the desired approach.
example

 value *errors.fundamental = Failed to create volume. {Code:E0011, Description:Failed to find the storage with storage id %!d(string=Volume order failed). Description: %!s(MISSING) [Backend Error:SoftLayer_Exception_Order_AccountDiscount: As an active participant of the Technology Incubator Program, you may only place one order at a time. Currently you have a pending order that needs final disposition before you can place another order. (HTTP 500)], Type:StorageFindFailed, RC:500} ("Failed to create volume. {Code:E0011, Description:Failed to find the storage with storage id %!d(string=Volume order failed). Description: %!s(MISSING) [Backend Error:SoftLayer_Exception_Order_AccountDiscount: As an active participant of the Technology Incubator Program, you may only place one order at a time. Currently you have a pending order that needs final disposition before you can place another order. (HTTP 500)], Type:StorageFindFailed, RC:500}")

The ideal behavior would be to return an error.

@arahamad-zz
Copy link
Member

arahamad-zz commented Apr 5, 2019

@depohmel , Can you please point out the place, do you mean this is newly added ?

I agree that we should return error instead panicking.

I think this is your a/c issue and its old issue . we will fix this

@depohmel
Copy link
Contributor Author

depohmel commented Apr 5, 2019

This is an old issue.
Here is a stack trace:

"stacktrace":"
github.com/IBM/ibmcloud-storage-volume-lib/volume-providers/softlayer/block.(*SLBlockSession).VolumeCreateFromSnapshot
github.com/IBM/ibmcloud-storage-volume-lib/volume-providers/softlayer/block/block_volume_manager.go:333
github.com/kanisterio/kanister/pkg/blockstorage/ibm.(*ibmCloud).VolumeCreateFromSnapshot
github.com/kanisterio/kanister/pkg/blockstorage/ibm/ibmcloud.go:280
github.com/kanisterio/kanister/pkg/blockstorage/ibm.TestIBMCloudBlock.TestVolRestore
github.com/kanisterio/kanister/pkg/blockstorage/ibm/ibmcloud_test.go:111
runtime.call32
/usr/local/go/src/runtime/asm_amd64.s:522
reflect.Value.call
/usr/local/go/src/reflect/value.go:447
reflect.Value.Call
/usr/local/go/src/reflect/value.go:308

@narkarum
Copy link
Contributor

Snapshot behavior is not yet ready from backend.

@narkarum
Copy link
Contributor

narkarum commented Jul 8, 2019

Can you test with latest code?

@aru-robin
Copy link

I am still seeing this.

To repro:
Place 3 volume orders consecutively

`[root@centos-60-204 ~]# ibmcloud sl block volume-order --storage-type performance --size 300 --iops 6000 --os-type LINUX --datacenter dal10
This action will incur charges on your account. Continue?> y
OK
Order 46169688 was placed.

Storage as a Service

Block Storage

300 GBs

6000 IOPS

You may run 'bx sl block volume-list --order 46169688' to find this block volume after it is ready.
[root@centos-60-204 ~]# ibmcloud sl block volume-order --storage-type performance --size 300 --iops 6000 --os-type LINUX --datacenter dal10
This action will incur charges on your account. Continue?> y
OK
Order 46172466 was placed.

Storage as a Service

You may run 'bx sl block volume-list --order 46172466' to find this block volume after it is ready.
[root@centos-60-204 ~]# ibmcloud sl block volume-order --storage-type performance --size 300 --iops 6000 --os-type LINUX --datacenter dal10
This action will incur charges on your account. Continue?> y
Failed to order block volume.Please verify your options and try again.
SoftLayer_Exception_Order_AccountDiscount: As an active participant of the Technology Incubator Program, you may only place one order at a time. Currently you have a pending order that needs final disposition before you can place another order. (HTTP 500)`

As you can see below, 1st order got approved and a block storage was created. For the 2nd order, the block storage was not created and this was blocking to provision another volume-order. Is there a way to get the status of the volume-order ???

[root@centos-60-204 ~]# bx sl block volume-list --order 46169688 id username datacenter storage_type capacity_gb bytes_used ip_addr lunId active_transactions 95246678 SL02SL1954062-14 dal10 performance_block_storage 300 - 161.26.98.111 11 0 [root@centos-60-204 ~]# bx sl block volume-list --order 46172466 id username datacenter storage_type capacity_gb bytes_used ip_addr lunId active_transactions

@narkarum
Copy link
Contributor

The above PR would resolve the issue. #173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants