Updated on 2023-12-01 GMT+08:00

login Command Execution Failed

Symptom 1

After you add the deployment action Run Docker Command and set Command to login, the error message unauthorized: authentication required is displayed.

Cause Analysis

Authentication fails due to incorrect username or password.

Solution

Enter the correct username and password.

Symptom 2

During the deployment of the login command in the action Run Docker Command, an error message indicating no permissions is displayed.

Cause Analysis

Only the root user and users in the Docker user group are allowed to perform operations on Docker.

Solution

Add the user to the Docker user group.

For details about how to add a user to the Docker user group, see No Deployment Permissions.

Symptom 3

During the deployment of the login command in the action Run Docker Command, the error message request canceled while waiting for connection(Client.Timeout exceeded while awaiting headers) is displayed.

Cause Analysis

1. The image repository address is incorrect. As a result, the connection fails and Docker fails to verify the v2 interface.

2. The host does not have the permission to access external networks or is not configured with a proxy. As a result, the connection to the remote image repository times out.

Solution

1. Check the image repository address to ensure that the image repository address is correct and reachable.

2. Configure a proxy for the host to connect to the image repository.

Symptom 4

During the deployment of the login command in the action Run Docker Command, two error messages are displayed: certificate signed by unknown authority and Task failed may be associated with not configured trust.

Cause Analysis

No certificates have been configured for the image repository, and the target host has not been authorized to access this repository.

Solution

  • Check that the image repository address, username, and password are correct, and that the network connection and user permissions are normal.
  • During host authorization, Docker will be restarted and containers will be stopped. To prevent this from happening, configure the required image repository address in advance.

Case 1

No container is running, or the container is interrupted. The interruption does not affect services.
  1. In the deployment action details area, set Command to login and select Yes for Restart Docker.
  2. If you need to restart the containers, add the action Run Docker Command and set Command to restart in the action details.
  3. Click Save & Deploy.

Case 2

Containers are running, and a service interruption is not allowed.
  1. Check whether the /etc/docker/daemon.json file exists.
    1. If the file does not exist, create it and add the following configuration to the file:
      {
        "live-restore": true
      }
    2. If the file already exists, add the following configuration to it:

      • For details about how to set the live-restore parameter, visit the official website https://docs.docker.com/config/containers/live-restore/
      • The live-restore parameter can be used to prevent containers from being stopped due to engine upgrades or restarts. Note that live-restore cannot be used in swarm mode. Therefore, live-restore is unavailable for clusters.
  2. Authorize the host to access the image repository.
    1. In the /etc/docker/daemon.json file, configure the repository address as follows:
       {
        "insecure-registries" : ["10.10.**.**","10.10.**.**:8080"],
        "live-restore": true
      }
  3. Make the modification take effect.
    1. If you use systemd, run the following command to load the configuration:
      systemctl reload docker
    2. If systemd cannot be used due to version incompatibility, run the following command to restart Docker. (Note that this operation will stop running containers.) Then, add action Restart Containers.
      service docker restart

Running Docker Commands FAQs

more