我要评分
获取效率
正确性
完整性
易理解

"HTTP 401 Unauthorized" or "Service Unavailable (HTTP 503)" Error in Execution of OpenStack Commands

Symptom

The following error information is displayed when the openstack image create command is executed:

1
HTTP 401 Unauthorized: This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
1
503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)

The following error information is displayed when the openstack image list command is executed:

1
Unauthorized (HTTP 401)
1
Service Unavailable (HTTP 503)

Key Process and Cause Analysis

The HTTP 401 error indicates an authentication failure. You need to check whether the passwords of OpenStack users in the configuration files are correct and whether the role permissions are correctly configured. This issue may also occur in other OpenStack components.

Conclusion and Solution

  1. Check that the passwords in each configuration file are correct.
  2. Check that the component user is added as an administrator.

    The following uses the glance user of the Glance component as an example. Run the following command to check whether the glance user is added as an administrator:

    1
    openstack role assignment list --project service --user glance --names
    

    The preceding figure shows that the glance user is assigned with the admin role in the service project.

    If Role is not admin in the command output, run the following command to add the glance user as an administrator:

    1
    openstack role add --project service --user glance admin