Help Center/ CodeArts Build/ FAQs/ Using Docker for Build/ Failed to Push Images to SWR
Updated on 2023-12-05 GMT+08:00

Failed to Push Images to SWR

When you execute the action Build and Push Images to SWR or the action Run Docker Commands, an image may fail to be pushed due to incorrect parameters or environment problems. In this case, rectify the fault by referring to the following solutions provided for different scenarios.

Insufficient Permissions

Error log

When an image is uploaded to SWR, the following error message is displayed:

denied: you do not have the permission 
  
 [ERROR]  : [pluginFrame] step run failed, errorMessage: DEV.CB.0210044, Docker push failed

Analysis and solution

This error indicates that the current user does not have the permission on the target organization. Check the following possible causes:

  1. Edit the build task file, click Create Image and Push to SWR, and view the organization name.
  2. Log in to SWR and check whether the organization exists on the organization management page.
    • The organization does not exist. Please create an organization. (The number of organizations cannot exceed the upper limit.)
    • If the current user does not have the editing permission for the organization or image that exists in SWR, the preceding error will occur when the image is pushed. The administrator can authorize the current user by referring to User Permissions.
    • If the organization exists and the user has the edit permission on the organization, log in to the Identity and Access Management (IAM) console and check whether the user is in a user group with the read-only permission. If yes, remove the user.

Number of Organizations Reaches the Upper Limit

Error log

denied: The number of namespaces exceeds the upper limit 
  
 [ERROR] : [pluginFrame] step run failed, errorMessage: DEV.CB.0210044, Docker push failed

Analysis and solution

By default, if an unused new organization name is specified for pushing an image, SWR automatically creates an organization with the name for the current tenant. SWR limits the number of organizations that can be created by each tenant. If the number of organizations exceeds the limit, the preceding error occurs.

If this error occurs, use the administrator account (or any account with the SWR organization management permissions) to go to the Organization Management page, switch to the corresponding region, view the existing organization list, and select an existing organization or delete unnecessary organizations.

You Have Not Logged In

Error log

denied: You may not login yet 
 [ERROR] : [pluginFrame] step run failed, errorMessage: fail to execute docker command

Analysis and solution

The two possible causes are as follows:

  • If you have not run the docker login command to log in before pushing an image, add the corresponding login command.
  • The login command is executed, but the SWR address in the login command is incorrect. As a result, no error is reported but the login does not take effect. Check whether the login command is correct.

Authentication Failure

Error log

Error response from daemon: Get https://swr.example.example.com/v2/: denied: Authenticate Error 
 [ERROR] : [pluginFrame] step run failed, errorMessage: fail to execute docker command.

Analysis and solution

The possible cause is that the account or password in the login command is incorrect or the temporary login information has expired. Obtain valid login information by referring to Obtaining a Valid Login Command and try again.

Invalid Organization Name

Error log

invalid reference format 
 [ERROR] : [pluginFrame] step run failed, errorMessage: fail to execute docker command.

Analysis and solution

The SWR service has requirements on the organization name format. This error occurs when the organization name used to push an image does not meet the format requirements.

If this error occurs, go to the Organization Management page, switch to the corresponding region, and check whether the entered organization name is correct. If yes, manually create an organization with a valid name and try again.

Local Image Does Not Exist

Error log

[2022-03-05 17:01:05.816] An image does not exist locally with the tag: 
swr.example.example.com/demo/faqdemo1 
 [ERROR] : [pluginFrame] step run failed, errorMessage: fail to execute docker command.

Analysis and solution

The possible cause is that the image fails to be created or the image name and tag in the push command are incorrect. As a result, the expected image in the push command is inconsistent with the image generated from the build or tag command. Check whether the image creation process or push parameters are correct.

In this example, faqdemo1 in the image docker push swr.example.example.com/demo/faqdemo1:v1.1 is incorrect. The image name specified in the build parameter is faqdemo. Modify the push parameter and try again.

Invalid Abstract

Error log

digest invalid: Invalid digest

Analysis and solution

This problem is usually caused by unstable SWR network. Try again for several times.