github.com/ncdc/docker@v0.10.1-0.20160129113957-6c6729ef5b74/errors/daemon.go (about)

     1  package errors
     2  
     3  // This file contains all of the errors that can be generated from the
     4  // docker/daemon component.
     5  
     6  import (
     7  	"net/http"
     8  
     9  	"github.com/docker/distribution/registry/api/errcode"
    10  )
    11  
    12  var (
    13  	// ErrorCodeNoSuchContainer is generated when we look for a container by
    14  	// name or ID and we can't find it.
    15  	ErrorCodeNoSuchContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
    16  		Value:          "NOSUCHCONTAINER",
    17  		Message:        "No such container: %s",
    18  		Description:    "The specified container can not be found",
    19  		HTTPStatusCode: http.StatusNotFound,
    20  	})
    21  
    22  	// ErrorCodeUnregisteredContainer is generated when we try to load
    23  	// a storage driver for an unregistered container
    24  	ErrorCodeUnregisteredContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
    25  		Value:          "UNREGISTEREDCONTAINER",
    26  		Message:        "Can't load storage driver for unregistered container %s",
    27  		Description:    "An attempt was made to load the storage driver for a container that is not registered with the daemon",
    28  		HTTPStatusCode: http.StatusInternalServerError,
    29  	})
    30  
    31  	// ErrorCodeContainerBeingRemoved is generated when an attempt to start
    32  	// a container is made but its in the process of being removed, or is dead.
    33  	ErrorCodeContainerBeingRemoved = errcode.Register(errGroup, errcode.ErrorDescriptor{
    34  		Value:          "CONTAINERBEINGREMOVED",
    35  		Message:        "Container is marked for removal and cannot be started.",
    36  		Description:    "An attempt was made to start a container that is in the process of being deleted",
    37  		HTTPStatusCode: http.StatusInternalServerError,
    38  	})
    39  
    40  	// ErrorCodeUnpauseContainer is generated when we attempt to stop a
    41  	// container but its paused.
    42  	ErrorCodeUnpauseContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
    43  		Value:          "UNPAUSECONTAINER",
    44  		Message:        "Container %s is paused. Unpause the container before stopping",
    45  		Description:    "The specified container is paused, before it can be stopped it must be unpaused",
    46  		HTTPStatusCode: http.StatusInternalServerError,
    47  	})
    48  
    49  	// ErrorCodeRemovalContainer is generated when we attempt to connect or disconnect a
    50  	// container but it's marked for removal.
    51  	ErrorCodeRemovalContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
    52  		Value:          "REMOVALCONTAINER",
    53  		Message:        "Container %s is marked for removal and cannot be connected or disconnected to the network",
    54  		Description:    "The specified container is marked for removal and cannot be connected or disconnected to the network",
    55  		HTTPStatusCode: http.StatusInternalServerError,
    56  	})
    57  
    58  	// ErrorCodePausedContainer is generated when we attempt to attach a
    59  	// container but its paused.
    60  	ErrorCodePausedContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
    61  		Value:          "CONTAINERPAUSED",
    62  		Message:        "Container %s is paused. Unpause the container before attach",
    63  		Description:    "The specified container is paused, unpause the container before attach",
    64  		HTTPStatusCode: http.StatusConflict,
    65  	})
    66  	// ErrorCodeAlreadyPaused is generated when we attempt to pause a
    67  	// container when its already paused.
    68  	ErrorCodeAlreadyPaused = errcode.Register(errGroup, errcode.ErrorDescriptor{
    69  		Value:          "ALREADYPAUSED",
    70  		Message:        "Container %s is already paused",
    71  		Description:    "The specified container is already in the paused state",
    72  		HTTPStatusCode: http.StatusInternalServerError,
    73  	})
    74  
    75  	// ErrorCodeNotPaused is generated when we attempt to unpause a
    76  	// container when its not paused.
    77  	ErrorCodeNotPaused = errcode.Register(errGroup, errcode.ErrorDescriptor{
    78  		Value:          "NOTPAUSED",
    79  		Message:        "Container %s is not paused",
    80  		Description:    "The specified container can not be unpaused because it is not in a paused state",
    81  		HTTPStatusCode: http.StatusInternalServerError,
    82  	})
    83  
    84  	// ErrorCodeImageUnregContainer is generated when we attempt to get the
    85  	// image of an unknown/unregistered container.
    86  	ErrorCodeImageUnregContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
    87  		Value:          "IMAGEUNREGCONTAINER",
    88  		Message:        "Can't get image of unregistered container",
    89  		Description:    "An attempt to retrieve the image of a container was made but the container is not registered",
    90  		HTTPStatusCode: http.StatusInternalServerError,
    91  	})
    92  
    93  	// ErrorCodeEmptyID is generated when an ID is the empty string.
    94  	ErrorCodeEmptyID = errcode.Register(errGroup, errcode.ErrorDescriptor{
    95  		Value:          "EMPTYID",
    96  		Message:        "Invalid empty id",
    97  		Description:    "An attempt was made to register a container but the container's ID can not be an empty string",
    98  		HTTPStatusCode: http.StatusInternalServerError,
    99  	})
   100  
   101  	// ErrorCodeLoggingFactory is generated when we could not load the
   102  	// log driver.
   103  	ErrorCodeLoggingFactory = errcode.Register(errGroup, errcode.ErrorDescriptor{
   104  		Value:          "LOGGINGFACTORY",
   105  		Message:        "Failed to get logging factory: %v",
   106  		Description:    "An attempt was made to register a container but the container's ID can not be an empty string",
   107  		HTTPStatusCode: http.StatusInternalServerError,
   108  	})
   109  
   110  	// ErrorCodeInitLogger is generated when we could not initialize
   111  	// the logging driver.
   112  	ErrorCodeInitLogger = errcode.Register(errGroup, errcode.ErrorDescriptor{
   113  		Value:          "INITLOGGER",
   114  		Message:        "Failed to initialize logging driver: %v",
   115  		Description:    "An error occurred while trying to initialize the logging driver",
   116  		HTTPStatusCode: http.StatusInternalServerError,
   117  	})
   118  
   119  	// ErrorCodeNotRunning is generated when we need to verify that
   120  	// a container is running, but its not.
   121  	ErrorCodeNotRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   122  		Value:          "NOTRUNNING",
   123  		Message:        "Container %s is not running",
   124  		Description:    "The specified action can not be taken due to the container not being in a running state",
   125  		HTTPStatusCode: http.StatusInternalServerError,
   126  	})
   127  
   128  	// ErrorCodeLinkNotRunning is generated when we try to link to a
   129  	// container that is not running.
   130  	ErrorCodeLinkNotRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   131  		Value:          "LINKNOTRUNNING",
   132  		Message:        "Cannot link to a non running container: %s AS %s",
   133  		Description:    "An attempt was made to link to a container but the container is not in a running state",
   134  		HTTPStatusCode: http.StatusInternalServerError,
   135  	})
   136  
   137  	// ErrorCodeDeviceInfo is generated when there is an error while trying
   138  	// to get info about a custom device.
   139  	// container that is not running.
   140  	ErrorCodeDeviceInfo = errcode.Register(errGroup, errcode.ErrorDescriptor{
   141  		Value:          "DEVICEINFO",
   142  		Message:        "error gathering device information while adding custom device %q: %s",
   143  		Description:    "There was an error while trying to retrieve the information about a custom device",
   144  		HTTPStatusCode: http.StatusInternalServerError,
   145  	})
   146  
   147  	// ErrorCodeEmptyEndpoint is generated when the endpoint for a port
   148  	// map is nil.
   149  	ErrorCodeEmptyEndpoint = errcode.Register(errGroup, errcode.ErrorDescriptor{
   150  		Value:          "EMPTYENDPOINT",
   151  		Message:        "invalid endpoint while building port map info",
   152  		Description:    "The specified endpoint for the port mapping is empty",
   153  		HTTPStatusCode: http.StatusInternalServerError,
   154  	})
   155  
   156  	// ErrorCodeEmptyNetwork is generated when the networkSettings for a port
   157  	// map is nil.
   158  	ErrorCodeEmptyNetwork = errcode.Register(errGroup, errcode.ErrorDescriptor{
   159  		Value:          "EMPTYNETWORK",
   160  		Message:        "invalid networksettings while building port map info",
   161  		Description:    "The specified endpoint for the port mapping is empty",
   162  		HTTPStatusCode: http.StatusInternalServerError,
   163  	})
   164  
   165  	// ErrorCodeParsingPort is generated when there is an error parsing
   166  	// a "port" string.
   167  	ErrorCodeParsingPort = errcode.Register(errGroup, errcode.ErrorDescriptor{
   168  		Value:          "PARSINGPORT",
   169  		Message:        "Error parsing Port value(%v):%v",
   170  		Description:    "There was an error while trying to parse the specified 'port' value",
   171  		HTTPStatusCode: http.StatusInternalServerError,
   172  	})
   173  
   174  	// ErrorCodeNoSandbox is generated when we can't find the specified
   175  	// sandbox(network) by ID.
   176  	ErrorCodeNoSandbox = errcode.Register(errGroup, errcode.ErrorDescriptor{
   177  		Value:          "NOSANDBOX",
   178  		Message:        "error locating sandbox id %s: %v",
   179  		Description:    "There was an error trying to located the specified networking sandbox",
   180  		HTTPStatusCode: http.StatusInternalServerError,
   181  	})
   182  
   183  	// ErrorCodeNetworkUpdate is generated when there is an error while
   184  	// trying update a network/sandbox config.
   185  	ErrorCodeNetworkUpdate = errcode.Register(errGroup, errcode.ErrorDescriptor{
   186  		Value:          "NETWORKUPDATE",
   187  		Message:        "Update network failed: %v",
   188  		Description:    "There was an error trying to update the configuration information of the specified network sandbox",
   189  		HTTPStatusCode: http.StatusInternalServerError,
   190  	})
   191  
   192  	// ErrorCodeNetworkRefresh is generated when there is an error while
   193  	// trying refresh a network/sandbox config.
   194  	ErrorCodeNetworkRefresh = errcode.Register(errGroup, errcode.ErrorDescriptor{
   195  		Value:          "NETWORKREFRESH",
   196  		Message:        "Update network failed: Failure in refresh sandbox %s: %v",
   197  		Description:    "There was an error trying to refresh the configuration information of the specified network sandbox",
   198  		HTTPStatusCode: http.StatusInternalServerError,
   199  	})
   200  
   201  	// ErrorCodeHostPort is generated when there was an error while trying
   202  	// to parse a "host/port" string.
   203  	ErrorCodeHostPort = errcode.Register(errGroup, errcode.ErrorDescriptor{
   204  		Value:          "HOSTPORT",
   205  		Message:        "Error parsing HostPort value(%s):%v",
   206  		Description:    "There was an error trying to parse the specified 'HostPort' value",
   207  		HTTPStatusCode: http.StatusInternalServerError,
   208  	})
   209  
   210  	// ErrorCodeNetworkConflict is generated when we try to publish a service
   211  	// in network mode.
   212  	ErrorCodeNetworkConflict = errcode.Register(errGroup, errcode.ErrorDescriptor{
   213  		Value:          "NETWORKCONFLICT",
   214  		Message:        "conflicting options: publishing a service and network mode",
   215  		Description:    "It is not possible to publish a service when it is in network mode",
   216  		HTTPStatusCode: http.StatusConflict,
   217  	})
   218  
   219  	// ErrorCodeJoinInfo is generated when we failed to update a container's
   220  	// join info.
   221  	ErrorCodeJoinInfo = errcode.Register(errGroup, errcode.ErrorDescriptor{
   222  		Value:          "JOININFO",
   223  		Message:        "Updating join info failed: %v",
   224  		Description:    "There was an error during an attempt update a container's join information",
   225  		HTTPStatusCode: http.StatusInternalServerError,
   226  	})
   227  
   228  	// ErrorCodeIPCRunning is generated when we try to join a container's
   229  	// IPC but its not running.
   230  	ErrorCodeIPCRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   231  		Value:          "IPCRUNNING",
   232  		Message:        "cannot join IPC of a non running container: %s",
   233  		Description:    "An attempt was made to join the IPC of a container, but the container is not running",
   234  		HTTPStatusCode: http.StatusInternalServerError,
   235  	})
   236  
   237  	// ErrorCodeNotADir is generated when we try to create a directory
   238  	// but the path isn't a dir.
   239  	ErrorCodeNotADir = errcode.Register(errGroup, errcode.ErrorDescriptor{
   240  		Value:          "NOTADIR",
   241  		Message:        "Cannot mkdir: %s is not a directory",
   242  		Description:    "An attempt was made create a directory, but the location in which it is being created is not a directory",
   243  		HTTPStatusCode: http.StatusInternalServerError,
   244  	})
   245  
   246  	// ErrorCodeParseContainer is generated when the reference to a
   247  	// container doesn't include a ":" (another container).
   248  	ErrorCodeParseContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
   249  		Value:          "PARSECONTAINER",
   250  		Message:        "no container specified to join network",
   251  		Description:    "The specified reference to a container is missing a ':' as a separator between 'container' and 'name'/'id'",
   252  		HTTPStatusCode: http.StatusInternalServerError,
   253  	})
   254  
   255  	// ErrorCodeJoinSelf is generated when we try to network to ourselves.
   256  	ErrorCodeJoinSelf = errcode.Register(errGroup, errcode.ErrorDescriptor{
   257  		Value:          "JOINSELF",
   258  		Message:        "cannot join own network",
   259  		Description:    "An attempt was made to have a container join its own network",
   260  		HTTPStatusCode: http.StatusInternalServerError,
   261  	})
   262  
   263  	// ErrorCodeJoinRunning is generated when we try to network to ourselves.
   264  	ErrorCodeJoinRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   265  		Value:          "JOINRUNNING",
   266  		Message:        "cannot join network of a non running container: %s",
   267  		Description:    "An attempt to join the network of a container, but that container isn't running",
   268  		HTTPStatusCode: http.StatusInternalServerError,
   269  	})
   270  
   271  	// ErrorCodeModeNotContainer is generated when we try to network to
   272  	// another container but the mode isn't 'container'.
   273  	ErrorCodeModeNotContainer = errcode.Register(errGroup, errcode.ErrorDescriptor{
   274  		Value:          "MODENOTCONTAINER",
   275  		Message:        "network mode not set to container",
   276  		Description:    "An attempt was made to connect to a container's network but the mode wasn't set to 'container'",
   277  		HTTPStatusCode: http.StatusInternalServerError,
   278  	})
   279  
   280  	// ErrorCodeRemovingVolume is generated when we try remove a mount
   281  	// point (volume) but fail.
   282  	ErrorCodeRemovingVolume = errcode.Register(errGroup, errcode.ErrorDescriptor{
   283  		Value:          "REMOVINGVOLUME",
   284  		Message:        "Error removing volumes:\n%v",
   285  		Description:    "There was an error while trying to remove the mount point (volume) of a container",
   286  		HTTPStatusCode: http.StatusInternalServerError,
   287  	})
   288  
   289  	// ErrorCodeInvalidNetworkMode is generated when an invalid network
   290  	// mode value is specified.
   291  	ErrorCodeInvalidNetworkMode = errcode.Register(errGroup, errcode.ErrorDescriptor{
   292  		Value:          "INVALIDNETWORKMODE",
   293  		Message:        "invalid network mode: %s",
   294  		Description:    "The specified networking mode is not valid",
   295  		HTTPStatusCode: http.StatusInternalServerError,
   296  	})
   297  
   298  	// ErrorCodeGetGraph is generated when there was an error while
   299  	// trying to find a graph/image.
   300  	ErrorCodeGetGraph = errcode.Register(errGroup, errcode.ErrorDescriptor{
   301  		Value:          "GETGRAPH",
   302  		Message:        "Failed to graph.Get on ImageID %s - %s",
   303  		Description:    "There was an error trying to retrieve the image for the specified image ID",
   304  		HTTPStatusCode: http.StatusInternalServerError,
   305  	})
   306  
   307  	// ErrorCodeGetLayer is generated when there was an error while
   308  	// trying to retrieve a particular layer of an image.
   309  	ErrorCodeGetLayer = errcode.Register(errGroup, errcode.ErrorDescriptor{
   310  		Value:          "GETLAYER",
   311  		Message:        "Failed to get layer path from graphdriver %s for ImageID %s - %s",
   312  		Description:    "There was an error trying to retrieve the layer of the specified image",
   313  		HTTPStatusCode: http.StatusInternalServerError,
   314  	})
   315  
   316  	// ErrorCodePutLayer is generated when there was an error while
   317  	// trying to 'put' a particular layer of an image.
   318  	ErrorCodePutLayer = errcode.Register(errGroup, errcode.ErrorDescriptor{
   319  		Value:          "PUTLAYER",
   320  		Message:        "Failed to put layer path from graphdriver %s for ImageID %s - %s",
   321  		Description:    "There was an error trying to store a layer for the specified image",
   322  		HTTPStatusCode: http.StatusInternalServerError,
   323  	})
   324  
   325  	// ErrorCodeGetLayerMetadata is generated when there was an error while
   326  	// trying to retrieve the metadata of a layer of an image.
   327  	ErrorCodeGetLayerMetadata = errcode.Register(errGroup, errcode.ErrorDescriptor{
   328  		Value:          "GETLAYERMETADATA",
   329  		Message:        "Failed to get layer metadata - %s",
   330  		Description:    "There was an error trying to retrieve the metadata of a layer for the specified image",
   331  		HTTPStatusCode: http.StatusInternalServerError,
   332  	})
   333  
   334  	// ErrorCodeEmptyConfig is generated when the input config data
   335  	// is empty.
   336  	ErrorCodeEmptyConfig = errcode.Register(errGroup, errcode.ErrorDescriptor{
   337  		Value:          "EMPTYCONFIG",
   338  		Message:        "Config cannot be empty in order to create a container",
   339  		Description:    "While trying to create a container, the specified configuration information was empty",
   340  		HTTPStatusCode: http.StatusInternalServerError,
   341  	})
   342  
   343  	// ErrorCodeNoSuchImageHash is generated when we can't find the
   344  	// specified image by its hash
   345  	ErrorCodeNoSuchImageHash = errcode.Register(errGroup, errcode.ErrorDescriptor{
   346  		Value:          "NOSUCHIMAGEHASH",
   347  		Message:        "No such image: %s",
   348  		Description:    "An attempt was made to find an image by its hash, but the lookup failed",
   349  		HTTPStatusCode: http.StatusNotFound,
   350  	})
   351  
   352  	// ErrorCodeNoSuchImageTag is generated when we can't find the
   353  	// specified image byt its name/tag.
   354  	ErrorCodeNoSuchImageTag = errcode.Register(errGroup, errcode.ErrorDescriptor{
   355  		Value:          "NOSUCHIMAGETAG",
   356  		Message:        "No such image: %s:%s",
   357  		Description:    "An attempt was made to find an image by its name/tag, but the lookup failed",
   358  		HTTPStatusCode: http.StatusNotFound,
   359  	})
   360  
   361  	// ErrorCodeMountOverFile is generated when we try to mount a volume
   362  	// over an existing file (but not a dir).
   363  	ErrorCodeMountOverFile = errcode.Register(errGroup, errcode.ErrorDescriptor{
   364  		Value:          "MOUNTOVERFILE",
   365  		Message:        "cannot mount volume over existing file, file exists %s",
   366  		Description:    "An attempt was made to mount a volume at the same location as a pre-existing file",
   367  		HTTPStatusCode: http.StatusInternalServerError,
   368  	})
   369  
   370  	// ErrorCodeMountSetup is generated when we can't define a mount point
   371  	// due to the source and destination being undefined.
   372  	ErrorCodeMountSetup = errcode.Register(errGroup, errcode.ErrorDescriptor{
   373  		Value:          "MOUNTSETUP",
   374  		Message:        "Unable to setup mount point, neither source nor volume defined",
   375  		Description:    "An attempt was made to setup a mount point, but the source and destination are undefined",
   376  		HTTPStatusCode: http.StatusInternalServerError,
   377  	})
   378  
   379  	// ErrorCodeVolumeInvalidMode is generated when the mode of a volume/bind
   380  	// mount is invalid.
   381  	ErrorCodeVolumeInvalidMode = errcode.Register(errGroup, errcode.ErrorDescriptor{
   382  		Value:          "VOLUMEINVALIDMODE",
   383  		Message:        "invalid mode: %q",
   384  		Description:    "An invalid 'mode' was specified",
   385  		HTTPStatusCode: http.StatusInternalServerError,
   386  	})
   387  
   388  	// ErrorCodeVolumeInvalid is generated when the format fo the
   389  	// volume specification isn't valid.
   390  	ErrorCodeVolumeInvalid = errcode.Register(errGroup, errcode.ErrorDescriptor{
   391  		Value:          "VOLUMEINVALID",
   392  		Message:        "Invalid volume specification: '%s'",
   393  		Description:    "An invalid 'volume' was specified in the mount request",
   394  		HTTPStatusCode: http.StatusInternalServerError,
   395  	})
   396  
   397  	// ErrorCodeVolumeAbs is generated when path to a volume isn't absolute.
   398  	ErrorCodeVolumeAbs = errcode.Register(errGroup, errcode.ErrorDescriptor{
   399  		Value:          "VOLUMEABS",
   400  		Message:        "Invalid volume destination path: '%s' mount path must be absolute.",
   401  		Description:    "An invalid 'destination' path was specified in the mount request, it must be an absolute path",
   402  		HTTPStatusCode: http.StatusInternalServerError,
   403  	})
   404  
   405  	// ErrorCodeVolumeName is generated when the name of named volume isn't valid.
   406  	ErrorCodeVolumeName = errcode.Register(errGroup, errcode.ErrorDescriptor{
   407  		Value:          "VOLUME_NAME_INVALID",
   408  		Message:        "%q includes invalid characters for a local volume name, only %q are allowed",
   409  		Description:    "The name of volume is invalid",
   410  		HTTPStatusCode: http.StatusBadRequest,
   411  	})
   412  
   413  	// ErrorCodeVolumeSlash is generated when destination path to a volume is /
   414  	ErrorCodeVolumeSlash = errcode.Register(errGroup, errcode.ErrorDescriptor{
   415  		Value:          "VOLUMESLASH",
   416  		Message:        "Invalid specification: destination can't be '/' in '%s'",
   417  		HTTPStatusCode: http.StatusInternalServerError,
   418  	})
   419  
   420  	// ErrorCodeVolumeDestIsC is generated the destination is c: (Windows specific)
   421  	ErrorCodeVolumeDestIsC = errcode.Register(errGroup, errcode.ErrorDescriptor{
   422  		Value:          "VOLUMEDESTISC",
   423  		Message:        "Destination drive letter in '%s' cannot be c:",
   424  		HTTPStatusCode: http.StatusInternalServerError,
   425  	})
   426  
   427  	// ErrorCodeVolumeDestIsCRoot is generated the destination path is c:\ (Windows specific)
   428  	ErrorCodeVolumeDestIsCRoot = errcode.Register(errGroup, errcode.ErrorDescriptor{
   429  		Value:          "VOLUMEDESTISCROOT",
   430  		Message:        `Destination path in '%s' cannot be c:\`,
   431  		HTTPStatusCode: http.StatusInternalServerError,
   432  	})
   433  
   434  	// ErrorCodeVolumeSourceNotFound is generated the source directory could not be found (Windows specific)
   435  	ErrorCodeVolumeSourceNotFound = errcode.Register(errGroup, errcode.ErrorDescriptor{
   436  		Value:          "VOLUMESOURCENOTFOUND",
   437  		Message:        "Source directory '%s' could not be found: %s",
   438  		HTTPStatusCode: http.StatusInternalServerError,
   439  	})
   440  
   441  	// ErrorCodeVolumeSourceNotDirectory is generated the source is not a directory (Windows specific)
   442  	ErrorCodeVolumeSourceNotDirectory = errcode.Register(errGroup, errcode.ErrorDescriptor{
   443  		Value:          "VOLUMESOURCENOTDIRECTORY",
   444  		Message:        "Source '%s' is not a directory",
   445  		HTTPStatusCode: http.StatusInternalServerError,
   446  	})
   447  
   448  	// ErrorCodeVolumeFromBlank is generated when path to a volume is blank.
   449  	ErrorCodeVolumeFromBlank = errcode.Register(errGroup, errcode.ErrorDescriptor{
   450  		Value:          "VOLUMEFROMBLANK",
   451  		Message:        "malformed volumes-from specification: %q",
   452  		Description:    "An invalid 'destination' path was specified in the mount request, it must not be blank",
   453  		HTTPStatusCode: http.StatusInternalServerError,
   454  	})
   455  
   456  	// ErrorCodeMountDup is generated when we try to mount two mounts points
   457  	// to the same path.
   458  	ErrorCodeMountDup = errcode.Register(errGroup, errcode.ErrorDescriptor{
   459  		Value:          "MOUNTDUP",
   460  		Message:        "Duplicate mount point '%s'",
   461  		Description:    "An attempt was made to mount a content but the specified destination location is already used in a previous mount",
   462  		HTTPStatusCode: http.StatusInternalServerError,
   463  	})
   464  
   465  	// ErrorCodeVolumeNoSourceForMount is generated when no source directory
   466  	// for a volume mount was found. (Windows specific)
   467  	ErrorCodeVolumeNoSourceForMount = errcode.Register(errGroup, errcode.ErrorDescriptor{
   468  		Value:          "VOLUMENOSOURCEFORMOUNT",
   469  		Message:        "No source for mount name '%s' driver %q destination '%s'",
   470  		HTTPStatusCode: http.StatusInternalServerError,
   471  	})
   472  
   473  	// ErrorCodeVolumeNameReservedWord is generated when the name in a volume
   474  	// uses a reserved word for filenames. (Windows specific)
   475  	ErrorCodeVolumeNameReservedWord = errcode.Register(errGroup, errcode.ErrorDescriptor{
   476  		Value:          "VOLUMENAMERESERVEDWORD",
   477  		Message:        "Volume name %q cannot be a reserved word for Windows filenames",
   478  		HTTPStatusCode: http.StatusInternalServerError,
   479  	})
   480  
   481  	// ErrorCodeCantUnpause is generated when there's an error while trying
   482  	// to unpause a container.
   483  	ErrorCodeCantUnpause = errcode.Register(errGroup, errcode.ErrorDescriptor{
   484  		Value:          "CANTUNPAUSE",
   485  		Message:        "Cannot unpause container %s: %s",
   486  		Description:    "An error occurred while trying to unpause the specified container",
   487  		HTTPStatusCode: http.StatusInternalServerError,
   488  	})
   489  
   490  	// ErrorCodePSError is generated when trying to run 'ps'.
   491  	ErrorCodePSError = errcode.Register(errGroup, errcode.ErrorDescriptor{
   492  		Value:          "PSError",
   493  		Message:        "Error running ps: %s",
   494  		Description:    "There was an error trying to run the 'ps' command in the specified container",
   495  		HTTPStatusCode: http.StatusInternalServerError,
   496  	})
   497  
   498  	// ErrorCodeNoPID is generated when looking for the PID field in the
   499  	// ps output.
   500  	ErrorCodeNoPID = errcode.Register(errGroup, errcode.ErrorDescriptor{
   501  		Value:          "NOPID",
   502  		Message:        "Couldn't find PID field in ps output",
   503  		Description:    "There was no 'PID' field in the output of the 'ps' command that was executed",
   504  		HTTPStatusCode: http.StatusInternalServerError,
   505  	})
   506  
   507  	// ErrorCodeBadPID is generated when we can't convert a PID to an int.
   508  	ErrorCodeBadPID = errcode.Register(errGroup, errcode.ErrorDescriptor{
   509  		Value:          "BADPID",
   510  		Message:        "Unexpected pid '%s': %s",
   511  		Description:    "While trying to parse the output of the 'ps' command, the 'PID' field was not an integer",
   512  		HTTPStatusCode: http.StatusInternalServerError,
   513  	})
   514  
   515  	// ErrorCodeNoTop is generated when we try to run 'top' but can't
   516  	// because we're on windows.
   517  	ErrorCodeNoTop = errcode.Register(errGroup, errcode.ErrorDescriptor{
   518  		Value:          "NOTOP",
   519  		Message:        "Top is not supported on Windows",
   520  		Description:    "The 'top' command is not supported on Windows",
   521  		HTTPStatusCode: http.StatusInternalServerError,
   522  	})
   523  
   524  	// ErrorCodeStopped is generated when we try to stop a container
   525  	// that is already stopped.
   526  	ErrorCodeStopped = errcode.Register(errGroup, errcode.ErrorDescriptor{
   527  		Value:          "STOPPED",
   528  		Message:        "Container already stopped",
   529  		Description:    "An attempt was made to stop a container, but the container is already stopped",
   530  		HTTPStatusCode: http.StatusNotModified,
   531  	})
   532  
   533  	// ErrorCodeCantStop is generated when we try to stop a container
   534  	// but failed for some reason.
   535  	ErrorCodeCantStop = errcode.Register(errGroup, errcode.ErrorDescriptor{
   536  		Value:          "CANTSTOP",
   537  		Message:        "Cannot stop container %s: %s\n",
   538  		Description:    "An error occurred while tring to stop the specified container",
   539  		HTTPStatusCode: http.StatusInternalServerError,
   540  	})
   541  
   542  	// ErrorCodeBadCPUFields is generated when the number of CPU fields is
   543  	// less than 8.
   544  	ErrorCodeBadCPUFields = errcode.Register(errGroup, errcode.ErrorDescriptor{
   545  		Value:          "BADCPUFIELDS",
   546  		Message:        "invalid number of cpu fields",
   547  		Description:    "While reading the '/proc/stat' file, the number of 'cpu' fields is less than 8",
   548  		HTTPStatusCode: http.StatusInternalServerError,
   549  	})
   550  
   551  	// ErrorCodeBadCPUInt is generated the CPU field can't be parsed as an int.
   552  	ErrorCodeBadCPUInt = errcode.Register(errGroup, errcode.ErrorDescriptor{
   553  		Value:          "BADCPUINT",
   554  		Message:        "Unable to convert value %s to int: %s",
   555  		Description:    "While reading the '/proc/stat' file, the 'CPU' field could not be parsed as an integer",
   556  		HTTPStatusCode: http.StatusInternalServerError,
   557  	})
   558  
   559  	// ErrorCodeBadStatFormat is generated the output of the stat info
   560  	// isn't parseable.
   561  	ErrorCodeBadStatFormat = errcode.Register(errGroup, errcode.ErrorDescriptor{
   562  		Value:          "BADSTATFORMAT",
   563  		Message:        "invalid stat format",
   564  		Description:    "There was an error trying to parse the '/proc/stat' file",
   565  		HTTPStatusCode: http.StatusInternalServerError,
   566  	})
   567  
   568  	// ErrorCodeTimedOut is generated when a timer expires.
   569  	ErrorCodeTimedOut = errcode.Register(errGroup, errcode.ErrorDescriptor{
   570  		Value:          "TIMEDOUT",
   571  		Message:        "Timed out: %v",
   572  		Description:    "A timer expired",
   573  		HTTPStatusCode: http.StatusInternalServerError,
   574  	})
   575  
   576  	// ErrorCodeAlreadyRemoving is generated when we try to remove a
   577  	// container that is already being removed.
   578  	ErrorCodeAlreadyRemoving = errcode.Register(errGroup, errcode.ErrorDescriptor{
   579  		Value:          "ALREADYREMOVING",
   580  		Message:        "Status is already RemovalInProgress",
   581  		Description:    "An attempt to remove a container was made, but the container is already in the process of being removed",
   582  		HTTPStatusCode: http.StatusInternalServerError,
   583  	})
   584  
   585  	// ErrorCodeStartPaused is generated when we start a paused container.
   586  	ErrorCodeStartPaused = errcode.Register(errGroup, errcode.ErrorDescriptor{
   587  		Value:          "STARTPAUSED",
   588  		Message:        "Cannot start a paused container, try unpause instead.",
   589  		Description:    "An attempt to start a container was made, but the container is paused. Unpause it first",
   590  		HTTPStatusCode: http.StatusInternalServerError,
   591  	})
   592  
   593  	// ErrorCodeAlreadyStarted is generated when we try to start a container
   594  	// that is already running.
   595  	ErrorCodeAlreadyStarted = errcode.Register(errGroup, errcode.ErrorDescriptor{
   596  		Value:          "ALREADYSTARTED",
   597  		Message:        "Container already started",
   598  		Description:    "An attempt to start a container was made, but the container is already started",
   599  		HTTPStatusCode: http.StatusNotModified,
   600  	})
   601  
   602  	// ErrorCodeHostConfigStart is generated when a HostConfig is passed
   603  	// into the start command.
   604  	ErrorCodeHostConfigStart = errcode.Register(errGroup, errcode.ErrorDescriptor{
   605  		Value:          "HOSTCONFIGSTART",
   606  		Message:        "Supplying a hostconfig on start is not supported. It should be supplied on create",
   607  		Description:    "The 'start' command does not accept 'HostConfig' data, try using the 'create' command instead",
   608  		HTTPStatusCode: http.StatusInternalServerError,
   609  	})
   610  
   611  	// ErrorCodeCantRestart is generated when an error occurred while
   612  	// trying to restart a container.
   613  	ErrorCodeCantRestart = errcode.Register(errGroup, errcode.ErrorDescriptor{
   614  		Value:          "CANTRESTART",
   615  		Message:        "Cannot restart container %s: %s",
   616  		Description:    "There was an error while trying to restart a container",
   617  		HTTPStatusCode: http.StatusInternalServerError,
   618  	})
   619  
   620  	// ErrorCodeEmptyRename is generated when one of the names on a
   621  	// rename is empty.
   622  	ErrorCodeEmptyRename = errcode.Register(errGroup, errcode.ErrorDescriptor{
   623  		Value:          "EMPTYRENAME",
   624  		Message:        "Neither old nor new names may be empty",
   625  		Description:    "An attempt was made to rename a container but either the old or new names were blank",
   626  		HTTPStatusCode: http.StatusInternalServerError,
   627  	})
   628  
   629  	// ErrorCodeRenameTaken is generated when we try to rename but the
   630  	// new name isn't available.
   631  	ErrorCodeRenameTaken = errcode.Register(errGroup, errcode.ErrorDescriptor{
   632  		Value:          "RENAMETAKEN",
   633  		Message:        "Error when allocating new name: %s",
   634  		Description:    "The new name specified on the 'rename' command is already being used",
   635  		HTTPStatusCode: http.StatusInternalServerError,
   636  	})
   637  
   638  	// ErrorCodeRenameDelete is generated when we try to rename but
   639  	// failed trying to delete the old container.
   640  	ErrorCodeRenameDelete = errcode.Register(errGroup, errcode.ErrorDescriptor{
   641  		Value:          "RENAMEDELETE",
   642  		Message:        "Failed to delete container %q: %v",
   643  		Description:    "There was an error trying to delete the specified container",
   644  		HTTPStatusCode: http.StatusInternalServerError,
   645  	})
   646  
   647  	// ErrorCodePauseError is generated when we try to pause a container
   648  	// but failed.
   649  	ErrorCodePauseError = errcode.Register(errGroup, errcode.ErrorDescriptor{
   650  		Value:          "PAUSEERROR",
   651  		Message:        "Cannot pause container %s: %s",
   652  		Description:    "There was an error trying to pause the specified container",
   653  		HTTPStatusCode: http.StatusInternalServerError,
   654  	})
   655  
   656  	// ErrorCodeNeedStream is generated when we try to stream a container's
   657  	// logs but no output stream was specified.
   658  	ErrorCodeNeedStream = errcode.Register(errGroup, errcode.ErrorDescriptor{
   659  		Value:          "NEEDSTREAM",
   660  		Message:        "You must choose at least one stream",
   661  		Description:    "While trying to stream a container's logs, no output stream was specified",
   662  		HTTPStatusCode: http.StatusInternalServerError,
   663  	})
   664  
   665  	// ErrorCodeDanglingOne is generated when we try to specify more than one
   666  	// 'dangling' specifier.
   667  	ErrorCodeDanglingOne = errcode.Register(errGroup, errcode.ErrorDescriptor{
   668  		Value:          "DANLGINGONE",
   669  		Message:        "Conflict: cannot use more than 1 value for `dangling` filter",
   670  		Description:    "The specified 'dangling' filter may not have more than one value",
   671  		HTTPStatusCode: http.StatusConflict,
   672  	})
   673  
   674  	// ErrorCodeImgDelUsed is generated when we try to delete an image
   675  	// but it is being used.
   676  	ErrorCodeImgDelUsed = errcode.Register(errGroup, errcode.ErrorDescriptor{
   677  		Value:          "IMGDELUSED",
   678  		Message:        "conflict: unable to remove repository reference %q (must force) - container %s is using its referenced image %s",
   679  		Description:    "An attempt was made to delete an image but it is currently being used",
   680  		HTTPStatusCode: http.StatusConflict,
   681  	})
   682  
   683  	// ErrorCodeImgNoParent is generated when we try to find an image's
   684  	// parent but its not in the graph.
   685  	ErrorCodeImgNoParent = errcode.Register(errGroup, errcode.ErrorDescriptor{
   686  		Value:          "IMGNOPARENT",
   687  		Message:        "unable to get parent image: %v",
   688  		Description:    "There was an error trying to find an image's parent, it was not in the graph",
   689  		HTTPStatusCode: http.StatusInternalServerError,
   690  	})
   691  
   692  	// ErrorCodeExportFailed is generated when an export fails.
   693  	ErrorCodeExportFailed = errcode.Register(errGroup, errcode.ErrorDescriptor{
   694  		Value:          "EXPORTFAILED",
   695  		Message:        "%s: %s",
   696  		Description:    "There was an error during an export operation",
   697  		HTTPStatusCode: http.StatusInternalServerError,
   698  	})
   699  
   700  	// ErrorCodeExecResize is generated when we try to resize an exec
   701  	// but its not running.
   702  	ErrorCodeExecResize = errcode.Register(errGroup, errcode.ErrorDescriptor{
   703  		Value:          "EXECRESIZE",
   704  		Message:        "Exec %s is not running, so it can not be resized.",
   705  		Description:    "An attempt was made to resize an 'exec', but the 'exec' is not running",
   706  		HTTPStatusCode: http.StatusInternalServerError,
   707  	})
   708  
   709  	// ErrorCodeContainerNotRunning is generated when we try to get the info
   710  	// on an exec but the container is not running.
   711  	ErrorCodeContainerNotRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   712  		Value:          "CONTAINERNOTRUNNING",
   713  		Message:        "Container %s is not running: %s",
   714  		Description:    "An attempt was made to retrieve the information about an 'exec' but the container is not running",
   715  		HTTPStatusCode: http.StatusConflict,
   716  	})
   717  
   718  	// ErrorCodeNoExecID is generated when we try to get the info
   719  	// on an exec but it can't be found.
   720  	ErrorCodeNoExecID = errcode.Register(errGroup, errcode.ErrorDescriptor{
   721  		Value:          "NOEXECID",
   722  		Message:        "No such exec instance '%s' found in daemon",
   723  		Description:    "The specified 'exec' instance could not be found",
   724  		HTTPStatusCode: http.StatusNotFound,
   725  	})
   726  
   727  	// ErrorCodeExecPaused is generated when we try to start an exec
   728  	// but the container is paused.
   729  	ErrorCodeExecPaused = errcode.Register(errGroup, errcode.ErrorDescriptor{
   730  		Value:          "EXECPAUSED",
   731  		Message:        "Container %s is paused, unpause the container before exec",
   732  		Description:    "An attempt to start an 'exec' was made, but the owning container is paused",
   733  		HTTPStatusCode: http.StatusConflict,
   734  	})
   735  
   736  	// ErrorCodeExecRestarting is generated when we try to start an exec
   737  	// but the container is restarting.
   738  	ErrorCodeExecRestarting = errcode.Register(errGroup, errcode.ErrorDescriptor{
   739  		Value:          "EXECRESTARTING",
   740  		Message:        "Container %s is restarting, wait until the container is running",
   741  		Description:    "An attempt to start an 'exec' was made, but the owning container is restarting",
   742  		HTTPStatusCode: http.StatusConflict,
   743  	})
   744  
   745  	// ErrorCodeExecRunning is generated when we try to start an exec
   746  	// but its already running.
   747  	ErrorCodeExecRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   748  		Value:          "EXECRUNNING",
   749  		Message:        "Error: Exec command %s is already running",
   750  		Description:    "An attempt to start an 'exec' was made, but 'exec' is already running",
   751  		HTTPStatusCode: http.StatusInternalServerError,
   752  	})
   753  
   754  	// ErrorCodeExecExited is generated when we try to start an exec
   755  	// but its already running.
   756  	ErrorCodeExecExited = errcode.Register(errGroup, errcode.ErrorDescriptor{
   757  		Value:          "EXECEXITED",
   758  		Message:        "Error: Exec command %s has already run",
   759  		Description:    "An attempt to start an 'exec' was made, but 'exec' was already run",
   760  		HTTPStatusCode: http.StatusConflict,
   761  	})
   762  
   763  	// ErrorCodeExecCantRun is generated when we try to start an exec
   764  	// but it failed for some reason.
   765  	ErrorCodeExecCantRun = errcode.Register(errGroup, errcode.ErrorDescriptor{
   766  		Value:          "EXECCANTRUN",
   767  		Message:        "Cannot run exec command %s in container %s: %s",
   768  		Description:    "An attempt to start an 'exec' was made, but an error occurred",
   769  		HTTPStatusCode: http.StatusInternalServerError,
   770  	})
   771  
   772  	// ErrorCodeExecAttach is generated when we try to attach to an exec
   773  	// but failed.
   774  	ErrorCodeExecAttach = errcode.Register(errGroup, errcode.ErrorDescriptor{
   775  		Value:          "EXECATTACH",
   776  		Message:        "attach failed with error: %s",
   777  		Description:    "There was an error while trying to attach to an 'exec'",
   778  		HTTPStatusCode: http.StatusInternalServerError,
   779  	})
   780  
   781  	// ErrorCodeExecContainerStopped is generated when we try to start
   782  	// an exec but then the container stopped.
   783  	ErrorCodeExecContainerStopped = errcode.Register(errGroup, errcode.ErrorDescriptor{
   784  		Value:          "EXECCONTAINERSTOPPED",
   785  		Message:        "container stopped while running exec",
   786  		Description:    "An attempt was made to start an 'exec' but the owning container is in the 'stopped' state",
   787  		HTTPStatusCode: http.StatusInternalServerError,
   788  	})
   789  
   790  	// ErrorCodeDefaultName is generated when we try to delete the
   791  	// default name of a container.
   792  	ErrorCodeDefaultName = errcode.Register(errGroup, errcode.ErrorDescriptor{
   793  		Value:          "DEFAULTNAME",
   794  		Message:        "Conflict, cannot remove the default name of the container",
   795  		Description:    "An attempt to delete the default name of a container was made, but that is not allowed",
   796  		HTTPStatusCode: http.StatusConflict,
   797  	})
   798  
   799  	// ErrorCodeNoParent is generated when we try to delete a container
   800  	// but we can't find its parent image.
   801  	ErrorCodeNoParent = errcode.Register(errGroup, errcode.ErrorDescriptor{
   802  		Value:          "NOPARENT",
   803  		Message:        "Cannot get parent %s for name %s",
   804  		Description:    "An attempt was made to delete a container but its parent image could not be found",
   805  		HTTPStatusCode: http.StatusInternalServerError,
   806  	})
   807  
   808  	// ErrorCodeCantDestroy is generated when we try to delete a container
   809  	// but failed for some reason.
   810  	ErrorCodeCantDestroy = errcode.Register(errGroup, errcode.ErrorDescriptor{
   811  		Value:          "CANTDESTROY",
   812  		Message:        "Cannot destroy container %s: %v",
   813  		Description:    "An attempt was made to delete a container but it failed",
   814  		HTTPStatusCode: http.StatusInternalServerError,
   815  	})
   816  
   817  	// ErrorCodeRmRunning is generated when we try to delete a container
   818  	// but its still running.
   819  	ErrorCodeRmRunning = errcode.Register(errGroup, errcode.ErrorDescriptor{
   820  		Value:          "RMRUNNING",
   821  		Message:        "Conflict, You cannot remove a running container. Stop the container before attempting removal or use -f",
   822  		Description:    "An attempt was made to delete a container but the container is still running, try to either stop it first or use '-f'",
   823  		HTTPStatusCode: http.StatusConflict,
   824  	})
   825  
   826  	// ErrorCodeRmFailed is generated when we try to delete a container
   827  	// but it failed for some reason.
   828  	ErrorCodeRmFailed = errcode.Register(errGroup, errcode.ErrorDescriptor{
   829  		Value:          "RMFAILED",
   830  		Message:        "Could not kill running container, cannot remove - %v",
   831  		Description:    "An error occurred while trying to delete a running container",
   832  		HTTPStatusCode: http.StatusInternalServerError,
   833  	})
   834  
   835  	// ErrorCodeRmNotFound is generated when we try to delete a container
   836  	// but couldn't find it.
   837  	ErrorCodeRmNotFound = errcode.Register(errGroup, errcode.ErrorDescriptor{
   838  		Value:          "RMNOTFOUND",
   839  		Message:        "Could not kill running container, cannot remove - %v",
   840  		Description:    "An attempt to delete a container was made but the container could not be found",
   841  		HTTPStatusCode: http.StatusInternalServerError,
   842  	})
   843  
   844  	// ErrorCodeRmState is generated when we try to delete a container
   845  	// but couldn't set its state to RemovalInProgress.
   846  	ErrorCodeRmState = errcode.Register(errGroup, errcode.ErrorDescriptor{
   847  		Value:          "RMSTATE",
   848  		Message:        "Failed to set container state to RemovalInProgress: %s",
   849  		Description:    "An attempt to delete a container was made, but there as an error trying to set its state to 'RemovalInProgress'",
   850  		HTTPStatusCode: http.StatusInternalServerError,
   851  	})
   852  
   853  	// ErrorCodeRmDriverFS is generated when we try to delete a container
   854  	// but the driver failed to delete its filesystem.
   855  	ErrorCodeRmDriverFS = errcode.Register(errGroup, errcode.ErrorDescriptor{
   856  		Value:          "RMDRIVERFS",
   857  		Message:        "Driver %s failed to remove root filesystem %s: %s",
   858  		Description:    "While trying to delete a container, the driver failed to remove the root filesystem",
   859  		HTTPStatusCode: http.StatusInternalServerError,
   860  	})
   861  
   862  	// ErrorCodeRmFS is generated when we try to delete a container
   863  	// but failed deleting its filesystem.
   864  	ErrorCodeRmFS = errcode.Register(errGroup, errcode.ErrorDescriptor{
   865  		Value:          "RMFS",
   866  		Message:        "Unable to remove filesystem for %v: %v",
   867  		Description:    "While trying to delete a container, the driver failed to remove the filesystem",
   868  		HTTPStatusCode: http.StatusInternalServerError,
   869  	})
   870  
   871  	// ErrorCodeRmExecDriver is generated when we try to delete a container
   872  	// but failed deleting its exec driver data.
   873  	ErrorCodeRmExecDriver = errcode.Register(errGroup, errcode.ErrorDescriptor{
   874  		Value:          "RMEXECDRIVER",
   875  		Message:        "Unable to remove execdriver data for %s: %s",
   876  		Description:    "While trying to delete a container, there was an error trying to remove th exec driver data",
   877  		HTTPStatusCode: http.StatusInternalServerError,
   878  	})
   879  
   880  	// ErrorCodeRmVolumeInUse is generated when we try to delete a container
   881  	// but failed deleting a volume because its being used.
   882  	ErrorCodeRmVolumeInUse = errcode.Register(errGroup, errcode.ErrorDescriptor{
   883  		Value:          "RMVOLUMEINUSE",
   884  		Message:        "Conflict: %v",
   885  		Description:    "While trying to delete a container, one of its volumes is still being used",
   886  		HTTPStatusCode: http.StatusConflict,
   887  	})
   888  
   889  	// ErrorCodeRmVolume is generated when we try to delete a container
   890  	// but failed deleting a volume.
   891  	ErrorCodeRmVolume = errcode.Register(errGroup, errcode.ErrorDescriptor{
   892  		Value:          "RMVOLUME",
   893  		Message:        "Error while removing volume %s: %v",
   894  		Description:    "While trying to delete a container, there was an error trying to delete one of its volumes",
   895  		HTTPStatusCode: http.StatusInternalServerError,
   896  	})
   897  
   898  	// ErrorCodeInvalidCpusetCpus is generated when user provided cpuset CPUs
   899  	// are invalid.
   900  	ErrorCodeInvalidCpusetCpus = errcode.Register(errGroup, errcode.ErrorDescriptor{
   901  		Value:          "INVALIDCPUSETCPUS",
   902  		Message:        "Invalid value %s for cpuset cpus.",
   903  		Description:    "While verifying the container's 'HostConfig', CpusetCpus value was in an incorrect format",
   904  		HTTPStatusCode: http.StatusInternalServerError,
   905  	})
   906  
   907  	// ErrorCodeInvalidCpusetMems is generated when user provided cpuset mems
   908  	// are invalid.
   909  	ErrorCodeInvalidCpusetMems = errcode.Register(errGroup, errcode.ErrorDescriptor{
   910  		Value:          "INVALIDCPUSETMEMS",
   911  		Message:        "Invalid value %s for cpuset mems.",
   912  		Description:    "While verifying the container's 'HostConfig', CpusetMems value was in an incorrect format",
   913  		HTTPStatusCode: http.StatusInternalServerError,
   914  	})
   915  
   916  	// ErrorCodeNotAvailableCpusetCpus is generated when user provided cpuset
   917  	// CPUs aren't available in the container's cgroup.
   918  	ErrorCodeNotAvailableCpusetCpus = errcode.Register(errGroup, errcode.ErrorDescriptor{
   919  		Value:          "NOTAVAILABLECPUSETCPUS",
   920  		Message:        "Requested CPUs are not available - requested %s, available: %s.",
   921  		Description:    "While verifying the container's 'HostConfig', cpuset CPUs provided aren't available in the container's cgroup available set",
   922  		HTTPStatusCode: http.StatusInternalServerError,
   923  	})
   924  
   925  	// ErrorCodeNotAvailableCpusetMems is generated when user provided cpuset
   926  	// memory nodes aren't available in the container's cgroup.
   927  	ErrorCodeNotAvailableCpusetMems = errcode.Register(errGroup, errcode.ErrorDescriptor{
   928  		Value:          "NOTAVAILABLECPUSETMEMS",
   929  		Message:        "Requested memory nodes are not available - requested %s, available: %s.",
   930  		Description:    "While verifying the container's 'HostConfig', cpuset memory nodes provided aren't available in the container's cgroup available set",
   931  		HTTPStatusCode: http.StatusInternalServerError,
   932  	})
   933  
   934  	// ErrorVolumeNameTaken is generated when an error occurred while
   935  	// trying to create a volume that has existed using different driver.
   936  	ErrorVolumeNameTaken = errcode.Register(errGroup, errcode.ErrorDescriptor{
   937  		Value:          "VOLUME_NAME_TAKEN",
   938  		Message:        "A volume named %s already exists. Choose a different volume name.",
   939  		Description:    "An attempt to create a volume using a driver but the volume already exists with a different driver",
   940  		HTTPStatusCode: http.StatusInternalServerError,
   941  	})
   942  
   943  	// ErrorCodeCmdNotFound is generated when container cmd can't start,
   944  	// container command not found error, exit code 127
   945  	ErrorCodeCmdNotFound = errcode.Register(errGroup, errcode.ErrorDescriptor{
   946  		Value:          "CMDNOTFOUND",
   947  		Message:        "Container command not found or does not exist.",
   948  		Description:    "Command could not be found, command does not exist",
   949  		HTTPStatusCode: http.StatusInternalServerError,
   950  	})
   951  
   952  	// ErrorCodeCmdCouldNotBeInvoked is generated when container cmd can't start,
   953  	// container command permission denied error, exit code 126
   954  	ErrorCodeCmdCouldNotBeInvoked = errcode.Register(errGroup, errcode.ErrorDescriptor{
   955  		Value:          "CMDCOULDNOTBEINVOKED",
   956  		Message:        "Container command could not be invoked.",
   957  		Description:    "Permission denied, cannot invoke command",
   958  		HTTPStatusCode: http.StatusInternalServerError,
   959  	})
   960  
   961  	// ErrorCodeCantStart is generated when container cmd can't start,
   962  	// for any reason other than above 2 errors
   963  	ErrorCodeCantStart = errcode.Register(errGroup, errcode.ErrorDescriptor{
   964  		Value:          "CANTSTART",
   965  		Message:        "Cannot start container %s: %s",
   966  		Description:    "There was an error while trying to start a container",
   967  		HTTPStatusCode: http.StatusInternalServerError,
   968  	})
   969  
   970  	// ErrorCodeCantDeletePredefinedNetwork is generated when one of the predefined networks
   971  	// is attempted to be deleted.
   972  	ErrorCodeCantDeletePredefinedNetwork = errcode.Register(errGroup, errcode.ErrorDescriptor{
   973  		Value:          "CANT_DELETE_PREDEFINED_NETWORK",
   974  		Message:        "%s is a pre-defined network and cannot be removed",
   975  		Description:    "Engine's predefined networks cannot be deleted",
   976  		HTTPStatusCode: http.StatusForbidden,
   977  	})
   978  
   979  	// ErrorCodeMultipleNetworkConnect is generated when more than one network is passed
   980  	// when creating a container
   981  	ErrorCodeMultipleNetworkConnect = errcode.Register(errGroup, errcode.ErrorDescriptor{
   982  		Value:          "CANNOT_CONNECT_TO_MULTIPLE_NETWORKS",
   983  		Message:        "Container cannot be connected to %s",
   984  		Description:    "A container can only be connected to one network at the time",
   985  		HTTPStatusCode: http.StatusBadRequest,
   986  	})
   987  )