Ask Your Question

cp: cannot stat '/opt/stack/keystone/etc/policy.json': No such file or directory When I install the devstack.

asked 2017-07-08 22:40:36 -0500

liaodalin19903 gravatar image

I follow the devstack installation steps:

When I execute this step:./ I get the below logs in the screen:


  mod_wsgi.x86_64 0:3.4-12.el7_0                                                

+functions-common:yum_install:1341         result=0
+functions-common:yum_install:1343         time_stop yum_install
+functions-common:time_stop:2347           local name
+functions-common:time_stop:2348           local end_time
+functions-common:time_stop:2349           local elpased_time
+functions-common:time_stop:2350           local total
+functions-common:time_stop:2351           local start_time
+functions-common:time_stop:2353           name=yum_install
+functions-common:time_stop:2354           start_time=1499598797
+functions-common:time_stop:2356           [[ -z 1499598797 ]]
++functions-common:time_stop:2359           date +%s
+functions-common:time_stop:2359           end_time=1499598800
+functions-common:time_stop:2360           elapsed_time=3
+functions-common:time_stop:2361           total=95
+functions-common:time_stop:2363           START_TIME[$name]=
+functions-common:time_stop:2364           TOTAL_TIME[$name]=98
+functions-common:yum_install:1352         '[' 0 == 2 ']'
+functions-common:yum_install:1356         return 0
+lib/apache:install_apache_wsgi:67         sudo a2enmod version
sudo: a2enmod: command not found
+lib/apache:install_apache_wsgi:67         true
+lib/keystone:install_keystone:557         is_ssl_enabled_service key
+lib/tls:is_ssl_enabled_service:377        local services=key
+lib/tls:is_ssl_enabled_service:378        local service=
+lib/tls:is_ssl_enabled_service:379        '[' False == False ']'
+lib/tls:is_ssl_enabled_service:380        return 1
+lib/stack:stack_install_service:33        [[ False = True ]]
+./                       configure_keystone
+lib/keystone:configure_keystone:190       sudo install -d -o stack /etc/keystone
+lib/keystone:configure_keystone:192       [[ /etc/keystone != \/\o\p\t\/\s\t\a\c\k\/\k\e\y\s\t\o\n\e\/\e\t\c ]]
+lib/keystone:configure_keystone:193       install -m 600 /opt/stack/keystone/etc/keystone.conf.sample /etc/keystone/keystone.conf
+lib/keystone:configure_keystone:194       cp -p /opt/stack/keystone/etc/policy.json /etc/keystone
cp: cannot stat '/opt/stack/keystone/etc/policy.json': No such file or directory
+lib/keystone:configure_keystone:1         exit_trap
+./                  local r=1
++./                  jobs -p
+./                  jobs=
+./                  [[ -n '' ]]
+./                  kill_spinner
+./               '[' '!' -z '' ']'
+./                  [[ 1 -ne 0 ]]
+./                  echo 'Error on exit'
Error on exit
+./                  generate-subunit 1499598343 457 fail
+./                  [[ -z /opt/stack/logs ]]
+./                  /home/devstack/tools/ -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2017-07-09-111320.txt for details
+./                  exit 1
[stack@localhost devstack]$ vim  /opt/stack/logs/worlddump-2017-07-09-111320.txt for details

You see there is the error here:

cp: cannot stat '/opt/stack/keystone/etc/policy.json':

And there I tested the below information:

[stack@localhost devstack]$ cd /opt/stack/keystone/etc/
[stack@localhost etc]$ ls
default_catalog.templates  keystone.conf.sample  keystone-paste.ini  logging.conf.sample  policy.v3cloudsample.json  sso_callback_template.html

There is a policy.v3cloudsample.json, no the policy.json.

So, how to do with that when I install the devstack?

My VM system is CentOS 7.2.

edit retag flag offensive close merge delete


I am using a fresh ubuntu 16.04 OS and getting the same error. Did you find any solution to it?

guptavaibhav gravatar imageguptavaibhav ( 2017-07-30 15:31:20 -0500 )edit

No, I setup openstack manually later.

liaodalin19903 gravatar imageliaodalin19903 ( 2017-08-01 06:27:47 -0500 )edit

how do you manually setup.. links please?

sunilkms123 gravatar imagesunilkms123 ( 2017-09-15 09:04:22 -0500 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2017-10-26 20:35:16 -0500

melwitt gravatar image

I just hit this trying to run devstack on the stable/newton branch and was able to work around the problem by changing in devstack:

$ git diff
diff --git a/lib/keystone b/lib/keystone
index 3110c3d..5ad69e2 100644
--- a/lib/keystone
+++ b/lib/keystone @@ -201,7 +201,7 @@ function configure_keystone {

     if [[ "$KEYSTONE_CONF_DIR" != "$KEYSTONE_DIR/etc" ]]; then
         install -m 600 $KEYSTONE_DIR/etc/keystone.conf.sample $KEYSTONE_CONF
-        cp -p $KEYSTONE_DIR/etc/policy.json $KEYSTONE_CONF_DIR
+        cp -p $KEYSTONE_DIR/etc/policy.v3cloudsample.json $KEYSTONE_CONF_DIR/policy.json
         if [[ -f "$KEYSTONE_DIR/etc/keystone-paste.ini" ]]; then
             cp -p "$KEYSTONE_DIR/etc/keystone-paste.ini" "$KEYSTONE_PASTE_INI"
edit flag offensive delete link more


just hit this too, thx for patch!

fxpester gravatar imagefxpester ( 2017-11-02 08:26:59 -0500 )edit

answered 2017-10-26 23:48:33 -0500

Starting with Pike, Keystone doesn't ship /etc/keystone/policy.json anymore. Perhaps earlier DevStacks stumbled over this problem, but by now, you should be able to install stable/Pike or master without this hickup.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2017-07-08 22:40:36 -0500

Seen: 3,011 times

Last updated: Oct 26 '17