Why does Capistrano 3 not filter when using "on roles(:web)"? - capistrano3

I'm not sure if this is just a misunderstanding on Capistrano and Rake on my part, but I'm going through the Capistrano 3 set up pages (www.capistranorb.com) and a few of the steps mention how to write up the servers and how to run the basic task of :check_write_permissions.
My problem is when I try to run the example code on my servers using the following server setup, I get unexpected results.
I have my config/deploy/production.rb file set up as such:
server '10.1.28.90', roles: [:web, :app]
server '10.1.246.239', roles: [:db]
I then created the :check_write_permissions task in lib/capistrano/tasks/access_check.rake. I made one small modification to the "on roles(:all)" so it would instead be "on roles(:web)".
desc "Check that we can access everything"
task :check_write_permissions do
on roles(:web) do |host|
if test("[ -w #{fetch(:deploy_to)} ]")
info "#{fetch(:deploy_to)} is writable on #{host}"
else
error "#{fetch(:deploy_to)} is not writable on #{host}"
end
end
end
When I run the task:
cap production check_write_permissions
OR
bundle exec cap production check_write_permissions
... I am expecting that it will only run the :check_write_permissions code against the servers with a :web role. Instead, my output show that the :db server is also run against with the :check_write_permissions task. This throws exceptions because I do not have a deploy directory on the database server.
DEBUG[90f77252] Running /usr/local/rvm/bin/rvm version on 10.1.246.239
DEBUG[90f77252] Command: /usr/local/rvm/bin/rvm version
DEBUG[fa4e93ec] Running /usr/local/rvm/bin/rvm version on 10.1.28.90
DEBUG[fa4e93ec] Command: /usr/local/rvm/bin/rvm version
DEBUG[90f77252] bash: /usr/local/rvm/bin/rvm: No such file or directory
DEBUG[fa4e93ec] rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
DEBUG[fa4e93ec] Finished in 1.060 seconds with exit status 0 (successful).
rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
DEBUG[3583646b] Running /usr/local/rvm/bin/rvm current on 10.1.28.90
DEBUG[3583646b] Command: /usr/local/rvm/bin/rvm current
DEBUG[3583646b] ruby-2.0.0-p481
DEBUG[3583646b] Finished in 0.286 seconds with exit status 0 (successful).
ruby-2.0.0-p481
DEBUG[b91aa735] Running /usr/local/rvm/bin/rvm 2.0.0-p481 do ruby --version on 10.1.28.90
DEBUG[b91aa735] Command: /usr/local/rvm/bin/rvm 2.0.0-p481 do ruby --version
DEBUG[b91aa735] ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-linux]
DEBUG[b91aa735] Finished in 0.400 seconds with exit status 0 (successful).
ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-linux]
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 10.1.246.239: rvm exit status: 127
rvm stdout: Nothing written
rvm stderr: bash: /usr/local/rvm/bin/rvm: No such file or directory
When I run the task with a ROLE filter in the command I execute, such as:
ROLES=web cap production check_write_permissions
This works as expected. I see only the web server get the task run against it.
DEBUG[7974b8ee] Running /usr/local/rvm/bin/rvm version on 10.1.28.90
DEBUG[7974b8ee] Command: /usr/local/rvm/bin/rvm version
DEBUG[7974b8ee] rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
DEBUG[7974b8ee] Finished in 1.062 seconds with exit status 0 (successful).
rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]
DEBUG[23f666d8] Running /usr/local/rvm/bin/rvm current on 10.1.28.90
DEBUG[23f666d8] Command: /usr/local/rvm/bin/rvm current
DEBUG[23f666d8] ruby-2.0.0-p481
DEBUG[23f666d8] Finished in 0.297 seconds with exit status 0 (successful).
ruby-2.0.0-p481
DEBUG[7ae64240] Running /usr/local/rvm/bin/rvm 2.0.0-p481 do ruby --version on 10.1.28.90
DEBUG[7ae64240] Command: /usr/local/rvm/bin/rvm 2.0.0-p481 do ruby --version
DEBUG[7ae64240] ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-linux]
DEBUG[7ae64240] Finished in 0.387 seconds with exit status 0 (successful).
ruby 2.0.0p481 (2014-05-08 revision 45883) [x86_64-linux]
DEBUG[c0ebccc0] Running /usr/bin/env [ -w /data/union_benefits/ ] on 10.1.28.90
DEBUG[c0ebccc0] Command: [ -w /data/union_benefits/ ]
DEBUG[c0ebccc0] Finished in 0.126 seconds with exit status 1 (failed).
ERROR/data/union_benefits/ is not writable on 10.1.28.90
What is the reason behind this? I have dug through the Capistrano 3.2.1 code a bit and I cannot figure this out. Maybe this is just a misunderstanding on my part of how the roles(...) work, but I can't figure it out.

Related

setup janus in ubuntu 18.04 lts issue in installing libnice

i am following this tutorial to setup janus on my machine
on step 2
install_libnice.sh
#!/bin/bash
# install_libnice.sh
git clone https://gitlab.freedesktop.org/libnice/libnice.git
cd libnice
./autogen.sh
./configure --prefix=/usr
make && sudo make install
and executing this command
bash install_libnice.sh
gives
Cloning into 'libnice'...
warning: redirecting to https://gitlab.freedesktop.org/libnice/libnice.git/
remote: Enumerating objects: 15336, done.
remote: Counting objects: 100% (15336/15336), done.
remote: Compressing objects: 100% (4011/4011), done.
remote: Total 15336 (delta 11795), reused 14714 (delta 11278), pack-reused 0
Receiving objects: 100% (15336/15336), 2.77 MiB | 429.00 KiB/s, done.
Resolving deltas: 100% (11795/11795), done.
install_libnice.sh: line 6: ./autogen.sh: No such file or directory
install_libnice.sh: line 7: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
how can i resolve this issue in ubuntu ?
Check: https://gitlab.freedesktop.org/libnice/libnice
libnice use now meson builder

Issues starting SolrJ v 8.5.0 on Mac High Sierra (10.13.6)

I am trying to run the solr server (latest version 8.5.0) on Mac High Sierra (10.13.6) and using the following getting started guide -https://lucene.apache.org/solr/guide/8_5/solr-tutorial.html
However, when I run the command
solr-8.5.0:$ ./bin/solr start -e cloud
Instead of the expected solr startup message, i get a following error message on colsole
ERROR: Failed to start Solr using command: <path-to-bin>start -cloud -p 8983 -s <path-to-bin> Exception : org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
Would greatly appreciate any feedback on this.

Ubuntu mssql server Corruption detected in persistent registry: \SystemRoot\security.hiv

I started having this issue today on our production sql server. I have tried a variety of different fixes proposed online. We are using MSSQL server 2017 (14.0.3257.3-13). I'm out of ideas on what could be causing the server to crash. Below is the recent crash log.
This program has encountered a fatal error and cannot continue running at Sat Feb 1 14:21:21 2020
The following diagnostic information is available:
Reason: 0x00000007
Status: 0xc000014c
Message: Corruption detected in persistent registry: \SystemRoot\security.hiv.
Stack Trace:
000000006b137250
000000006b1345bf
000000006b1347a3
000000006b1337d3
000000006b1326f2
000000006b175c31
Process: 8815 - sqlservr
Thread: 8819 (application thread 0x4)
Instance Id: e5a2f812-0426-4d92-b9b2-1db1e60d957c
Crash Id: 60073e70-4042-4275-9fcd-a05ae84d26f5
Build stamp: 9726a6583fe7826f57b03fd1c7adf12bebe7692cb64630fccb0541c06820af4d
Distribution: Ubuntu 16.04.6 LTS
Processors: 9
Total Memory: 8589934592 bytes
Timestamp: Sat Feb 1 14:21:21 2020
Last errno: 2
Last errno text: No such file or directory
Thank you for the ideas, Toret.
I have faced the same issue, but I solved it just by deleting the security.hiv file.
rm /var/opt/mssql/.system/system/security.hiv
After that the mssql-server service started normaly.
After working through multiple proposed solutions online nothing worked. Some of the things I tried:
Upgrading mssql-server to latest version.
Repairing missing files or dependencies.
Changing access permissions to the directory.
Elevating access permissions for the mssql user.
Changing user access to root for the .hiv files located in the mssql .system/system folder
The only way to for me to get it to work was to:
Delete all the folders manually from /var/opt/mssql/ except for the
data folder.
Re-link python from 3.5 to 2.7
Then I downgraded the mssql-server version to Microsoft SQL Server 2017 14.0.3192.2.
Run the sudo /opt/mssql/bin/mssql-conf setup
**Python Re-link**
sudo rm /user/bin/python
sudo ln -s /user/bin/python[version] /user/bin/python
After that everything worked again.

wrong import after updating go appengine

I have updated goappengine to the last version and I have this error message. It looks like that it is looking for Go 1.4.2 and I am running 1.5.2 ?? It unlikely that I was running 1.4 before.
Any pointers of the problem
➜ dev git:(master) ✗ goapp serve
INFO 2016-01-25 02:31:53,808 devappserver2.py:769] Skipping SDK update check.
INFO 2016-01-25 02:31:53,832 api_server.py:205] Starting API server at: http://localhost:65025
INFO 2016-01-25 02:31:53,836 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO 2016-01-25 02:31:53,839 admin_server.py:116] Starting admin server at: http://localhost:8000
ERROR 2016-01-25 02:31:55,105 go_runtime.py:179] Failed to build Go application: (Executed command: /Users/moon/go_appengine/goroot/bin/go-app-builder -app_base /Users/moon/Downloads/d1/d2 -arch 6 -dynamic -goroot /Users/moon/go_appengine/goroot -nobuild_files ^^$ -unsafe -gopath /Users/moon/gopath:/Users/moon/go_appengine/goroot -binary_name _go_app -extra_imports appengine_internal/init -work_dir /var/folders/75/xlk18qb10231fqxqmdwg_xhm0000gn/T/tmpf1CeKbappengine-go-bin -gcflags -I,/Users/moon/go_appengine/goroot/pkg/darwin_amd64_appengine -ldflags -L,/Users/moon/go_appengine/goroot/pkg/darwin_amd64_appengine beta.go main.go)
/var/folders/75/xlk18qb10231fqxqmdwg_xhm0000gn/T/tmpf1CeKbappengine-go-bin/beta.go:9: import /Users/moon/go_appengine/goroot/pkg/darwin_amd64/appengine.a: object is [darwin amd64 go1.5.2 X:none] expected [darwin amd64 go1.4.2 (appengine-1.9.31) X:precisestack]
2016/01/25 04:31:55 go-app-builder: build timing: 1×6g (11ms total), 0×6l (0 total)
2016/01/25 04:31:55 go-app-builder: failed running 6g: exit status 1
^Cgoapp: caught SIGINT, waiting for dev_appserver.py to shut down
INFO 2016-01-25 02:32:19,423 shutdown.py:45] Shutting down.
INFO 2016-01-25 02:32:19,423 api_server.py:648] Applying all pending transactions and saving the datastore
INFO 2016-01-25 02:32:19,423 api_server.py:651] Saving search indexes
➜ dev git:(master) ✗ goapp version
go version go1.4.2 (appengine-1.9.31) darwin/amd64
➜ dev git:(master) ✗ go version
go version go1.5.2 darwin/amd64
➜ dev git:(master) ✗
➜ dev git:(master) ✗echo $GOPATH
/Users/moon/gopath:/Users/moon/go_appengine/goroot

C compiler cannot create executables

I installed OSx 1.6 and 1.7 (lion) today (1.5 was installed before). After this i reinstalled xcode and command line tools. Unistalled and cleand all ports from macport. When i try to install something from macports there is an error: (reinstalling xcode doesn't work)
---> Computing dependencies for autoconf
---> Dependencies to be installed: help2man gettext expat libiconv gperf ncurses ncursesw p5.12-locale-gettext perl5.12 gdbm m4 perl5
---> Configuring expat
Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Error: Failed to install expat
Log for expat is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/main.log
Error: The following dependencies were not installed: help2man gettext expat libiconv gperf ncurses ncursesw p5.12-locale-gettext perl5.12 gdbm m4 perl5
Error: Status 1 encountered during processing.
Install log:
cat /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/main.log
version:1
:debug:main Attempting ln -sf /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work /opt/local/var/macports/sources/rsync.macports.org/release/ports/textproc/expat/work
:debug:main changing euid/egid - current euid: 0 - current egid: 0
:debug:main egid changed to: 500
:debug:main euid changed to: 501
:debug:main Executing org.macports.main (expat)
:debug:main Privilege de-escalation not attempted as not running as root.
:debug:archivefetch archivefetch phase started at Mon Feb 20 17:36:35 CET 2012
:msg:archivefetch ---> Fetching archive for expat
:debug:archivefetch Executing org.macports.archivefetch (expat)
:debug:archivefetch euid/egid changed to: 0/0
:debug:archivefetch chowned /opt/local/var/macports/software/expat to macports
:debug:archivefetch euid/egid changed to: 501/500
:debug:archivefetch euid/egid changed to: 0/0
:debug:archivefetch chowned /opt/local/var/macports/incoming to macports
:debug:archivefetch euid/egid changed to: 501/500
:info:archivefetch ---> expat-2.0.1_1.darwin_11.x86_64.tbz2 doesn't seem to exist in /opt/local/var/macports/software/expat
:msg:archivefetch ---> Attempting to fetch expat-2.0.1_1.darwin_11.x86_64.tbz2 from http://packages.macports.org/expat
:debug:archivefetch Fetching archive failed:: The requested URL returned error: 404
:debug:archivefetch Privilege de-escalation not attempted as not running as root.
:debug:fetch fetch phase started at Mon Feb 20 17:36:37 CET 2012
:notice:fetch ---> Fetching expat
:debug:fetch euid/egid changed to: 0/0
:debug:fetch chowned /opt/local/var/macports/distfiles/expat to macports
:debug:fetch euid/egid changed to: 501/500
:debug:fetch Executing org.macports.fetch (expat)
:debug:fetch Privilege de-escalation not attempted as not running as root.
:debug:checksum checksum phase started at Mon Feb 20 17:36:37 CET 2012
:notice:checksum ---> Verifying checksum(s) for expat
:debug:checksum Executing org.macports.checksum (expat)
:info:checksum ---> Checksumming expat-2.0.1.tar.gz
:debug:checksum Correct (md5) checksum for expat-2.0.1.tar.gz
:debug:checksum Correct (sha1) checksum for expat-2.0.1.tar.gz
:debug:checksum Correct (rmd160) checksum for expat-2.0.1.tar.gz
:debug:checksum Privilege de-escalation not attempted as not running as root.
:debug:extract extract phase started at Mon Feb 20 17:36:37 CET 2012
:notice:extract ---> Extracting expat
:debug:extract Executing org.macports.extract (expat)
:info:extract ---> Extracting expat-2.0.1.tar.gz
:debug:extract setting option extract.args to '/opt/local/var/macports/distfiles/expat/expat-2.0.1.tar.gz'
:debug:extract Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.7'
:debug:extract Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/expat/expat-2.0.1.tar.gz' | /usr/bin/gnutar --no-same-owner -xf -'
:debug:extract Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work" && /usr/bin/gzip -dc '/opt/local/var/macports/distfiles/expat/expat-2.0.1.tar.gz' | /usr/bin/gnutar --no-same-owner -xf -
:debug:extract euid/egid changed to: 0/0
:debug:extract chowned /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work to macports
:debug:extract euid/egid changed to: 501/500
:debug:extract Privilege de-escalation not attempted as not running as root.
:debug:patch patch phase started at Mon Feb 20 17:36:37 CET 2012
:debug:patch Executing org.macports.patch (expat)
:debug:patch Privilege de-escalation not attempted as not running as root.
:debug:configure configure phase started at Mon Feb 20 17:36:37 CET 2012
:notice:configure ---> Configuring expat
:debug:configure Using compiler 'Mac OS X clang'
:debug:configure Executing org.macports.configure (expat)
:debug:configure Environment: CPATH='/opt/local/include' CFLAGS='-pipe -O2 -arch x86_64' CPPFLAGS='-I/opt/local/include' CXXFLAGS='-pipe -O2 -arch x86_64' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.7' CXX='/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -O2 -m64' LDFLAGS='-L/opt/local/lib -arch x86_64' OBJC='/Applications/Xcode.app/Contents/Developer/usr/bin/clang' FCFLAGS='-pipe -O2 -m64' INSTALL='/usr/bin/install -c' OBJCFLAGS='-pipe -O2 -arch x86_64' FFLAGS='-pipe -O2 -m64' CC_PRINT_OPTIONS='YES' CC='/Applications/Xcode.app/Contents/Developer/usr/bin/clang'
:debug:configure Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work/expat-2.0.1" && ./configure --prefix=/opt/local --mandir=/opt/local/share/man'
:debug:configure Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work/expat-2.0.1" && ./configure --prefix=/opt/local --mandir=/opt/local/share/man
:info:configure checking build system type... i386-apple-darwin11.3.0
:info:configure checking host system type... i386-apple-darwin11.3.0
:info:configure checking for gcc... /Applications/Xcode.app/Contents/Developer/usr/bin/clang
:info:configure checking for C compiler default output file name... configure: error: C compiler cannot create executables
:info:configure See `config.log' for more details.
:info:configure shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_expat/expat/work/expat-2.0.1" && ./configure --prefix=/opt/local --mandir=/opt/local/share/man " returned error 77
:error:configure Target org.macports.configure returned: configure failure: shell command failed (see log for details)
:debug:configure Backtrace: configure failure: shell command failed (see log for details)
while executing
"$procedure $targetname"
:info:configure Warning: the following items did not execute (for expat): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
:error:configure Failed to install expat
:debug:configure couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
while executing
"open [file join $dir tclIndex]"
i tried to run: sudo port -f install tcl +headers, error:
:info:configure checking for C compiler default output file name... configure: error: C compiler cannot create executables
:info:configure See `config.log' for more details.
:info:configure shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/tcl/work/tcl8.5.11/unix" && ./configure --prefix=/opt/local --mandir=/opt/local/share/man --disable-corefoundation tcl_cv_type_64bit="long long" " returned error 77
:error:configure Target org.macports.configure returned: configure failure: shell command failed (see log for details)
:debug:configure Backtrace: configure failure: shell command failed (see log for details)
while executing
"$procedure $targetname"
:info:configure Warning: the following items did not execute (for tcl): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
:notice:configure Log for tcl is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_tcl/tcl/main.log
Macports doesn't work with Xcode 4.3
The last lines of the log file say:
:debug:configure couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
while executing
"open [file join $dir tclIndex]"
It looks as if there is something up with your installation of Tcl/Tk - it doesn't match something's expectations. Either it isn't installed at all or it is the wrong version or ...
I suggest aiming to resolve that - or working out why $dir was set to /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/ before continuing.

Resources