openstack error record, keystone, shows that the resource cannot be found

About keystone, error

foreword

In the past few days of open stack training, I used the M version. Maybe I was unlucky. After six days of training, I only got the keystone for 4 days.

I have encountered more or less problems before, the main ones are: keys, identity authentication and database connection problems, but I have finished
everything.

401 is basically a problem with identity authentication.

404 means that the resource cannot be found, so it depends on the api URL, that is, the problem of the path

500 means that an unexpected operation caused an error. My trigger was to delete the database. Looking at the log, it said that the keystone database could not be found, and it came out when the database was resynchronized. The solution is to reinitialize the fernet keys,

  • I forgot to record the solution to the previous problem. The idea is:

    • Environment variable configuration problem , generally the error will point to this area vaguely, pay more attention
    • Configuration file problem , the token in the environment variable is the token in keystone.conf, both are equal
    • Database synchronization problem : After creating the database, when authorizing the database, the last thing to write is the password to connect to the database
  open  grant all privileges on keystone.* to 'keystone'@'localhost' identified by '000000'; 
	  #例如,后面的000000就是连接数据的密码
    #配置文件里的[database]选项,就应该写
    [database]
    connection = mysql+pymysql://keystone:000000@controopenller/keystone
  • Reporting that the resource cannot be found, such as the URL : Check the service API (url) created by the endpoint, as well as related command checks, logs, and use a browser to access the url to see if an error is returned. Avoid typos in urls

Dry goods start:

This is the problem I encountered on the penultimate day after the end of the training, that is, when I think of the record at this time, it is easy to check

Failed to contact the endpoint at http://controller:35357/3 for discovery. Fallback to using that endpoint as the base url. The resource could not be found. (HTTP 404)·

翻译以下就知道了,大致说的是,未能发现这个url,基于这个URL,找不到资源

What this error message says is that the resource could not be found, and I had no idea at first, but I tried to put this url ( ) in the browser later, and controller记得换回IP地址才能访问到found that the error was returned

{
    
    "error": {
    
    "message": "The resource could not be found.", "code": 404, "title": "Not Found"}}

Look at the url again: http://controller:35357/3; found that there is a lack of v, adding this v will allow normal accesshttp://controller:35357/v3

{
    
    "version": {
    
    "status": "stable", "updated": "2016-04-04T00:00:00Z", "media-types": [{
    
    "base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.6", "links": [{
    
    "href": "http://192.168.200.21:35357/v3/", "rel": "self"}]}}

Later, when I deleted this endpoint, I encountered a problem again. I couldn’t delete it. The error message showed that the resource could not be found based on this url. Yes, the resource could not be found, so why delete it; surf. I saw an article saying that the urls displayed are stored in the database ; then just change the database

MariaDB [keystone]> select * from endpoint;
+----------------------------------+--------------------+-----------+----------------------------------+--------                                                                                                                        -------------------+-------+---------+-----------+
| id                               | legacy_endpoint_id | interface | service_id                       | url                                                                                                                                               | extra | enabled | region_id |
+----------------------------------+--------------------+-----------+----------------------------------+--------                                                                                                                        -------------------+-------+---------+-----------+
| 2c57b1d4698845a383bc0ce112dfe278 | NULL               | public    | c5fd90467eec4bce9a50f9685c80cd27 | http://                                                                                                                        controller:5000/3  | {
    
    }    |       1 | RegionOne |
| 9183c8c90f0148eb9e246a6d0aebd08c | NULL               | admin     | c5fd90467eec4bce9a50f9685c80cd27 | http://                                                                                                                        controller:35357/3 | {
    
    }    |       1 | RegionOne |
| 93a6c0607a5646aeb336277d14ce8dd8 | NULL               | internal  | c5fd90467eec4bce9a50f9685c80cd27 | http://                                                                                                                        controller:5000/3  | {
    
    }    |       1 | RegionOne |
+----------------------------------+--------------------+-----------+----------------------------------+--------                                                                                                                        -------------------+-------+---------+-----------+
3 rows in set (0.01 sec)

Finally saw the data of the entity, these wrong urls, open to change

MariaDB [keystone]> update endpoint set url='http://controller:5000/v3'
    -> ;
Query OK, 3 rows affected (0.01 sec)

Perfect solution, call it a day! Keystone resumes normal operations! ! !

[root@controller ~]# openstack catalog list
+----------+----------+---------------------------------------+
| Name     | Type     | Endpoints                             |
+----------+----------+---------------------------------------+
| keystone | identity | RegionOne                             |
|          |          |   public: http://controller:5000/v3   |
|          |          | RegionOne                             |
|          |          |   admin: http://controller:35357/v3   |
|          |          | RegionOne                             |
|          |          |   internal: http://controller:5000/v3 |
|          |          |                                       |
+----------+----------+---------------------------------------+
[root@controller ~]# openstack endpoint list
+----------------------+-----------+--------------+--------------+---------+-----------+-----------------------+
| ID                   | Region    | Service Name | Service Type | Enabled | Interface | URL                   |
+----------------------+-----------+--------------+--------------+---------+-----------+-----------------------+
| 2c57b1d4698845a383bc | RegionOne | keystone     | identity     | True    | public    | http://controller:500 |
| 0ce112dfe278         |           |              |              |         |           | 0/v3                  |
| 9183c8c90f0148eb9e24 | RegionOne | keystone     | identity     | True    | admin     | http://controller:353 |
| 6a6d0aebd08c         |           |              |              |         |           | 57/v3                 |
| 93a6c0607a5646aeb336 | RegionOne | keystone     | identity     | True    | internal  | http://controller:500 |
| 277d14ce8dd8         |           |              |              |         |           | 0/v3                  |
+----------------------+-----------+--------------+--------------+---------+-----------+-----------------------+

Guess you like

Origin blog.csdn.net/weixin_61954391/article/details/130766613
Recommended