package
1.10.16
Repository: https://github.com/hyperhq/hypercli.git
Documentation: pkg.go.dev

# README

Docker 'errors' package

This package contains all of the error messages generated by the Docker engine that might be exposed via the Docker engine's REST API.

Each top-level engine package will have its own file in this directory so that there's a clear grouping of errors, instead of just one big file. The errors for each package are defined here instead of within their respective package structure so that Docker CLI code that may need to import these error definition files will not need to know or understand the engine's package/directory structure. In other words, all they should need to do is import .../docker/errors and they will automatically pick up all Docker engine defined errors. This also gives the engine developers the freedom to change the engine packaging structure (e.g. to CRUD packages) without worrying about breaking existing clients.

These errors are defined using the 'errcode' package. The errcode package allows for each error to be typed and include all information necessary to have further processing done on them if necessary. In particular, each error includes:

  • Value - a unique string (in all caps) associated with this error. Typically, this string is the same name as the variable name of the error (w/o the ErrorCode text) but in all caps.

  • Message - the human readable sentence that will be displayed for this error. It can contain '%s' substitutions that allows for the code generating the error to specify values that will be inserted in the string prior to being displayed to the end-user. The WithArgs() function can be used to specify the insertion strings. Note, the evaluation of the strings will be done at the time WithArgs() is called.

  • Description - additional human readable text to further explain the circumstances of the error situation.

  • HTTPStatusCode - when the error is returned back to a CLI, this value will be used to populate the HTTP status code. If not present the default value will be StatusInternalServerError, 500.

Not all errors generated within the engine's executable will be propagated back to the engine's API layer. For example, it is expected that errors generated by vendored code (under docker/vendor) and packaged code (under docker/pkg) will be converted into errors defined by this package.

When processing an errcode error, if you are looking for a particular error then you can do something like:

import derr "github.com/docker/docker/errors"

...

err := someFunc()
if err.ErrorCode() == derr.ErrorCodeNoSuchContainer {
	...
}

# Variables

ErrorCodeAlreadyPaused is generated when we attempt to pause a container when its already paused.
ErrorCodeAlreadyRemoving is generated when we try to remove a container that is already being removed.
ErrorCodeAlreadyStarted is generated when we try to start a container that is already running.
ErrorCodeAtLeastOneArg is generated when the parser comes across a Dockerfile command that doesn't have any args.
ErrorCodeAtLeastTwoArgs is generated when the parser comes across a Dockerfile command that requires at least two args but got less.
ErrorCodeBadCPUFields is generated when the number of CPU fields is less than 8.
ErrorCodeBadCPUInt is generated the CPU field can't be parsed as an int.
ErrorCodeBadOnBuildCmd is generated when the parser comes across a an ONBUILD Dockerfile command with an invalid trigger/command.
ErrorCodeBadPID is generated when we can't convert a PID to an int.
ErrorCodeBadStatFormat is generated the output of the stat info isn't parseable.
ErrorCodeCantDeletePredefinedNetwork is generated when one of the predefined networks is attempted to be deleted.
ErrorCodeCantDestroy is generated when we try to delete a container but failed for some reason.
ErrorCodeCantKill is generated when there's an error while trying to kill a container.
ErrorCodeCantPause is generated when there's an error while trying to pause a container.
ErrorCodeCantRestart is generated when an error occurred while trying to restart a container.
ErrorCodeCantStart is generated when container cmd can't start, for any reason other than above 2 errors.
ErrorCodeCantStop is generated when we try to stop a container but failed for some reason.
ErrorCodeCantUnpause is generated when there's an error while trying to unpause a container.
ErrorCodeCantUpdate is generated when there's an error while trying to update a container.
ErrorCodeChainOnBuild is generated when the parser comes across a Dockerfile command that is trying to chain ONBUILD commands.
ErrorCodeCmdCouldNotBeInvoked is generated when container cmd can't start, container command permission denied error, exit code 126.
ErrorCodeCmdNotFound is generated when container cmd can't start, container command not found error, exit code 127.
ErrorCodeContainerBeingRemoved is generated when an attempt to start a container is made but its in the process of being removed, or is dead.
ErrorCodeContainerNotRunning is generated when we try to get the info on an exec but the container is not running.
ErrorCodeContainerRestarting is generated when an operation was made on a restarting container.
ErrorCodeDanglingOne is generated when we try to specify more than one 'dangling' specifier.
ErrorCodeDefaultName is generated when we try to delete the default name of a container.
ErrorCodeDeviceInfo is generated when there is an error while trying to get info about a custom device.
ErrorCodeEmptyConfig is generated when the input config data is empty.
ErrorCodeEmptyEndpoint is generated when the endpoint for a port map is nil.
ErrorCodeEmptyID is generated when an ID is the empty string.
ErrorCodeEmptyNetwork is generated when the networkSettings for a port map is nil.
ErrorCodeEmptyRename is generated when one of the names on a rename is empty.
ErrorCodeExactlyOneArg is generated when the parser comes across a Dockerfile command that requires exactly one arg but got less/more.
ErrorCodeExecAttach is generated when we try to attach to an exec but failed.
ErrorCodeExecCantRun is generated when we try to start an exec but it failed for some reason.
ErrorCodeExecContainerStopped is generated when we try to start an exec but then the container stopped.
ErrorCodeExecExited is generated when we try to start an exec but its already running.
ErrorCodeExecPaused is generated when we try to start an exec but the container is paused.
ErrorCodeExecResize is generated when we try to resize an exec but its not running.
ErrorCodeExecRunning is generated when we try to start an exec but its already running.
ErrorCodeExportFailed is generated when an export fails.
ErrorCodeGetGraph is generated when there was an error while trying to find a graph/image.
ErrorCodeGetLayer is generated when there was an error while trying to retrieve a particular layer of an image.
ErrorCodeGetLayerMetadata is generated when there was an error while trying to retrieve the metadata of a layer of an image.
ErrorCodeHostConfigStart is generated when a HostConfig is passed into the start command.
ErrorCodeHostPort is generated when there was an error while trying to parse a "host/port" string.
ErrorCodeImageUnregContainer is generated when we attempt to get the image of an unknown/unregistered container.
ErrorCodeImgDelUsed is generated when we try to delete an image but it is being used.
ErrorCodeImgNoParent is generated when we try to find an image's parent but its not in the graph.
ErrorCodeInitLogger is generated when we could not initialize the logging driver.
ErrorCodeInvalidCpusetCpus is generated when user provided cpuset CPUs are invalid.
ErrorCodeInvalidCpusetMems is generated when user provided cpuset mems are invalid.
ErrorCodeInvalidImageID is generated when image id specified is incorrectly formatted.
ErrorCodeInvalidNetworkMode is generated when an invalid network mode value is specified.
ErrorCodeIPCRunning is generated when we try to join a container's IPC but it's not running.
ErrorCodeJoinInfo is generated when we failed to update a container's join info.
ErrorCodeJoinRunning is generated when we try to network to ourselves.
ErrorCodeJoinSelf is generated when we try to network to ourselves.
ErrorCodeLinkNotRunning is generated when we try to link to a container that is not running.
ErrorCodeLoggingFactory is generated when we could not load the log driver.
ErrorCodeMissingFrom is generated when the Dockerfile is missing a FROM command.
ErrorCodeModeNotContainer is generated when we try to network to another container but the mode isn't 'container'.
ErrorCodeMountDup is generated when we try to mount two mounts points to the same path.
ErrorCodeMountOverFile is generated when we try to mount a volume over an existing file (but not a dir).
ErrorCodeMountSetup is generated when we can't define a mount point due to the source and destination being undefined.
ErrorCodeMultipleNetworkConnect is generated when more than one network is passed when creating a container.
ErrorCodeNeedStream is generated when we try to stream a container's logs but no output stream was specified.
ErrorCodeNetworkConflict is generated when we try to publish a service in network mode.
ErrorCodeNetworkRefresh is generated when there is an error while trying refresh a network/sandbox config.
ErrorCodeNetworkUpdate is generated when there is an error while trying update a network/sandbox config.
ErrorCodeNewerClientVersion is generated when a request from a client specifies a higher version than the server supports.
ErrorCodeNoExecID is generated when we try to get the info on an exec but it can't be found.
ErrorCodeNoHijackConnection is generated when a request tries to attach to a container but the connection to hijack is not provided.
ErrorCodeNoParent is generated when we try to delete a container but we can't find its parent image.
ErrorCodeNoPID is generated when looking for the PID field in the ps output.
ErrorCodeNoSandbox is generated when we can't find the specified sandbox(network) by ID.
ErrorCodeNoSuchContainer is generated when we look for a container by name or ID and we can't find it.
ErrorCodeNoSuchImageHash is generated when we can't find the specified image by its hash.
ErrorCodeNoSuchImageTag is generated when we can't find the specified image byt its name/tag.
ErrorCodeNotADir is generated when we try to create a directory but the path isn't a dir.
ErrorCodeNotAvailableCpusetCpus is generated when user provided cpuset CPUs aren't available in the container's cgroup.
ErrorCodeNotAvailableCpusetMems is generated when user provided cpuset memory nodes aren't available in the container's cgroup.
ErrorCodeNotOnWindows is generated when the specified Dockerfile command is not supported on Windows.
ErrorCodeNoTop is generated when we try to run 'top' but can't because we're on windows.
ErrorCodeNotPaused is generated when we attempt to unpause a container when its not paused.
ErrorCodeNotRunning is generated when we need to verify that a container is running, but its not.
ErrorCodeOldClientVersion is generated when a request from a client specifies a version lower than the minimum version supported by the server.
ErrorCodeParseContainer is generated when the reference to a container doesn't include a ":" (another container).
ErrorCodeParsingPort is generated when there is an error parsing a "port" string.
ErrorCodePausedContainer is generated when we attempt to attach a container but its paused.
ErrorCodePauseError is generated when we try to pause a container but failed.
ErrorCodePSError is generated when trying to run 'ps'.
ErrorCodePutLayer is generated when there was an error while trying to 'put' a particular layer of an image.
ErrorCodeRemovalContainer is generated when we attempt to connect or disconnect a container but it's marked for removal.
ErrorCodeRemovingVolume is generated when we try remove a mount point (volume) but fail.
ErrorCodeRenameDelete is generated when we try to rename but failed trying to delete the old container.
ErrorCodeRenameTaken is generated when we try to rename but the new name isn't available.
ErrorCodeRmDriverFS is generated when we try to delete a container but the driver failed to delete its filesystem.
ErrorCodeRmExecDriver is generated when we try to delete a container but failed deleting its exec driver data.
ErrorCodeRmFailed is generated when we try to delete a container but it failed for some reason.
ErrorCodeRmFS is generated when we try to delete a container but failed deleting its filesystem.
ErrorCodeRmNotFound is generated when we try to delete a container but couldn't find it.
ErrorCodeRmRunning is generated when we try to delete a container but its still running.
ErrorCodeRmState is generated when we try to delete a container but couldn't set its state to RemovalInProgress.
ErrorCodeRmVolume is generated when we try to delete a container but failed deleting a volume.
ErrorCodeRmVolumeInUse is generated when we try to delete a container but failed deleting a volume because its being used.
ErrorCodeStartPaused is generated when we start a paused container.
ErrorCodeStopped is generated when we try to stop a container that is already stopped.
ErrorCodeTimedOut is generated when a timer expires.
ErrorCodeTooManyArgs is generated when the parser comes across a Dockerfile command that has more args than it should.
ErrorCodeUnpauseContainer is generated when we attempt to stop a container but its paused.
ErrorCodeUnregisteredContainer is generated when we try to load a storage driver for an unregistered container.
ErrorCodeVolumeAbs is generated when path to a volume isn't absolute.
ErrorCodeVolumeDestIsC is generated the destination is c: (Windows specific).
ErrorCodeVolumeDestIsCRoot is generated the destination path is c:\ (Windows specific).
ErrorCodeVolumeEmpty is generated when the specified Volume string is empty.
ErrorCodeVolumeFromBlank is generated when path to a volume is blank.
ErrorCodeVolumeInvalid is generated when the format fo the volume specification isn't valid.
ErrorCodeVolumeInvalidMode is generated when the mode of a volume/bind mount is invalid.
ErrorCodeVolumeName is generated when the name of named volume isn't valid.
ErrorCodeVolumeNameReservedWord is generated when the name in a volume uses a reserved word for filenames.
ErrorCodeVolumeNoSourceForMount is generated when no source directory for a volume mount was found.
ErrorCodeVolumeSlash is generated when destination path to a volume is /.
ErrorCodeVolumeSourceNotDirectory is generated the source is not a directory (Windows specific).
ErrorCodeVolumeSourceNotFound is generated the source directory could not be found (Windows specific).
ErrorNetworkControllerNotEnabled is generated when the networking stack in not enabled for certain platforms, like windows.
ErrorVolumeNameTaken is generated when an error occurred while trying to create a volume that has existed using different driver.