Unable to init microstack

1.3k Views Asked by At

I'm trying to install openstack on ubuntu 20.04 server but init fails. Can someone please explain why this error and any suggestions?

2022-04-29 12:08:28,706 - microstack_init - INFO - Setting up as a control node.
2022-04-29 12:08:40,467 - microstack_init - INFO - Generating TLS Certificate and Key
2022-04-29 12:08:44,707 - microstack_init - INFO - Configuring networking ...
2022-04-29 12:09:01,841 - microstack_init - INFO - Opening horizon dashboard up to *
2022-04-29 12:09:04,997 - microstack_init - INFO - Waiting for RabbitMQ to start ...
Waiting for 192.168.219.131:5672
2022-04-29 12:09:06,279 - microstack_init - INFO - RabbitMQ started!
2022-04-29 12:09:06,280 - microstack_init - INFO - Configuring RabbitMQ ...
2022-04-29 12:09:09,530 - microstack_init - INFO - RabbitMQ Configured!
2022-04-29 12:09:09,606 - microstack_init - INFO - Waiting for MySQL server to start ...
Waiting for 192.168.219.131:3306
2022-04-29 12:09:10,857 - microstack_init - INFO - Mysql server started! Creating databases ...
2022-04-29 12:09:13,539 - microstack_init - INFO - Configuring Keystone Fernet Keys ...
Traceback (most recent call last):
  File "/snap/microstack/245/bin/microstack", line 11, in <module>
    load_entry_point('microstack==0.0.1', 'console_scripts', 'microstack')()
  File "/snap/microstack/245/lib/python3.8/site-packages/microstack/main.py", line 44, in main
    cmd()
  File "/snap/microstack/245/lib/python3.8/site-packages/init/main.py", line 60, in wrapper
    return func(*args, **kwargs)
  File "/snap/microstack/245/lib/python3.8/site-packages/init/main.py", line 228, in init
    question.ask()
  File "/snap/microstack/245/lib/python3.8/site-packages/init/questions/question.py", line 210, in ask
    self.yes(awr)
  File "/snap/microstack/245/lib/python3.8/site-packages/init/questions/__init__.py", line 482, in yes
    check('snap-openstack', 'launch', 'keystone-manage', 'db_sync')
  File "/snap/microstack/245/lib/python3.8/site-packages/init/shell.py", line 69, in check
    raise subprocess.CalledProcessError(proc.returncode, " ".join(args))
subprocess.CalledProcessError: Command 'snap-openstack launch keystone-manage db_sync' returned non-zero exit status 1.```
2

There are 2 best solutions below

1
On

mostly the problem is the required port is used by another process(in use).

#check if the port is in use:

sudo lsof -i:[port]
0
On

I didn't had lxd installed and solved by running:

sudo snap install lxd && sudo lxd init

After that, just run the following command again and you're done:

sudo microstack init