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 ?
I'm installing openstack using All-In-One Single Machine setup, I run stack.sh script for devstack setup. On starting glance service I'm getting following error on my console:
++:: curl -g -k --noproxy '*' -s -o /dev/null -w '%{http_code}' http://10.10.20.10/image
+:: [[ 503 == 503 ]]
+:: sleep 1
+functions:wait_for_service:485 rval=124
+functions:wait_for_service:490 time_stop wait_for_service
+functions-common:time_stop:2310 local name
+functions-common:time_stop:2311 local end_time
+functions-common:time_stop:2312 local elapsed_time
+functions-common:time_stop:2313 local total
+functions-common:time_stop:2314 local start_time
+functions-common:time_stop:2316 name=wait_for_service
+functions-common:time_stop:2317 start_time=1602763779096
+functions-common:time_stop:2319 [[ -z 1602763779096 ]]
++functions-common:time_stop:2322 date +%s%3N
+functions-common:time_stop:2322 end_time=1602763839214
+functions-common:time_stop:2323 elapsed_time=60118
+functions-common:time_stop:2324 total=569
+functions-common:time_stop:2326 _TIME_START[$name]=
+functions-common:time_stop:2327 _TIME_TOTAL[$name]=60687
+functions:wait_for_service:491 return 124
+lib/glance:start_glance:480 die 480 'g-api did not start'
+functions-common:die:198 local exitcode=0
+functions-common:die:199 set +o xtrace
[Call Trace]
./stack.sh:1306:start_glance
/opt/stack/devstack/lib/glance:480:die
[ERROR] /opt/stack/devstack/lib/glance:480 g-api did not start
Error on exit
World dumping... see /opt/stack/logs/worlddump-2020-10-15-121040.txt for details
neutron-dhcp-agent: no process found
neutron-l3-agent: no process found
neutron-metadata-agent: no process found
neutron-openvswitch-agent: no process found
I also tried to increase timeout duration but then also it failed and also verifyied devstack#g-api.service is in active state. Can someone let me know what is the exect reason behind this issue and how to resolve it.
The only solution is to reload the entire system, including the os
I'm still trying to teach myself Travis / CI so apologies if the answer is obvious.
I'm trying to determine why my Travis build for a project I've inherited is failing for PHP 7.1 but not 7.2.
Here is the .travis.yml config:
sudo: false
language: php
# Cache some data across builds for performance.
cache:
apt: true
directories:
- node_modules
- vendor
- $HOME/.composer/cache
notifications:
email:
on_success: never
on_failure: change
branches:
only:
- master
matrix:
include:
- php: 7.2
env: WP_Version=nightly
- php: 7.1
env: WP_VERSION=latest WP_TRAVISCI=phpcs
before_script:
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- phpenv config-rm xdebug.ini
- |
if [[ ! -z "$WP_VERSION" ]] ; then
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
composer global require "phpunit/phpunit=5.7.*"
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
composer global require wp-coding-standards/wpcs
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
fi
- mysql --version
- phpenv versions
- php --version
script:
- |
if [[ ! -z "$WP_VERSION" ]] ; then
phpunit --version
phpunit
WP_MULTISITE=1 phpunit
fi
- |
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs --standard=phpcs.ruleset.xml $(find . -name '*.php')
fi
# If the plugin has any JavaScript or CSS that should be processed,
# add the below to their respective sections so that Grunt is installed
# and all default tasks are run.
#
# To the matrix:
#
# - php: 7.0
# env: WP_TRAVISCI=grunt
#
# To before_script:
#
# - npm --version
# - node --version
# - nvm install stable
# - npm install -g grunt-cli
# - npm install
# - npm prune
# - npm --version
# - node --version
#
# To script:
#
# - |
# if [[ "$WP_TRAVISCI" == "grunt" ]] ; then
# grunt --version
# grunt default
# fi
Here is the Travis log:
Setting environment variables from .travis.yml
$ export WP_VERSION=latest
$ export WP_TRAVISCI=phpcs
0.02s$ phpenv global 7.1 2>/dev/null
pearrc
Writing /home/travis/.pearrc
0.01s$ phpenv global 7.1
0.87s$ composer self-update
Updating to version 1.9.1 (stable channel).
Downloading (100%)
Use composer self-update --rollback to return to version 1.8.4
cache.1
Setting up build cache
$ php --version
PHP 7.1.27 (cli) (built: Mar 13 2019 07:54:47) ( ZTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.27, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans
$ composer --version
Composer version 1.9.1 2019-11-01 17:20:17
before_script.1
0.00s$ export PATH="$HOME/.composer/vendor/bin:$PATH"
before_script.2
0.02s$ phpenv config-rm xdebug.ini
before_script.3
14.36s$ if [[ ! -z "$WP_VERSION" ]] ; then
before_script.4
2.96s$ if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
before_script.5
0.02s$ mysql --version
before_script.6
0.05s$ phpenv versions
before_script.7
0.06s$ php --version
0.28s$ if [[ ! -z "$WP_VERSION" ]] ; then
phpunit --version
phpunit
WP_MULTISITE=1 phpunit
fi
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /tmp/wordpress/wp-includes/wp-db.php on line 1633
wp_die called
Message : <p><code>No such file or directory</code></p>
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can’t contact the database server at <code>localhost</code>. This could mean your host’s database server is down.</p>
<ul>
<li>Are you sure you have the correct username and password?</li>
<li>Are you sure you have typed the correct hostname?</li>
<li>Are you sure the database server is running?</li>
</ul>
<p>If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.</p>
Title :
PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /tmp/wordpress/wp-includes/wp-db.php on line 1633
wp_die called
Message : <p><code>No such file or directory</code></p>
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can’t contact the database server at <code>localhost</code>. This could mean your host’s database server is down.</p>
<ul>
<li>Are you sure you have the correct username and password?</li>
<li>Are you sure you have typed the correct hostname?</li>
<li>Are you sure the database server is running?</li>
</ul>
<p>If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.</p>
Title :
The command "if [[ ! -z "$WP_VERSION" ]] ; then
phpunit --version
phpunit
WP_MULTISITE=1 phpunit
fi
" exited with 1.
0.70s$ if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs --standard=phpcs.ruleset.xml $(find . -name '*.php')
fi
The command "if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
phpcs --standard=phpcs.ruleset.xml $(find . -name '*.php')
fi
" exited with 0.
cache.2
store build cache
Done. Your build exited with 1.
I can see the error message is related to the database, but I'm not sure where to look to debug it.
The PHP7.2 job passes.
My capifony deployment works great, however the capifony cleanup command fails.
I'm using private keys over ssh, with sudo to gain write permissions on the deployment directories.
With extended logging the result of cap deploy:cleanup is this:
$ cap deploy:cleanup
* 2013-07-19 15:44:42 executing `deploy:cleanup'
* executing "sudo -p 'sudo password: ' ls -1dt /var/www/html/releases/* | tail -n +4 | sudo -p 'sudo password: ' xargs rm -rf"
Modifying permissions so that the deployment user has full write access to this directory is not an option in this instance.
Has anyone seen/worked around this issue? (This is on a RHEL6 server)
Yep, there is a problem with the cleanup command while using sudo at the moment. Here was my solution to fixing this. Add this to your deploy.rb
namespace :customtasks do
task :customcleanup, :except => {:no_release => true} do
count = fetch(:keep_releases, 5).to_i
run "ls -1dt #{releases_path}/* | tail -n +#{count + 1} | #{try_sudo} xargs rm -rf"
end
end
Then call that instead as cleanup
after "deploy:update", "customtasks:customcleanup"
More info at https://github.com/capistrano/capistrano/issues/474
So I log into a Solaris box, try to start Apache, and find that there is already a process listening on port 80, and it's not Apache. Our boxes don't have lsof installed, so I can't query with that. I guess I could do:
pfiles `ls /proc` | less
and look for "port: 80", but if anyone has a better solution, I'm all ears! Even better if I can look for the listening process without being root. I'm open to both shell and C solutions; I wouldn't mind having a little custom executable to carry with me for the next time this comes up.
Updated: I'm talking about generic installs of solaris for which I am not the administrator (although I do have superuser access), so installing things from the freeware disk isn't an option. Obviously neither are using Linux-specific extensions to fuser, netstat, or other tools. So far running pfiles on all processes seems to be the best solution, unfortunately. If that remains the case, I'll probably post an answer with some slightly more efficient code that the clip above.
I found this script somewhere. I don't remember where, but it works for me:
#!/bin/ksh
line='---------------------------------------------'
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')
if [ $# -eq 0 ]; then
read ans?"Enter port you would like to know pid for: "
else
ans=$1
fi
for f in $pids
do
/usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
if [ $? -eq 0 ]; then
echo $line
echo "Port: $ans is being used by PID:\c"
/usr/bin/ps -ef -o pid -o args | egrep -v "grep|pfiles" | grep $f
fi
done
exit 0
Edit: Here is the original source:
[Solaris] Which process is bound to a given port ?
Here's a one-liner:
ps -ef| awk '{print $2}'| xargs -I '{}' sh -c 'echo examining process {}; pfiles {}| grep 80'
'echo examining process PID' will be printed before each search, so once you see an output referencing port 80, you'll know which process is holding the handle.
Alternatively use:
ps -ef| grep $USER|awk '{print $2}'| xargs -I '{}' sh -c 'echo examining process {}; pfiles {}| grep 80'
Since 'pfiles' might not like that you're trying to access other user's processes, unless you're root of course.
Mavroprovato's answer reports more than only the listening ports. Listening ports are sockets without a peer. The following Perl program reports only the listening ports. It works for me on SunOS 5.10.
#! /usr/bin/env perl
##
## Search the processes which are listening on the given port.
##
## For SunOS 5.10.
##
use strict;
use warnings;
die "Port missing" unless $#ARGV >= 0;
my $port = int($ARGV[0]);
die "Invalid port" unless $port > 0;
my #pids;
map { push #pids, $_ if $_ > 0; } map { int($_) } `ls /proc`;
foreach my $pid (#pids) {
open (PF, "pfiles $pid 2>/dev/null |")
|| warn "Can not read pfiles $pid";
$_ = <PF>;
my $fd;
my $type;
my $sockname;
my $peername;
my $report = sub {
if (defined $fd) {
if (defined $sockname && ! defined $peername) {
print "$pid $type $sockname\n"; } } };
while (<PF>) {
if (/^\s*(\d+):.*$/) {
&$report();
$fd = int ($1);
undef $type;
undef $sockname;
undef $peername; }
elsif (/(SOCK_DGRAM|SOCK_STREAM)/) { $type = $1; }
elsif (/sockname: AF_INET[6]? (.*) port: $port/) {
$sockname = $1; }
elsif (/peername: AF_INET/) { $peername = 1; } }
&$report();
close (PF); }
#!/usr/bin/bash
# This is a little script based on the "pfiles" solution that prints the PID and PORT.
pfiles `ls /proc` 2>/dev/null | awk "/^[^ \\t]/{smatch=\$0;next}/port:[ \\t]*${1}/{print smatch, \$0}{next}"
From Solaris 11.2 onwards you can indeed do this with the netstat command. Have a look here. The -u switch is what you are looking for.
If you are on a lower version of Solaris then - as others have pointed out - the Solaris way of doing this is some kind of script wrapper around pfiles command. Beware though that pfiles command halts the process for a split second in order to inspect it. For 99.9% of processes this is unimportant. Unfortunately we have a process that will give a core dump if it is hit with a pfiles command so we are a bit cautious about using the command. Your situation may be totally different if you are in the 99.9%, meaning you can safely use the pfiles command.
netstat on Solaris will not tell you this, nor will older versions of lsof, but if you download and build/install a newer version of lsof, this can tell you that.
$ lsof -v
lsof version information:
revision: 4.85
latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/
latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ
latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man
configuration info: 64 bit kernel
constructed: Fri Mar 7 10:32:54 GMT 2014
constructed by and on: user#hostname
compiler: gcc
compiler version: 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
8<- - - - ***SNIP*** - - -
With this you can use the -i option:
$ lsof -i:22
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 521 root 3u IPv6 0xffffffff89c67580 0t0 TCP *:ssh (LISTEN)
sshd 5090 root 3u IPv6 0xffffffffa8668580 0t322598 TCP host.domain.com:ssh->21.43.65.87:52364 (ESTABLISHED)
sshd 5091 johngh 4u IPv6 0xffffffffa8668580 0t322598 TCP host.domain.com:ssh->21.43.65.87:52364 (ESTABLISHED)
Which shows you exactly what you're asking for.
I had a problem yesterday with a crashed Jetty (Java) process, which only left 2 files in its /proc/[PID] directory (psinfo & usage).
pfiles failed to find the process (because the date it needed was not there)
lsof found it for me.
You might not want to, but your best bet is to grab the sunfreeware CD and install lsof.
Other than that, yes you can grovel around in /proc with a shell script.
I think the first answer is the best
I wrote my own shell script developing this idea :
#!/bin/sh
if [ $# -ne 1 ]
then
echo "Sintaxis:\n\t"
echo " $0 {port to search in process }"
exit
else
MYPORT=$1
for i in `ls /proc`
do
pfiles $i | grep port | grep "port: $MYPORT" > /dev/null
if [ $? -eq 0 ]
then
echo " Port $MYPORT founded in $i proccess !!!\n\n"
echo "Details\n\t"
pfiles $i | grep port | grep "port: $MYPORT"
echo "\n\t"
echo "Process detail: \n\t"
ps -ef | grep $i | grep -v grep
fi
done
fi
Most probly sun's administrative server..
It's usually bundled along with sun's directory and a few other webmin-ish stuff that is in the default installation
This is sort of an indirect approach, but you could see if a website loads on your web browser of choice from whatever is running on port 80. Or you could telnet to port 80 and see if you get a response that gives you a clue as to what is running on that port and you can go shut it down. Since port 80 is the default port for http traffic chances are there is some sort of http server running there by default, but there's no guarantee.
If you have access to netstat, that can do precisely that.