Comments (15)
Hi @FabriceHecht π.
Could you provide the contents of your config/deploy-secrets.yml
file?
from installer.
HI @javierm
fabrice@fabrice-VirtualBox:~/consul/config$ cat deploy-secrets.yml
production:
deploy_to: "/home/fabrice/consul"
server1: "192.168.178.85"
user: "fabrice"
db_server: "localhost"
server_name: "192.168.178.85"
ssh_port: "22"
full_app_name: "consul"
fabrice@fabrice-VirtualBox:~/consul/config$ cat deploy.rb
# config valid only for current version of Capistrano
lock "~> 3.14.1"
def deploysecret(key)
@deploy_secrets_yml ||= YAML.load_file("config/deploy-secrets.yml")[fetch(:stage).to_s]
@deploy_secrets_yml.fetch(key.to_s, "undefined")
end
set :rails_env, fetch(:stage)
set :rvm1_map_bins, -> { fetch(:rvm_map_bins).to_a.concat(%w[rake gem bundle ruby]).uniq }
set :application, "consul"
set :deploy_to, deploysecret(:deploy_to)
set :ssh_options, port: deploysecret(:ssh_port)
set :repo_url, "https://github.com/FabriceHecht/consul.git"
set :revision, `git rev-parse --short #{fetch(:branch)}`.strip
set :log_level, :info
set :pty, true
set :use_sudo, false
set :linked_files, %w[config/database.yml config/secrets.yml]
set :linked_dirs, %w[.bundle log tmp public/system public/assets public/ckeditor_assets]
set :keep_releases, 5
set :local_user, ENV["USER"]
set :puma_conf, "#{release_path}/config/puma/#{fetch(:rails_env)}.rb"
set :delayed_job_workers, 2
set :delayed_job_roles, :background
set :whenever_roles, -> { :app }
namespace :deploy do
Rake::Task["delayed_job:default"].clear_actions
Rake::Task["puma:smart_restart"].clear_actions
after :updating, "rvm1:install:rvm"
after :updating, "rvm1:install:ruby"
after "deploy:migrate", "add_new_settings"
after :publishing, "setup_puma"
after :published, "deploy:restart"
before "deploy:restart", "puma:restart"
before "deploy:restart", "delayed_job:restart"
before "deploy:restart", "puma:start"
after :finished, "refresh_sitemap"
desc "Deploys and runs the tasks needed to upgrade to a new release"
task :upgrade do
after "add_new_settings", "execute_release_tasks"
invoke "deploy"
end
end
task :refresh_sitemap do
on roles(:app) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :rake, "sitemap:refresh:no_ping"
end
end
end
end
task :add_new_settings do
on roles(:db) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :rake, "settings:add_new_settings"
end
end
end
end
task :execute_release_tasks do
on roles(:app) do
within release_path do
with rails_env: fetch(:rails_env) do
execute :rake, "consul:execute_release_tasks"
end
end
end
end
desc "Create pid and socket folders needed by puma"
task :setup_puma do
on roles(:app) do
with rails_env: fetch(:rails_env) do
execute "mkdir -p #{shared_path}/tmp/sockets; true"
execute "mkdir -p #{shared_path}/tmp/pids; true"
end
end
end
from installer.
@FabriceHecht I take the production server is on the same local network as your computer; is that right? Did you use the installer to install CONSUL with the default deploy
user? If not, which user did you create on the production server?
from installer.
I take the production server is on the same local network as your computer; is that right?
Yes, the production server runs (for testing purposes) on an old laptop and the local installation is on my usual working laptop.
They both are in the same network. SSH it self works fine and without password request. I also tried to deploy my fork from my local installation to a server in our data center, which also doesn't work with the same error.
Did you use the installer to install CONSUL with the default deploy user? If not, which user did you create on the production server?
I used the installer for the production installation. The name of my user is fabrice. As I mentioned, I also tried it on a second machine in the datacenter. For this second Installation I used the default deploy user, but with the same result.
from installer.
In the second installation, were you also using deploy_to: "/home/fabrice/consul"
and user: "fabrice"
in the deploy-secrets.yml
fiel or did you modified those lines so deploy
was used?
from installer.
@javierm
Yes, I changed it to deploy in the second installation.
from installer.
Could you paste the error messages you got in the second installation? Right now I'm not sure on which machine the error is taking place since on both machines the user is fabrice
π€.
from installer.
00:00 rvm1:hook
01 mkdir -p undefined/rvm1scripts/
#<Thread:0x0000562028b9d310@/home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
17: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
16: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
15: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
14: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/rvm1-capistrano3-1.4.0/lib/rvm1/tasks/capistrano3.rake:5:in `block (3 levels) in <top (required)>'
13: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:80:in `execute'
12: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
11: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `tap'
10: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
9: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:130:in `execute_command'
8: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:177:in `with_ssh'
7: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/connection_pool.rb:63:in `with'
6: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/backends/connection_pool.rb:63:in `call'
5: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `start'
4: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `new'
3: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:73:in `initialize'
2: from /home/fabrice/.rbenv/versions/2.6.6/lib/ruby/2.6.0/socket.rb:631:in `tcp'
1: from /home/fabrice/.rbenv/versions/2.6.6/lib/ruby/2.6.0/socket.rb:227:in `foreach'
/home/fabrice/.rbenv/versions/2.6.6/lib/ruby/2.6.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Servname not supported for ai_socktype (SocketError)
1: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/fabrice/.rvm/gems/ruby-3.0.0/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as undefined@undefined: getaddrinfo: Servname not supported for ai_socktype (SSHKit::Runner::ExecuteError)
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as undefined@undefined: getaddrinfo: Servname not supported for ai_socktype
Caused by:
SocketError: getaddrinfo: Servname not supported for ai_socktype
Tasks: TOP => rvm1:hook
(See full trace by running task with --trace)
from installer.
3: from /home/fabrice/.rvm/gems/ruby-3.0.0/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:73:in `initialize'
2: from /home/fabrice/.rbenv/versions/2.6.6/lib/ruby/2.6.0/socket.rb:631:in `tcp'
@FabriceHecht Are you using both rvm and rbenv on your working laptop? π€ Also RVM seems to be using Ruby 3.0.0, while CONSUL depends on Ruby 2.6.6.
from installer.
@javierm Yes, I am using both. Should In uninstall one of it? How can I tell RVM to use Ruby 2.6.6?
from installer.
They might be incompatible, so yes, uninstall one of them unless you're sure you need both for some reason.
How can I tell RVM to use Ruby 2.6.6?
It should do it automatically because it reads the .ruby-version
file present in CONSUL. It's probably failing now because both rvm and rbenv are installed π€.
from installer.
By the way, on your local machine, it doesn't matter whether you use rbenv or RVM. On the production server CONSUL expects RVM though, and that's what the installer sets up.
from installer.
@javierm I uninstalled rbenv and had to bundle again and set the default ruby version for rvm and now its running into the same error but with rvm instead of rbenv.
fabrice@fabrice-VirtualBox:~/consul$ cap production deploy
00:00 rvm1:hook
01 mkdir -p undefined/rvm1scripts/
#<Thread:0x00005648a8e0a488@/home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
17: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
16: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `run'
15: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
14: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/rvm1-capistrano3-1.4.0/lib/rvm1/tasks/capistrano3.rake:5:in `block (3 levels) in <top (required)>'
13: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:80:in `execute'
12: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
11: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `tap'
10: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
9: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:130:in `execute_command'
8: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/netssh.rb:177:in `with_ssh'
7: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/connection_pool.rb:63:in `with'
6: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/backends/connection_pool.rb:63:in `call'
5: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `start'
4: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/net-ssh-6.1.0/lib/net/ssh.rb:251:in `new'
3: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/net-ssh-6.1.0/lib/net/ssh/transport/session.rb:73:in `initialize'
2: from /home/fabrice/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/socket.rb:631:in `tcp'
1: from /home/fabrice/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/socket.rb:227:in `foreach'
/home/fabrice/.rvm/rubies/ruby-2.6.6/lib/ruby/2.6.0/socket.rb:227:in `getaddrinfo': getaddrinfo: Servname not supported for ai_socktype (SocketError)
1: from /home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/fabrice/.rvm/gems/ruby-2.6.6/gems/sshkit-1.21.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as undefined@undefined: getaddrinfo: Servname not supported for ai_socktype (SSHKit::Runner::ExecuteError)
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as undefined@undefined: getaddrinfo: Servname not supported for ai_socktype
Caused by:
SocketError: getaddrinfo: Servname not supported for ai_socktype
Tasks: TOP => rvm1:hook
(See full trace by running task with --trace)
from installer.
Just realized something:
fabrice@fabrice-VirtualBox:~/consul/config$ cat -secrets.yml
production:
deploy_to: "/home/fabrice/consul"
server1: "192.168.178.85"
user: "fabrice"
db_server: "localhost"
server_name: "192.168.178.85"
ssh_port: "22"
full_app_name: "consul"
Are the file contents literally these ones? I'm asking because every line except the first one should start with two spaces π€.
from installer.
@FabriceHecht We've added more precise instructions about configuring the deploy-secrets.yml
file. Hope that helps!
from installer.
Related Issues (20)
- Error running rails console HOT 1
- Install Error SSH Key HOT 2
- Error al modificar estilos y subir imagenes HOT 2
- Do I need this installer? HOT 3
- Installer fails on gem install HOT 12
- TASK [rails : Precompile assets] aborted. RuntimeError HOT 9
- the remote end hung up unexpectedly HOT 6
- Adding Certbot ppa fails for Ubuntu 20.04 HOT 2
- Problem of validate account HOT 1
- Support Ubuntu 22.04 HOT 6
- Capistrano deployment HOT 3
- Public Key not being recognized HOT 1
- Automatically restart delayed job processes when they stop HOT 1
- Allow using a separate database server
- Debian buster broken CI configuration HOT 2
- Missing packages - sudo, gnupg, lsb-release HOT 3
- 422 The change you wanted was rejected HOT 5
- Installer gets stuck on task select default ruby HOT 6
- First Capistrano update fails `mkdir: cannot create directory β/home/deployβ: Permission denied` Ubuntu 20.04 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from installer.