Ask Your Question
1

Keystone An unexpected error prevented the server from fulfilling your request. (HTTP 500)

asked 2014-05-21 13:30:30 -0500

jsudhams gravatar image

updated 2014-07-04 06:21:55 -0500

Dear All, I am trying to set up a three node cloud and when i try to create first admin user i am getting the above error, please help.

The controller name is controller-1 and name resolution is working, the following is the exact procedure followed..

[root@controller-1 keystone]# openstack-config --set /etc/keystone/keystone.conf database connection mysql://keystone:Pass1234@controller-1/keystone
[root@controller-1 keystone]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE keystone;
Query OK, 1 row affected (0.01 sec)

mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost'   IDENTIFIED BY 'Pass1234';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%'  IDENTIFIED BY 'Pass1234';
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye
[root@controller-1 keystone]# su -s /bin/sh -c "keystone-manage db_sync" keystone
[root@controller-1 keystone]# ADMIN_TOKEN=$(openssl rand -hex 10)
[root@controller-1 keystone]# echo $ADMIN_TOKEN
ea0a7be7a074d015cd36
[root@controller-1 keystone]# ^C
[root@controller-1 keystone]# openstack-config --set /etc/keystone/keystone.conf DEFAULT admin_token $ADMIN_TOKEN
[root@controller-1 keystone]# keystone-manage pki_setup --keystone-user keystone --keystone-group keystone

[root@controller-1 keystone]#
[root@controller-1 keystone]# chown -R keystone:keystone /etc/keystone/ssl
[root@controller-1 keystone]# chmod -R o-rwx /etc/keystone/ssl
[root@controller-1 keystone]# service openstack-keystone start
[root@controller-1 keystone]# service openstack-keystone restart
Stopping keystone:                                         [  OK  ]
Starting keystone:                                         [  OK  ]
[root@controller-1 keystone]# chkconfig openstack-keystone on
[root@controller-1 keystone]# export OS_SERVICE_TOKEN=ea0a7be7a074d015cd36
[root@controller-1 keystone]# export OS_SERVICE_ENDPOINT=http://controller-1:35357/v2.0
[root@controller-1 keystone]# keystone user-create --name=admin --pass=Pass1234 --email=cloudadmin@t.com
An unexpected error prevented the server from fulfilling your request. (HTTP 500)
[root@controller-1 keystone]#
edit retag flag offensive close merge delete

Comments

Hi, jsudhams, have you solved this problem? seems i'm facing the same problem without a solution...

Baby_Ape gravatar imageBaby_Ape ( 2014-07-04 02:37:04 -0500 )edit

have you solved this problem? i'm facing this very same problem

Baby_Ape gravatar imageBaby_Ape ( 2014-07-04 02:38:23 -0500 )edit

10 answers

Sort by ยป oldest newest most voted
1

answered 2014-11-19 11:36:32 -0500

jsudhams gravatar image

Checked the DB tables and found that is was not created so i droppped the DB and followed below commmands and it worked it worked immediately

The Identity Service uses a database to store information. Specify the location of the database in the configuration file. In this guide, we use a MySQL database on the controller node with the username keystone. Replace KEYSTONE_DBPASS with a suitable password for the database user.

# openstack-config --set /etc/keystone/keystone.conf \ database connection mysql://keystone:KEYSTONE_DBPASS@[you controller name]/keystone

Use the password that you set previously to log in as root. Create a keystone database user:

$ mysql -u root -p mysql> CREATE DATABASE keystone; mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \ IDENTIFIED BY 'KEYSTONE_DBPASS'; mysql> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \ IDENTIFIED BY 'KEYSTONE_DBPASS'; mysql> exit

Create the database tables for the Identity Service:

su -s /bin/sh -c "keystone-manage db_sync" keystone

After the above command login to mysql and check if tables are created and after that the user create command works fine

edit flag offensive delete link more

Comments

curl -v -H "X-Auth-Token: admin_token " http://localhost:35357/v2.0/tenants

this helped me resolve {"error": {"message": "An unexpected error prevented the server from fulfilling your request.", "code": 500, "title": "Internal Server Error"}}....Thanks!

sparayil gravatar imagesparayil ( 2017-04-13 19:54:24 -0500 )edit
1

answered 2015-08-07 17:40:31 -0500

thierryv8 gravatar image

Hi,

I navigated between many forums to figure out the answer and I found out a good solution, which is working for me:

Instead of typing the command: # su -s /bin/sh -c "keystone-manage db_sync" keystone, you must type only: /bin/sh -c "keystone-manage db_sync" keystone

The issue came that: if you have already loggin as a root so you haven't needed anymore to use the "su -s" command.

After that, you can execute the command: openstack service create --name keystone ==description "OpenStack Identity" identity, which will work perfectly fine.

by thierryv8

edit flag offensive delete link more

Comments

You helped me lot. I use your method to solve the problem.thanks~~~~

allways gravatar imageallways ( 2015-11-05 02:01:02 -0500 )edit

Been trying to trouble shoot this for hours, checking mysql and apache config over and over. Thank you!

D3LTA9 gravatar imageD3LTA9 ( 2016-05-01 00:16:38 -0500 )edit
0

answered 2014-12-02 06:59:17 -0500

iffyshot gravatar image

hi

when i run this

su -s /bin/sh -c "keystone-manage db_sync" keystone

i get access denied even though i am using the password in the keystone.conf file

any ideas

edit flag offensive delete link more

Comments

mysql> grant all privileges on keystone.* to 'keystone'@'localhost' identified by 'pass'; Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> grant all privileges on keystone.* to keystone@'%' identified by 'pass'; Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> flush privileges

sparayil gravatar imagesparayil ( 2017-04-13 19:56:55 -0500 )edit
0

answered 2017-02-06 04:51:43 -0500

Just drop the database keystone and create it again , which works fine for me! Good luck!

edit flag offensive delete link more
0

answered 2017-02-05 12:31:32 -0500

TechGuyChris gravatar image

When I did encountered this, my issues were the following:

  • The variable that "ServerName" was set to in /etc/httpd/conf/httpd.conf was not the name of my server
  • The variable "ServerName" in /etc/httpd/conf/httpd.conf was mistakently typed as "Servername" and not "ServerName" (Notice the n was lowercase when it should have been capitalized)
  • The Bootstrap identity service was not pointing to my servername and was instead pointing to the default "controller" servername given in the instructions. Its not ideal to simply always copy and paste.
  • The OS_AUTH_URL environment variable was pointing to the default controller servername given in the instructions.

My problem was simply a copy paste, copy paste, copy paste issue. :-( .Once I corrected this everything worked fine.

Keep in mind that once you update this, you simply need to run commands:

systemctl stop httpd.service systemctl start httpd.service

This way your changes will take affect.

edit flag offensive delete link more
0

answered 2016-01-14 20:05:17 -0500

Kernel_Panic gravatar image

I had single quotes around mariadb password in keystone.conf mysql connection uri

Changed it from

[database] ... connection = mysql://keystone:'KEYSTONE_DBPASS'@controller/keystone

To..

[database] ... connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone

and viola!

edit flag offensive delete link more
0

answered 2015-09-02 04:17:57 -0500

jValle gravatar image

Hi, I have the same mistake. When i try to create an admin user, I have this error:

An unexpected error prevented the server from fulfilling your request. (HTTP 500)

Before i introduced this command:

keystone tenant-create --name admin --description "Admin Tenant"

But i have other error before. When i introduced the command:

su -s /bin/sh -c "keystone -manage db_sync" keystone

And the error was:

OperationError: (OperationError) (1130, "Host 'controller' is not allowed to connect to this MariaDB server") None None

This last error was after the configure prerequisites the OpenStack Identity service.

Please, help!

edit flag offensive delete link more
0

answered 2014-11-21 03:23:27 -0500

cul1n1 gravatar image

I was also having same error while creating tenant, following these http://docs.openstack.org/juno/install-guide/install/apt/content/keystone-install.html (steps). I was logged in as root, and executing "su -s /bin/sh -c "keystone-manage db_sync" keystone" command, I removed "su -" part from command as I was logged in with root user, it didn't gave me any error. I was unable to create tenant so I re-executed the steps given, but this time without removing "su -" part from command. This time everything worked fine.

edit flag offensive delete link more
0

answered 2014-05-21 17:00:25 -0500

fgorbat gravatar image

updated 2014-05-21 19:20:23 -0500

Hey, Check if the keystone service is up by

[root@my-controller1 root]# netstat -anutp|grep 35357
tcp        0      0 0.0.0.0:35357               0.0.0.0:*                   LISTEN      27874/python
[root@my-controller1 root]#

also it will be great to check the keystone by

telnet 0 35357

you should be able to see something like this

Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
get
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 400.
<p>Message: Bad request syntax ('get').
<p>Error code explanation: 400 = Bad request syntax or unsupported method.
</body>
Connection closed by foreign host.
edit flag offensive delete link more

Comments

hi i checked and keystone service seems to be running.. Here is the output

[root@controller-1 ~]# netstat -anutp|grep 35357 tcp 0 0 0.0.0.0:35357 0.0.0.0:* LISTEN 2077/python tcp 0 0 127.0.0.1:33350 127.0.0.1:35357 TIME_WAIT - [root@controller-1 ~]# telnet 0 35357 Trying 0.0.0.0... Connected to 0. Escape character is '^]'.

Connection closed by foreign host. [root@controller-1 ~]# telnet 0 35357 Trying 0.0.0.0... Connected to 0. Escape character is '^]'. get <head> <title>Error response</title> </head> <body>

Error response

Error code 400.

Message: Bad request syntax ('get').

Error code explanation: 400 = Bad request syntax or unsupported method. </body> Connection closed by foreign host.

jsudhams gravatar imagejsudhams ( 2014-05-22 10:58:24 -0500 )edit

I'm also getting the expected output (per fgorbat). The service is also running. But still getting the 500 error. Has anybody managed to resolve this ?

screwgoth gravatar imagescrewgoth ( 2014-11-23 00:50:09 -0500 )edit
0

answered 2017-05-23 06:07:57 -0500

farooq gravatar image

Hi,

I recently encountered the same issue, later I found a spelling mistake under /etc/keystone/keystone.conf:

Connection URL before spelling correction: [database] connection = mysql+pymysql://keystone:keystone_dbadmin@controller/keyston

Connection URL post spelling correction: [database] connection = mysql+pymysql://keystone:keystone_dbadmin@controller/keystone

Post spelling correction performed db_sync and problem has resolved

Regards, Farooq

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2014-05-21 13:30:30 -0500

Seen: 30,093 times

Last updated: May 23 '17