Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

error code is not reported to 'docker volume get' #628

Closed
msterin opened this issue Oct 17, 2016 · 5 comments
Closed

error code is not reported to 'docker volume get' #628

msterin opened this issue Oct 17, 2016 · 5 comments
Assignees
Milestone

Comments

@msterin
Copy link
Contributor

msterin commented Oct 17, 2016

When server returns error on get() operation, this error is not reported to Docker command line.
To repro, add an error to server vmdk_ops.getVMDK() - it shows in the error log on ESX but not reported on Docker:

ESX:

10/15/16 08:04:40 52044 [photon-1] [INFO   ] executeRequest 'get' completed with ret=Failed to get disk details for /vmfs/volumes/vsanDatastore/dockvols/v11.vmdk

Guest:

 docker volume inspect v11@vsanDatastore
[]
Error: No such volume: v11@vsanDatastore
root@photon-1 [ ~ ]# 

(found when investigating #627 )

@govint
Copy link
Contributor

govint commented Oct 18, 2016

The code returns the error to the client (from the guest) and the client plugin code also returns the error to docker. Seems like docker is displaying the error when it gets an error response.

Checked the plugin code and into go-plugin-helpers and the error is being passed on. But in engine-api/client/volume_inspect.go:VolumeInspectWithRaw() the response from Get is mapped to the below error if the status was "not found"

Server


10/18/16 08:19:16 3467214 [2] [INFO ] executeRequest 'get' completed with ret={'Error': 'Volume testvol-5000 not found (file: /vmfs/volumes/bigone/dockvols/testvol-5000.vmdk)'}


Guest


$ docker volume inspect testvol-5000
[]
Error: No such volume: testvol-5000


@msterin
Copy link
Contributor Author

msterin commented Oct 18, 2016

@govint - can you open a related issue for engine-api then? They need to print original error msg too...

@govint
Copy link
Contributor

govint commented Oct 18, 2016

This is the code:


// VolumeInspectWithRaw returns the information about a specific volume in the docker host and it's raw representation
func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
var volume types.Volume
resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil)
if err != nil {
if resp.statusCode == http.StatusNotFound { <-------- code seems to be setting this status, otherwise, the error returned by the plugin is returned below.
return volume, nil, volumeNotFoundError{volumeID}
}
return volume, nil, err
}
.....


@shaominchen
Copy link
Contributor

Hi Govindan, can you take care of this since you already have some analysis?

@govint
Copy link
Contributor

govint commented Feb 7, 2017

This is an issue with how docker is handling errors returned from Get(). I'll raise an issue on Docker and closing this one as there are no changes for the plugin.

@govint govint closed this as completed Feb 7, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

4 participants