Devstack installation error sudo systemctl start devstack#sl-api.service - openstack

These are the devstack logs appears on the screen
++functions-common:write_uwsgi_user_unit_file:1480 iniset -sudo /etc/systemd/system/devstack#sl-api.service Install WantedBy multi-user.target
++functions-common:write_uwsgi_user_unit_file:1483 sudo systemctl daemon-reload
++functions-common:_run_under_systemd:1530 sudo systemctl enable devstack#sl-api.service
Created symlink /etc/systemd/system/multi-user.target.wants/devstack#sl-api.service → /etc/systemd/system/devstack#sl-api.service.enter code here
++functions-common:_run_under_systemd:1531 sudo systemctl start devstack#sl-api.service
Job for devstack#sl-api.service failed because the control process exited with error code.
See "systemctl status devstack#sl-api.service" and "journalctl -xe" for details.
+functions-common:_run_under_systemd:1 exit_trap
+./stack.sh:exit_trap:489 local r=1
++./stack.sh:exit_trap:490 jobs -p
+./stack.sh:exit_trap:490 jobs=
+./stack.sh:exit_trap:493 [[ -n '' ]]
+./stack.sh:exit_trap:499 '[' -f /tmp/tmp.g8xjCU2yg2 ']'
+./stack.sh:exit_trap:500 rm /tmp/tmp.g8xjCU2yg2
+./stack.sh:exit_trap:504 kill_spinner
+./stack.sh:kill_spinner:399 '[' '!' -z '' ']'
+./stack.sh:exit_trap:506 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:507 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:509 type -p generate-subunit
+./stack.sh:exit_trap:510 generate-subunit 1593717952 1120 fail
+./stack.sh:exit_trap:512 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:515 /usr/bin/python3.6 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
nova-compute: no process found
neutron-dhcp-agent: no process found
neutron-l3-agent: no process found
neutron-metadata-agent: no process found
neutron-openvswitch-agent: no process found
+./stack.sh:exit_trap:524 exit 1
stack#opstack:~/devstack$
cd /etc/systemd/system/
vi systemctl start devstack#sl-api.service
ExecStart = /usr/local/bin/uwsgi --procname-prefix senlin-api --ini /etc/senlin/senlin-api-uwsgi.ini
file not exist
/usr/local/bin/uwsgi

cd /usr/bin
ls | grep uwsgi
if file is here then use if you don't have it here then you can reinstall using apt-get install uwsgi or pip install uwsgi
cd /usr/local/bin
ln -s /usr/bin/uwsgi uwsgi
./unstack.sh
./stach.sh
here we go.....

Related

Unable to deploy DevStack on Ubuntu 22.04

I'm trying to deploy OpenStack using DevStack on Ubuntu 22.04, I'am facing issues on running stack.sh.
I'm not sure if it's related to the git repo code or related to the system configuration or som missing packages, please advise.
Here below the error log:
fatal: your current branch 'master' does not have any commits yet
+functions-common:git_clone:680 cd /opt/stack/devstack
+lib/neutron-legacy:install_mutnauq:469 setup_develop /opt/stack/neutron
+inc/python:setup_develop:334 local bindep
+inc/python:setup_develop:335 [[ /opt/stack/neutron == -bindep* ]]
+inc/python:setup_develop:339 local project_dir=/opt/stack/neutron
+inc/python:setup_develop:340 local extras=
+inc/python:setup_develop:341 _setup_package_with_constraints_edit /opt/stack/neutron -e
+inc/python:_setup_package_with_constraints_edit:360 local bindep
+inc/python:_setup_package_with_constraints_edit:361 [[ /opt/stack/neutron == -bindep* ]]
+inc/python:_setup_package_with_constraints_edit:365 local project_dir=/opt/stack/neutron
+inc/python:_setup_package_with_constraints_edit:366 local flags=-e
+inc/python:_setup_package_with_constraints_edit:367 local extras=
++inc/python:_setup_package_with_constraints_edit:374 cd /opt/stack/neutron
++inc/python:_setup_package_with_constraints_edit:374 pwd
+inc/python:_setup_package_with_constraints_edit:374 project_dir=/opt/stack/neutron
+inc/python:_setup_package_with_constraints_edit:376 '[' -n /opt/stack/requirements ']'
+inc/python:_setup_package_with_constraints_edit:380 local name
++inc/python:_setup_package_with_constraints_edit:381 awk '/^name.*=/ {print $3}' /opt/stack/neutron/setup.cfg
awk: fatal: cannot open file `/opt/stack/neutron/setup.cfg' for reading: No such file or directory
+inc/python:_setup_package_with_constraints_edit:381 name=
+inc/python:_setup_package_with_constraints_edit:1 exit_trap
+./stack.sh:exit_trap:516 local r=2
++./stack.sh:exit_trap:517 jobs -p
+./stack.sh:exit_trap:517 jobs=
+./stack.sh:exit_trap:520 [[ -n '' ]]
+./stack.sh:exit_trap:526 '[' -f '' ']'
+./stack.sh:exit_trap:531 kill_spinner
+./stack.sh:kill_spinner:426 '[' '!' -z '' ']'
+./stack.sh:exit_trap:533 [[ 2 -ne 0 ]]
+./stack.sh:exit_trap:534 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:536 type -p generate-subunit
+./stack.sh:exit_trap:537 generate-subunit 1656624514 146 fail
+./stack.sh:exit_trap:539 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:542 /usr/bin/python3.10 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
/opt/stack/devstack/tools/worlddump.py:22: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils import spawn
Any clue ?

Devstack installation failed with error message "XXX: no process found"

I'm trying to install Devstack on VMware cloud. After starting to run ./stack.sh, installation is failed with following error message.
+lib/cinder:create_volume_types:531 openstack --os-region-name=RegionOne volume type create --property volume_backend_name=lvmdriver-1 lvmdriver-1
Internal Server Error (HTTP 500)
+lib/cinder:create_volume_types:1 exit_trap
+./stack.sh:exit_trap:489 local r=1
++./stack.sh:exit_trap:490 jobs -p
+./stack.sh:exit_trap:490 jobs=
+./stack.sh:exit_trap:493 [[ -n '' ]]
+./stack.sh:exit_trap:499 '[' -f /tmp/tmp.Y95KBJPvp8 ']'
+./stack.sh:exit_trap:500 rm /tmp/tmp.Y95KBJPvp8
+./stack.sh:exit_trap:504 kill_spinner
+./stack.sh:kill_spinner:399 '[' '!' -z '' ']'
+./stack.sh:exit_trap:506 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:507 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:509 type -p generate-subunit
+./stack.sh:exit_trap:510 generate-subunit 1588897469 720 fail
+./stack.sh:exit_trap:512 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:515 /usr/bin/python3.6 /opt/devstack/tools/worlddump.py -d /opt/stack/logs
World dumping... see /opt/stack/logs/worlddump-2020-05-08-003630.txt for details
nova-compute: no process found
neutron-dhcp-agent: no process found
neutron-l3-agent: no process found
neutron-metadata-agent: no process found
neutron-openvswitch-agent: no process found
+./stack.sh:exit_trap:524 exit 1
It looks like HTTP 500 error is the primary issue. But ping to HOST_IP works very well so I can't figure out the cause.
[[local|localrc]]
# Credentials
ADMIN_PASSWORD=devstack
MYSQL_PASSWORD=devstack
RABBIT_PASSWORD=devstack
SERVICE_PASSWORD=devstack
SERVICE_TOKEN=token
# Network Address
HOST_IP=(...)
This is devstack's log file.
nova-compute Guru Meditation Report
===================================
19171
killall -e -USR2 nova-compute
-----------------------------
*** Failed to run 'killall -e -USR2 nova-compute': Command 'killall -e -USR2 nova-compute' returned non-zero exit status 1.
guru meditation report in nova-compute log
neutron-dhcp-agent Guru Meditation Report
=========================================
7758
killall -e -USR2 neutron-dhcp-agent
-----------------------------------
*** Failed to run 'killall -e -USR2 neutron-dhcp-agent': Command 'killall -e -USR2 neutron-dhcp-agent' returned non-zero exit status 1.
guru meditation report in neutron-dhcp-agent log
neutron-l3-agent Guru Meditation Report
=======================================
8482
killall -e -USR2 neutron-l3-agent
---------------------------------
*** Failed to run 'killall -e -USR2 neutron-l3-agent': Command 'killall -e -USR2 neutron-l3-agent' returned non-zero exit status 1.
guru meditation report in neutron-l3-agent log
neutron-linuxbridge-agent Guru Meditation Report
================================================
Skipping as neutron-linuxbridge-agent does not appear to be running
neutron-metadata-agent Guru Meditation Report
=============================================
9103
9719
9720
killall -e -USR2 neutron-metadata-agent
---------------------------------------
*** Failed to run 'killall -e -USR2 neutron-metadata-agent': Command 'killall -e -USR2 neutron-metadata-agent' returned non-zero exit status 1.
guru meditation report in neutron-metadata-agent log
neutron-openvswitch-agent Guru Meditation Report
================================================
7127
killall -e -USR2 neutron-openvswitch-agent
------------------------------------------
*** Failed to run 'killall -e -USR2 neutron-openvswitch-agent': Command 'killall -e -USR2 neutron-openvswitch-agent' returned non-zero exit status 1.
guru meditation report in neutron-openvswitch-agent log
cinder-volume Guru Meditation Report
====================================
21971
killall -e -USR2 cinder-volume
------------------------------
guru meditation report in cinder-volume log
What is the problem?
I get this log
'''
sudo systemctl enable devstack#sl-api.service
Created symlink /etc/systemd/system/multi-user.target.wants/devstack#sl-api.service → /etc/systemd/system/devstack#sl-api.service.
++functions-common:_run_under_systemd:1531 sudo systemctl start devstack#sl-api.service
Job for devstack#sl-api.service failed because the control process exited with error code.
See "systemctl status devstack#sl-api.service" and "journalctl -xe" for details.
+functions-common:_run_under_systemd:1 exit_trap
+./stack.sh:exit_trap:489 local r=1
++./stack.sh:exit_trap:490 jobs -p
+./stack.sh:exit_trap:490 jobs=
+./stack.sh:exit_trap:493 [[ -n '' ]]
+./stack.sh:exit_trap:499 '[' -f /tmp/tmp.g8xjCU2yg2 ']'
+./stack.sh:exit_trap:500 rm /tmp/tmp.g8xjCU2yg2
+./stack.sh:exit_trap:504 kill_spinner
+./stack.sh:kill_spinner:399 '[' '!' -z '' ']'
+./stack.sh:exit_trap:506 [[ 1 -ne 0 ]]
+./stack.sh:exit_trap:507 echo 'Error on exit'
Error on exit
+./stack.sh:exit_trap:509 type -p generate-subunit
+./stack.sh:exit_trap:510 generate-subunit 1593717952 1120 fail
+./stack.sh:exit_trap:512 [[ -z /opt/stack/logs ]]
+./stack.sh:exit_trap:515 /usr/bin/python3.6 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs
nova-compute: no process found
neutron-dhcp-agent: no process found
neutron-l3-agent: no process found
neutron-metadata-agent: no process found
neutron-openvswitch-agent: no process found
+./stack.sh:exit_trap:524 exit 1
'''
and i resolve this by suing
cd /usr/bin ls | grep uwsgi if file is here then use if you don't have it here then you can reinstall using apt-get install uwsgi or pip install uwsgi cd /usr/local/bin ln -s /usr/bin/uwsgi uwsgi
./unstack.sh ./stach.sh here we go.....
I got it to work. just do:
pip install uwsgi
in the stack user.
The same error code will reflect. But do not worry, it works. Just go to the
http:IPaddress/dashboard
And you will see the openstack horizon dashboard. :)

WordPress Docker Proxy Error 502 : The proxy server received an invalid response from an upstream server

Working on WordPress, We put a project on docker.
I had a 502 proxy error. I was able to fix it restarting docker. However, the problem is still here on coworkers installation.
I try to fix it. However, I can not recreate the bug, so I have no log for this error.
Here is the dockerfile:
FROM debian:8
MAINTAINER xxxxxxxxxxxxx
LABEL version="1.0"
LABEL description="Debian 8 / Apache 2 / PHP 5"
ARG DEBIAN_FRONTEND=noninteractive
ENV DOCKER_CONTAINER_APP=/var/www
RUN apt-get -y update && apt-get install -y \
apache2 \
php5 \
libapache2-mod-php5 \
mysql-server \
php5-mysql \
supervisor \
phpmyadmin
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
RUN /usr/sbin/mysqld & \
sleep 10s &&\
echo "GRANT ALL ON *.* TO admin#'%' IDENTIFIED BY 'heliopsis' WITH GRANT OPTION; FLUSH PRIVILEGES" | mysql
EXPOSE 3306
CMD ["/usr/bin/mysqld_safe"]
COPY ressources/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ressources/my.cnf /etc/mysql/my.cnf
COPY ressources/init.sql /tmp/init.sql
RUN /etc/init.d/mysql start && mysql -uroot < /tmp/init.sql && /etc/init.d/mysql stop
COPY sql-dumps /tmp/sql-dumps
RUN /etc/init.d/mysql start && gunzip < /tmp/sql-dumps/dump.sql.gz | mysql -uroot -D nalian-local && /etc/init.d/mysql stop
RUN /etc/init.d/mysql start && mysql -uroot -e "SET PASSWORD = PASSWORD('heliopsis');" && /etc/init.d/mysql stop
# Dev env : show errors
RUN sed -i -e 's/^error_reporting\s*=.*/error_reporting = E_ALL/' /etc/php5/apache2/php.ini
RUN sed -i -e 's/^display_errors\s*=.*/display_errors = On/' /etc/php5/apache2/php.ini
RUN a2enmod rewrite
RUN mkdir /etc/apache2/ssl
COPY ressources/vhost /etc/apache2/sites-available/000-default.conf
RUN a2ensite 000-default
# add our local files in docker instance
ADD . $DOCKER_CONTAINER_APP
# add the docker instance as a volume
VOLUME $DOCKER_CONTAINER_APP
# define the workspace of the container
WORKDIR $DOCKER_CONTAINER_APP
# launching apache # startup
CMD cd wp-content; tar xzf $DOCKER_CONTAINER_APP/ressources/uploads.tar.gz; cd ..; ln -s wp-config-dev.php wp-config.php; ln -s htaccess_dev .htaccess;/usr/bin/supervisord
The install-vhost.sh :
#!/usr/bin/env bash
if [ -z "$1" ]
then
echo "dev name required"
exit
fi
if [ -z "$2" ]
then
echo "HTTP port required"
exit
fi
VHOST_TEMPLATE=`find . -name "*.DEV.rocks.conf"`
VHOST=`echo $VHOST_TEMPLATE | sed 's/.*\///' | sed "s/DEV/$1/"`
sudo cat $VHOST_TEMPLATE | replace "DEV" "$1" | replace "PORT" "$2" > /etc/apache2/sites-available/$VHOST
sudo a2ensite $VHOST
sudo service apache2 restart
And the vhost :
############## www.nalian.coralie.rocks
<VirtualHost *:80>
ServerName www.nalian.coralie.rocks
<Proxy *>
Allow from localhost
</Proxy>
ProxyPass / http://localhost:1250/
ProxyPassReverse / http://localhost:1250/
ProxyPreserveHost On
</VirtualHost>
Do you have any idea to help me?

Get pid of application started by mvn exec plugin

I want to write .sh script that will kill process started by maven exec plugin. At the moment i'm trying to get PID by start time, but this approach do not guarantee that there is no some collision with other processes.
Please, could someone say whether there is an approach to get PID or to kill process started by mvn exec .
Thanks.
The best approach is to start the maven process using start-stop-daemon. I use a modified bash script from a tomcat init.d to start/stop java or maven programs as daemons. Here is a snippet. Please customize as needed:
#!/bin/sh
case "$1" in
start)
log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start -b -u "$MAVEN_USER" -g "$MAVEN_GROUP" \
-c "$MAVEN_USER" -d "$MAVEN_HOME" -p "$MAVEN_PID" -m \
-x mvn -- exec:java -Dexec.mainClass="com.company.Application" -Dexec.classpathScope=runtime -Dexec.args="/home/user 192.168.1.1" 2>&1
status="$?"
set +a -e
else
log_progress_msg "(already running)"
log_end_msg 0
fi
;;
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
set +e
if [ -f "$MAVEN_PID" ]; then
start-stop-daemon --stop --pidfile "$MAVEN_PID" \
--user "$MAVEN_USER" \
--retry=TERM/20/KILL/5 >/dev/null
if [ $? -eq 1 ]; then
log_progress_msg "$DESC is not running but pid file exists, cleaning up"
elif [ $? -eq 3 ]; then
PID="`cat $MAVEN_PID`"
log_failure_msg "Failed to stop $NAME (pid $PID)"
exit 1
fi
rm -f "$MAVEN_PID"
rm -rf "$JVM_TMP"
else
log_progress_msg "(not running)"
fi
log_end_msg 0
set -e
;;

Quick RSYNC code correction

What's wrong with this code?
sudo -u replicant rsync -av -e "ssh -o 'StrictHostKeyChecking no' -i /home/replicant/.ssh/id_rsa" --exclude 'media/' --exclude 'var/' --exclude '.svn' root#$ADMIN:/var/www/ /var/www/ &> /tmp/rsync if [ $? -ne 0 ]; then
echo "date: Error rsync'ing code base from $ADMIN check /tmp/rsync" | mail -s "Rsync error!" $DEVEMAIL
echo "date: Error rsync'ing code base from $ADMIN check /tmp/rsync" >> $LOGFILE
echo "root#$ADMIN:/var/www /var/www" >> $LOGFILE
exit
fi
I keep getting this error:
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(605)
[Receiver=3.0.9]
Please help. Thanks.
Try to login directly on SSH to fix your issues, then move on to your rsync test. So start with:
ssh -o 'StrictHostKeyChecking no' -i /home/replicant/.ssh/id_rsa root#$ADMIN
Sidenotes:
don't use root for such a task
add set -eu at the start of your Bash script, so that errors will end up your script and ease debugging (for example if $ADMIN is not defined, the script will end in error)

Resources