Rails 4 / Capistrano 3 Deployment Stopped Working (no errors) - ruby-on-rails

I built my first Rails app and am running production off a home server. Capistrano 3 worked for about a month and now it just stopped deploying. When I run cap production deploy, my app does not change on the server. It uploads my git-ssh.sh file to the root temp directory, then exits "successfully". I haven't changed anything except modifying some html since it was originally working.
My remote repo is on bitbucket and has the latest commits. I can go as far as commenting out the :repo_url in deploy.rb and not have an error.
Since there isn't an error and since I am a newb, I have a feeling that this is a very general behavior and I have overlooked something small. Any ideas?
Normal Output:
INFO [38ef66f0] Running /usr/bin/env mkdir -p /tmp/PATH/ on MYSERVER.com
INFO [38ef66f0] Finished in 1.571 seconds with exit status 0 (successful).
INFO Uploading /tmp/PATH/git-ssh.sh 100.0%
INFO [aae6143c] Running /usr/bin/env chmod +x /tmp/PATH/git-ssh.sh on MYSERVER.com
INFO [aae6143c] Finished in 0.109 seconds with exit status 0 (successful).
Verbose Output:
INFO [b15bb422] Running /usr/bin/env mkdir -p /tmp/PATH/ on MYSERVER.com
D, [TIME:14.310370] DEBUG -- net.ssh.transport.session[SESSION]: establishing connection to MYSERVER.com:PORT
D, [TIME:14.814878] DEBUG -- net.ssh.transport.session[SESSION]: connection established
I, [TIME:14.815000] INFO -- net.ssh.transport.server_version[VERSION]: negotiating protocol version
D, [TIME:14.882919] DEBUG -- net.ssh.transport.server_version[VERSION]: remote is `SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1'
D, [TIME:14.883020] DEBUG -- net.ssh.transport.server_version[VERSION]: local is `SSH-2.0-Ruby/Net::SSH_2.7.0 x86_64-darwin12.3.0'
D, [TIME:14.934561] DEBUG -- tcpsocket[SOCKET]: read 984 bytes
D, [TIME:14.934662] DEBUG -- tcpsocket[SOCKET]: received packet nr 0 type 20 len 980
I, [TIME:14.934719] INFO -- net.ssh.transport.algorithms[ALGORITHMS]: got KEXINIT from server
I, [TIME:14.934810] INFO -- net.ssh.transport.algorithms[ALGORITHMS]: sending KEXINIT
D, [TIME:14.934914] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 0 type 20 len 1620
D, [TIME:14.934974] DEBUG -- tcpsocket[SOCKET]: sent 1624 bytes
I, [TIME:14.934999] INFO -- net.ssh.transport.algorithms[ALGORITHMS]: negotiating algorithms
D, [TIME:14.935071] DEBUG -- net.ssh.transport.algorithms[ALGORITHMS]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [TIME:14.935093] DEBUG -- net.ssh.transport.algorithms[ALGORITHMS]: exchanging keys
D, [TIME:14.935202] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 1 type 34 len 20
D, [TIME:14.935238] DEBUG -- tcpsocket[SOCKET]: sent 24 bytes
D, [TIME:15.035995] DEBUG -- tcpsocket[SOCKET]: read 152 bytes
D, [TIME:15.036218] DEBUG -- tcpsocket[SOCKET]: received packet nr 1 type 31 len 148
D, [TIME:15.038033] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 2 type 32 len 140
D, [TIME:15.038149] DEBUG -- tcpsocket[SOCKET]: sent 144 bytes
D, [TIME:15.113155] DEBUG -- tcpsocket[SOCKET]: read 720 bytes
D, [TIME:15.113304] DEBUG -- tcpsocket[SOCKET]: received packet nr 2 type 33 len 700
D, [TIME:15.114762] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 3 type 21 len 20
D, [TIME:15.114857] DEBUG -- tcpsocket[SOCKET]: sent 24 bytes
D, [TIME:15.114923] DEBUG -- tcpsocket[SOCKET]: received packet nr 3 type 21 len 12
D, [TIME:15.115172] DEBUG -- net.ssh.authentication.session[SESSION]: beginning authentication of `USER'
D, [TIME:15.115267] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 4 type 5 len 28
D, [TIME:15.115315] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:15.245792] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:15.246035] DEBUG -- tcpsocket[SOCKET]: received packet nr 4 type 6 len 28
D, [TIME:15.246215] DEBUG -- net.ssh.authentication.session[SESSION]: trying publickey
D, [TIME:15.246510] DEBUG -- net.ssh.authentication.agent[AGENT]: connecting to ssh-agent
D, [TIME:15.246633] DEBUG -- net.ssh.authentication.agent[AGENT]: sending agent request 1 len 51
D, [TIME:15.246750] DEBUG -- net.ssh.authentication.agent[AGENT]: received agent packet 2 len 5
D, [TIME:15.246801] DEBUG -- net.ssh.authentication.agent[AGENT]: sending agent request 11 len 0
D, [TIME:15.246921] DEBUG -- net.ssh.authentication.agent[AGENT]: received agent packet 12 len 5
D, [TIME:15.247091] DEBUG -- net.ssh.authentication.methods.publickey[PUBKEY]: trying publickey
D, [TIME:15.247242] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 5 type 50 len 348
D, [TIME:15.247341] DEBUG -- tcpsocket[SOCKET]: sent 372 bytes
D, [TIME:15.298246] DEBUG -- tcpsocket[SOCKET]: read 324 bytes
D, [TIME:15.298404] DEBUG -- tcpsocket[SOCKET]: received packet nr 5 type 60 len 300
D, [TIME:15.300524] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 6 type 50 len 620
D, [TIME:15.300583] DEBUG -- tcpsocket[SOCKET]: sent 644 bytes
D, [TIME:15.347646] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:15.347769] DEBUG -- tcpsocket[SOCKET]: received packet nr 6 type 52 len 12
D, [TIME:15.347829] DEBUG -- net.ssh.authentication.methods.publickey[PUBKEY]: publickey succeeded
D, [TIME:15.348064] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 7 type 90 len 44
D, [TIME:15.348175] DEBUG -- tcpsocket[SOCKET]: sent 68 bytes
D, [TIME:15.928356] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:15.928650] DEBUG -- tcpsocket[SOCKET]: received packet nr 7 type 91 len 28
I, [TIME:15.928842] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 0 0 0 32768
I, [TIME:15.928956] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "auth-agent-req#openssh.com"
D, [TIME:15.929074] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 8 type 98 len 44
I, [TIME:15.929227] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "env"
D, [TIME:15.929324] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 9 type 98 len 44
I, [TIME:15.929511] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "exec"
D, [TIME:15.929607] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 10 type 98 len 76
D, [TIME:15.929751] DEBUG -- tcpsocket[SOCKET]: sent 236 bytes
D, [TIME:15.974678] DEBUG -- tcpsocket[SOCKET]: read 124 bytes
D, [TIME:15.974830] DEBUG -- tcpsocket[SOCKET]: received packet nr 8 type 99 len 12
I, [TIME:15.974895] INFO -- net.ssh.connection.session[SESSION]: channel_success: 0
D, [TIME:15.974950] DEBUG -- net.ssh.service.forward[FORWARD]: authentication agent forwarding is active
D, [TIME:15.975012] DEBUG -- tcpsocket[SOCKET]: received packet nr 9 type 93 len 28
I, [TIME:15.975052] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 0 +2097152
D, [TIME:15.975111] DEBUG -- tcpsocket[SOCKET]: received packet nr 10 type 99 len 12
I, [TIME:15.975145] INFO -- net.ssh.connection.session[SESSION]: channel_success: 0
D, [TIME:15.980283] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:15.980403] DEBUG -- tcpsocket[SOCKET]: received packet nr 11 type 96 len 12
I, [TIME:15.980455] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 0
D, [TIME:15.985198] DEBUG -- tcpsocket[SOCKET]: read 104 bytes
D, [TIME:15.985276] DEBUG -- tcpsocket[SOCKET]: received packet nr 12 type 98 len 44
I, [TIME:15.985337] INFO -- net.ssh.connection.session[SESSION]: channel_request: 0 exit-status false
INFO [b15bb422] Finished in 1.677 seconds with exit status 0 (successful).
D, [TIME:15.985583] DEBUG -- tcpsocket[SOCKET]: received packet nr 13 type 97 len 12
I, [TIME:15.985633] INFO -- net.ssh.connection.session[SESSION]: channel_close: 0
D, [TIME:15.985706] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 11 type 97 len 28
D, [TIME:15.985916] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 12 type 90 len 44
D, [TIME:15.986043] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.029662] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.029837] DEBUG -- tcpsocket[SOCKET]: received packet nr 14 type 91 len 28
I, [TIME:16.029900] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 1 2 0 32768
I, [TIME:16.030024] INFO -- net.ssh.connection.channel[3fdef9deb620]: sending channel request "env"
D, [TIME:16.030116] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 13 type 98 len 44
I, [TIME:16.030238] INFO -- net.ssh.connection.channel[3fdef9deb620]: sending channel request "exec"
D, [TIME:16.030309] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 14 type 98 len 76
D, [TIME:16.030389] DEBUG -- tcpsocket[SOCKET]: sent 168 bytes
D, [TIME:16.075046] DEBUG -- tcpsocket[SOCKET]: read 88 bytes
D, [TIME:16.075278] DEBUG -- tcpsocket[SOCKET]: received packet nr 15 type 93 len 28
I, [TIME:16.075359] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 1 +2097152
D, [TIME:16.075448] DEBUG -- tcpsocket[SOCKET]: received packet nr 16 type 99 len 12
I, [TIME:16.075501] INFO -- net.ssh.connection.session[SESSION]: channel_success: 1
D, [TIME:16.081736] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.081907] DEBUG -- tcpsocket[SOCKET]: received packet nr 17 type 94 len 28
I, [TIME:16.081982] INFO -- net.ssh.connection.session[SESSION]: channel_data: 1 1b
D, [TIME:16.082185] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 15 type 94 len 44
D, [TIME:16.082273] DEBUG -- tcpsocket[SOCKET]: sent 68 bytes
D, [TIME:16.136866] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.137045] DEBUG -- tcpsocket[SOCKET]: received packet nr 18 type 94 len 28
I, [TIME:16.137113] INFO -- net.ssh.connection.session[SESSION]: channel_data: 1 1b
INFO Uploading /tmp/PATH/git-ssh.sh 100.0%
D, [TIME:16.137318] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 16 type 94 len 108
D, [TIME:16.137408] DEBUG -- tcpsocket[SOCKET]: sent 132 bytes
D, [TIME:16.137514] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 17 type 94 len 28
D, [TIME:16.137574] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:16.258376] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.258656] DEBUG -- tcpsocket[SOCKET]: received packet nr 19 type 94 len 28
I, [TIME:16.258789] INFO -- net.ssh.connection.session[SESSION]: channel_data: 1 1b
D, [TIME:16.258974] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 18 type 96 len 28
D, [TIME:16.259094] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:16.303592] DEBUG -- tcpsocket[SOCKET]: read 140 bytes
D, [TIME:16.303733] DEBUG -- tcpsocket[SOCKET]: received packet nr 20 type 96 len 12
I, [TIME:16.303788] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 1
D, [TIME:16.303861] DEBUG -- tcpsocket[SOCKET]: received packet nr 21 type 98 len 44
I, [TIME:16.303907] INFO -- net.ssh.connection.session[SESSION]: channel_request: 1 exit-status false
D, [TIME:16.303966] DEBUG -- tcpsocket[SOCKET]: received packet nr 22 type 97 len 12
I, [TIME:16.304003] INFO -- net.ssh.connection.session[SESSION]: channel_close: 1
D, [TIME:16.304068] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 19 type 97 len 28
INFO [265118f7] Running /usr/bin/env chmod +x /tmp/PATH/git-ssh.sh on MYSERVER.com
D, [TIME:16.304365] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 20 type 90 len 44
D, [TIME:16.312579] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.354938] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.355150] DEBUG -- tcpsocket[SOCKET]: received packet nr 23 type 91 len 28
I, [TIME:16.355235] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 2 0 0 32768
I, [TIME:16.355389] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "env"
D, [TIME:16.355501] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 21 type 98 len 44
I, [TIME:16.355650] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "exec"
D, [TIME:16.355734] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 22 type 98 len 76
D, [TIME:16.355856] DEBUG -- tcpsocket[SOCKET]: sent 168 bytes
D, [TIME:16.401684] DEBUG -- tcpsocket[SOCKET]: read 88 bytes
D, [TIME:16.401888] DEBUG -- tcpsocket[SOCKET]: received packet nr 24 type 93 len 28
I, [TIME:16.401970] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 2 +2097152
D, [TIME:16.402037] DEBUG -- tcpsocket[SOCKET]: received packet nr 25 type 99 len 12
I, [TIME:16.402070] INFO -- net.ssh.connection.session[SESSION]: channel_success: 2
D, [TIME:16.409522] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:16.409723] DEBUG -- tcpsocket[SOCKET]: received packet nr 26 type 96 len 12
I, [TIME:16.409811] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 2
D, [TIME:16.409866] DEBUG -- tcpsocket[SOCKET]: read 104 bytes
D, [TIME:16.409916] DEBUG -- tcpsocket[SOCKET]: received packet nr 27 type 98 len 44
I, [TIME:16.409960] INFO -- net.ssh.connection.session[SESSION]: channel_request: 2 exit-status false
INFO [265118f7] Finished in 0.106 seconds with exit status 0 (successful).
D, [TIME:16.410112] DEBUG -- tcpsocket[SOCKET]: received packet nr 28 type 97 len 12
I, [TIME:16.410144] INFO -- net.ssh.connection.session[SESSION]: channel_close: 2
D, [TIME:16.410203] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 23 type 97 len 28
D, [TIME:16.424746] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 24 type 90 len 44
D, [TIME:16.435241] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.476281] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.476476] DEBUG -- tcpsocket[SOCKET]: received packet nr 29 type 91 len 28
I, [TIME:16.476569] INFO -- net.ssh.connection.session[SESSION]: channel_open_confirmation: 3 2 0 32768
I, [TIME:16.476736] INFO -- net.ssh.connection.channel[3fdefac6f7f0]: sending channel request "env"
D, [TIME:16.476833] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 25 type 98 len 44
I, [TIME:16.477009] INFO -- net.ssh.connection.channel[3fdefac6f7f0]: sending channel request "exec"
D, [TIME:16.477088] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 26 type 98 len 172
D, [TIME:16.477186] DEBUG -- tcpsocket[SOCKET]: sent 264 bytes
D, [TIME:16.521258] DEBUG -- tcpsocket[SOCKET]: read 88 bytes
D, [TIME:16.521526] DEBUG -- tcpsocket[SOCKET]: received packet nr 30 type 93 len 28
I, [TIME:16.521663] INFO -- net.ssh.connection.session[SESSION]: channel_window_adjust: 3 +2097152
D, [TIME:16.521816] DEBUG -- tcpsocket[SOCKET]: received packet nr 31 type 99 len 12
I, [TIME:16.521879] INFO -- net.ssh.connection.session[SESSION]: channel_success: 3
D, [TIME:16.945782] DEBUG -- tcpsocket[SOCKET]: read 68 bytes
D, [TIME:16.946049] DEBUG -- tcpsocket[SOCKET]: received packet nr 32 type 90 len 44
I, [TIME:16.946157] INFO -- net.ssh.connection.session[SESSION]: channel open auth-agent#openssh.com
I, [TIME:16.946343] INFO -- net.ssh.connection.channel[CHANNEL]: sending channel request "env"
D, [TIME:16.946458] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 27 type 98 len 44
I, [TIME:16.946576] INFO -- net.ssh.service.forward[FORWARD]: opening auth-agent channel
D, [TIME:16.946641] DEBUG -- net.ssh.authentication.agent[AGENT]: connecting to ssh-agent
D, [TIME:16.946758] DEBUG -- net.ssh.authentication.agent[AGENT]: sending agent request 1 len 51
D, [TIME:16.946886] DEBUG -- net.ssh.authentication.agent[AGENT]: received agent packet 2 len 5
D, [TIME:16.947073] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 28 type 91 len 28
D, [TIME:16.947252] DEBUG -- tcpsocket[SOCKET]: sent 120 bytes
D, [TIME:16.990720] DEBUG -- tcpsocket[SOCKET]: read 52 bytes
D, [TIME:16.990882] DEBUG -- tcpsocket[SOCKET]: received packet nr 33 type 94 len 28
I, [TIME:16.990963] INFO -- net.ssh.connection.session[SESSION]: channel_data: 4 5b
D, [TIME:16.991002] DEBUG -- net.ssh.service.forward[FORWARD]: data:5 on agent forwarded channel
D, [TIME:16.991282] DEBUG -- unixsocket[SOCKET]: sent 5 bytes
D, [TIME:16.991351] DEBUG -- unixsocket[SOCKET]: read 9 bytes
D, [TIME:16.991412] DEBUG -- net.ssh.connection.channel[CHANNEL]: read 9 bytes from client, sending over agent forwarded connection
D, [TIME:16.991489] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 29 type 94 len 28
D, [TIME:16.991555] DEBUG -- tcpsocket[SOCKET]: sent 52 bytes
D, [TIME:17.066021] DEBUG -- tcpsocket[SOCKET]: read 84 bytes
D, [TIME:17.066253] DEBUG -- tcpsocket[SOCKET]: received packet nr 34 type 95 len 60
I, [TIME:17.066392] INFO -- net.ssh.connection.session[SESSION]: channel_extended_data: 3 1 32b
D, [TIME:17.068527] DEBUG -- tcpsocket[SOCKET]: read 36 bytes
D, [TIME:17.068733] DEBUG -- tcpsocket[SOCKET]: received packet nr 35 type 96 len 12
I, [TIME:17.068798] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 4
D, [TIME:17.068855] DEBUG -- net.ssh.service.forward[FORWARD]: eof agent on agent forwarded channel
D, [TIME:17.068945] DEBUG -- tcpsocket[SOCKET]: read 240 bytes
D, [TIME:17.069009] DEBUG -- tcpsocket[SOCKET]: received packet nr 36 type 95 len 76
I, [TIME:17.069067] INFO -- net.ssh.connection.session[SESSION]: channel_extended_data: 3 1 43b
D, [TIME:17.069151] DEBUG -- tcpsocket[SOCKET]: received packet nr 37 type 98 len 44
I, [TIME:17.069207] INFO -- net.ssh.connection.session[SESSION]: channel_request: 3 exit-status false
D, [TIME:17.069293] DEBUG -- tcpsocket[SOCKET]: received packet nr 38 type 96 len 12
I, [TIME:17.069335] INFO -- net.ssh.connection.session[SESSION]: channel_eof: 3
D, [TIME:17.069397] DEBUG -- tcpsocket[SOCKET]: received packet nr 39 type 97 len 12
I, [TIME:17.069455] INFO -- net.ssh.connection.session[SESSION]: channel_close: 3
D, [TIME:17.069539] DEBUG -- tcpsocket[SOCKET]: queueing packet nr 30 type 97 len 28

Not that anyone was following, but for the record:
My issue was that I had just set up a github key for other reasons since my last deployment. In doing so, a github_rsa.pub file was created in my .ssh directory. Apparently that made my id_rsa.pub no longer locally known, so Capistrano wasn't sending any of my keys to the server and not getting any errors back.
To fix it, I simply had to run ssh-add to add my key back to my ssh-agent.
Credits go to How to add a ssh key to remote server?, though not completely.

Related

Redmine very slow on first page load after some time of inactivity

Every morning, the first person that tries to access Redmine at my work is waiting almost one minute for redmine to load the page. After that, the rest of the team have no problem and almost every page are loading in less than 200ms.
Here is the log between the last "good" loading and the first "bad" loading of this morning:
App 103 output: I, [2021-04-16T00:19:24.965247 #103] INFO -- : Completed 200 OK in 829ms (Views: 553.2ms | ActiveRecord: 1.8ms)
App 103 output: I, [2021-04-16T03:09:12.511395 #103] INFO -- : Started GET "/login?back_url=https%3A%2F%2Fmyapp.com%2F" for WWW.XXX.YYY.ZZZ at 2021-04-16 03:09:12 +0000
App 103 output: I, [2021-04-16T03:09:12.532015 #103] INFO -- : Processing by AccountController#login as HTML
App 103 output: I, [2021-04-16T03:09:12.532084 #103] INFO -- : Parameters: {"back_url"=>"https://myapp.com/"}
App 103 output: I, [2021-04-16T03:09:12.694146 #103] INFO -- : Redirected to https://myapp.com/login?back_url=https%3A%2F%2Fmyapp.com%2Flogin%3Fback_url%3Dhttps%253A%252F%252Fmyapp.com%252F
App 103 output: I, [2021-04-16T03:09:12.694280 #103] INFO -- : Filter chain halted as :session_expiration rendered or redirected
App 103 output: I, [2021-04-16T03:09:12.694473 #103] INFO -- : Completed 302 Found in 162ms (ActiveRecord: 2.7ms)
App 103 output: I, [2021-04-16T03:09:13.201746 #103] INFO -- : Started GET "/login?back_url=https%3A%2F%2Fmyapp.com%2Flogin%3Fback_url%3Dhttps%253A%252F%252Fmyapp.com%252F" for WWW.XXX.YYY.ZZZ at 2021-04-16 03:09:13 +0000
App 103 output: I, [2021-04-16T03:09:13.205997 #103] INFO -- : Processing by AccountController#login as HTML
App 103 output: I, [2021-04-16T03:09:13.206088 #103] INFO -- : Parameters: {"back_url"=>"https://myapp.com/login?back_url=https%3A%2F%2Fmyapp.com%2F"}
App 103 output: I, [2021-04-16T03:09:13.283815 #103] INFO -- : Current user: anonymous
App 103 output: I, [2021-04-16T03:09:13.300562 #103] INFO -- : Rendering account/login.html.erb within layouts/base
App 103 output: I, [2021-04-16T03:09:13.304521 #103] INFO -- : Rendered account/login.html.erb within layouts/base (3.8ms)
App 103 output: I, [2021-04-16T03:09:13.526917 #103] INFO -- : Completed 200 OK in 321ms (Views: 242.1ms | ActiveRecord: 50.2ms)
App 103 output: I, [2021-04-16T03:09:15.396901 #103] INFO -- : Started POST "/login" for WWW.XXX.YYY.ZZZ at 2021-04-16 03:09:15 +0000
App 103 output: I, [2021-04-16T03:09:15.400666 #103] INFO -- : Processing by AccountController#login as HTML
App 103 output: I, [2021-04-16T03:09:15.400741 #103] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"*********************************", "username"=>"myuser", "password"=>"[FILTERED]", "login"=>"Connexion"}
App 103 output: I, [2021-04-16T03:09:15.461825 #103] INFO -- : Current user: anonymous
App 103 output: I, [2021-04-16T03:09:16.117981 #103] INFO -- : Successful authentication for 'myuser' from WWW.XXX.YYY.ZZZ at 2021-04-16 03:09:16 UTC
App 103 output: I, [2021-04-16T03:09:16.454431 #103] INFO -- : Redirected to https://myapp.com/my/page
App 103 output: I, [2021-04-16T03:09:16.454677 #103] INFO -- : Completed 302 Found in 1054ms (ActiveRecord: 778.5ms)
App 103 output: I, [2021-04-16T03:09:16.929227 #103] INFO -- : Started GET "/my/page" for WWW.XXX.YYY.ZZZ at 2021-04-16 03:09:16 +0000
App 103 output: I, [2021-04-16T03:09:17.650222 #103] INFO -- : Processing by MyController#page as HTML
App 103 output: I, [2021-04-16T03:09:18.625577 #103] INFO -- : Current user: myuser (id=208)
App 103 output: I, [2021-04-16T03:09:18.923542 #103] INFO -- : Rendering my/page.html.erb within layouts/base
App 103 output: I, [2021-04-16T03:09:35.622052 #103] INFO -- : Rendered queries/_columns.html.erb (509.9ms)
App 103 output: I, [2021-04-16T03:09:39.698459 #103] INFO -- : Rendered issues/_list.html.erb (3990.1ms)
App 103 output: I, [2021-04-16T03:09:39.736960 #103] INFO -- : Rendered my/blocks/_issues.erb (5549.7ms)
App 103 output: I, [2021-04-16T03:09:44.899092 #103] INFO -- : Rendered queries/_columns.html.erb (1643.8ms)
App 103 output: I, [2021-04-16T03:09:48.195990 #103] INFO -- : Rendered issues/_list.html.erb (3114.5ms)
App 103 output: I, [2021-04-16T03:09:48.238683 #103] INFO -- : Rendered my/blocks/_issues.erb (5564.4ms)
App 103 output: I, [2021-04-16T03:09:48.271494 #103] INFO -- : Rendered my/page.html.erb within layouts/base (29347.8ms)
App 103 output: I, [2021-04-16T03:10:17.568436 #103] INFO -- : Completed 200 OK in 59918ms (Views: 57311.4ms | ActiveRecord: 2235.3ms)
App 103 output: I, [2021-04-16T03:11:32.073474 #103] INFO -- : Started GET "/projects/myapp-v2?jump=my" for WWW.XXX.YYY.ZZZ at 2021-04-16 03:11:32 +0000
App 103 output: I, [2021-04-16T03:11:32.075240 #103] INFO -- : Processing by ProjectsController#show as HTML
App 103 output: I, [2021-04-16T03:11:32.075285 #103] INFO -- : Parameters: {"jump"=>"my", "id"=>"myapp-v2"}
App 103 output: I, [2021-04-16T03:11:32.083287 #103] INFO -- : Current user: myuser (id=208)
App 103 output: I, [2021-04-16T03:11:34.636170 #103] INFO -- : Rendering projects/show.html.erb within layouts/base
App 103 output: I, [2021-04-16T03:11:36.682491 #103] INFO -- : Rendered projects/_members_box.html.erb (157.3ms)
App 103 output: I, [2021-04-16T03:11:36.684234 #103] INFO -- : Rendered projects/show.html.erb within layouts/base (2048.0ms)
App 103 output: I, [2021-04-16T03:11:37.452800 #103] INFO -- : Completed 200 OK in 5377ms (Views: 2762.9ms | ActiveRecord: 620.0ms)
At 2021-04-16T03:10:17.568436 you can see a 200 OK response in 59918ms.
I run Remdine docker with a docker-compose file. Redmine is connecting to the host MySQL server and uses the host mail server too (no problem with that).
Here is the redmine-docker-compose.yml file content:
version: '3.1'
services:
redmine:
image: redmine:4.2-passenger
user: "$UID:$GID"
logging:
driver: "journald"
options:
tag: "redmine-docker"
mode: "non-blocking"
max-buffer-size: "4m"
ports:
- 8792:3000
environment:
REDMINE_DB_MYSQL: 172.17.0.1
REDMINE_DB_DATABASE: redmine
REDMINE_DB_PORT: 3306
REDMINE_DB_USERNAME: redmine
REDMINE_DB_PASSWORD: ***************
REDMINE_DB_ENCODING: utf8
REDMINE_SECRET_KEY_BASE: *************************
volumes:
- ./redmine/files:/usr/src/redmine/files
- ./redmine/themes/PurpleMine2-master:/usr/src/redmine/public/themes/PurpleMine2-master
- ./redmine/config/configuration.yml:/usr/src/redmine/config/configuration.yml
- ./redmine/repos:/usr/src/redmine/repos
- ./redmine/etc/passwd:/etc/passwd:ro
- ./redmine/usr/src/redmine/Passengerfile.json:/usr/src/redmine/Passengerfile.json
networks:
default:
external:
name: br-redmine-docker
Here is the configuration.yml content:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: 172.17.0.1
port: 25
enable_starttls_auto: false
And the Passengerfile.json content:
{
"max_pool_size": 15,
"pool_idle_time": 60,
"min_instances": 4
}
Note that I created the Passengerfile.json because of this exact same problem but it did not resolve it at all.
Here is the content of passwd file (it is just a copy of the file present in the docker image with one more line at the end):
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
redmine:x:999:999::/home/redmine:/bin/sh
hostuser:x:998:996::/home/hostuser:/bin/sh
And I created a .env file with this:
UID=998
GID=996
hostuser is a user that exists on my host (it's name is redmine on the host but I only needed to assign the right UID and GID in order to keep ownership of the redmine files to this user).
I also checked the wait_timeout MySQL variable that closes connections after a period of inactivity but it is on the default value which is 8 hours and my problem appears within approximately 4 hours so it can't be the cause.
I also wanted to disable tini in case it was that but I can't find any way to do that.
Any help is appreciated.
Thank you.
As a workaround, I ended up with writing a cron task that keep redmine awake with the curl command launched every hour. Here is a sample of my crontab:
0 */1 * * * /usr/bin/curl "https://my.redmine.com/login?keep-redmine-awake-cron" >/dev/null 2>&1
The URL parameter ?keep-redmine-awake-cron is only here to identify these requests in the web server logs.
The output of the command is ignored with >/dev/null 2>&1 because I don't want cron to send an email containing this useless output.
Though, I was not able to spot the real cause of those long requests after some inactivity.

Set up expansion EEPROM i2c-2 BeagleBoneBlack Rev-C

The BeagleBoneBlack comes with an "internal" EEPROM connected to i2c-0 line. I can see that clearly when I do i2cdetect:
debian#beaglebone:~$ i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: UU -- -- -- -- -- -- --
It is showing under address 0x50. When I try to do ahexdump I get the following values with no issue:
sudo hexdump -C /sys/class/i2c-dev/i2c-0/device/0-0050/eeprom | head -5
00000000 aa 55 33 ee 41 33 33 35 42 4e 4c 54 30 30 30 43 |.U3.A335BNLT000C|
00000010 31 38 33 37 42 42 42 47 30 36 32 32 ff ff ff ff |1837BBBG0622....|
00000020 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00001000 aa 55 33 ee 41 33 33 35 42 4e 4c 54 30 30 30 43 |.U3.A335BNLT000C|
Now I want to add another EEPROM (with cape) on i2c-2 line which is supported according to BBB SRM section 8.2. It is the CAT24C256 as mentioned in the SRM. The allowable address range for the expansion cards is 0x54-0x57. When I do i2cdetect I can see the following:
debian#beaglebone:~$ i2cdetect -r -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I can see the addresses 0x54-0x57 showing, but when I try hex dump I get an error:
hexdump: /sys/class/i2c-dev/i2c-2/device/2-0054/eeprom: Connection timed out
Questions:
Why are they showing as U's not actual address numbers? I know U stands for used resource?
Why am I failing to read from that EEPROM? I have tried all addreses from 0x54-0x57 with no luck. I can confirm that those addresses are showing in /sys/class/i2c-dev/i2c-2/device and the each dir has the following in it:
debian#beaglebone:~$ ls /sys/class/i2c-dev/i2c-2/device/2-0054/ -la
total 0
drwxr-xr-x 4 root root 0 Oct 26 19:46 .
drwxr-xr-x 8 root root 0 Oct 26 19:46 ..
drwxr-xr-x 3 root root 0 Oct 26 19:47 2-00540
lrwxrwxrwx 1 root root 0 Oct 26 19:47 driver -> ../../../../../../bus/i2c/drivers/at24
-rw------- 1 root root 32768 Oct 26 19:47 eeprom
-r--r--r-- 1 root root 4096 Oct 26 19:47 modalias
-r--r--r-- 1 root root 4096 Oct 26 19:47 name
lrwxrwxrwx 1 root root 0 Oct 26 19:47 of_node -> ../../../../../../firmware/devicetree/base/ocp/i2c#4819c000/cape_eeprom0#54
drwxr-xr-x 2 root root 0 Oct 26 19:47 power
lrwxrwxrwx 1 root root 0 Oct 26 19:47 subsystem -> ../../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 Oct 26 19:47 uevent
I can see the addresses mapping into the kernel but when I try to hexdump eeprom it doesn't work at all. I though this was supposed to be setup by kernel since it is mentioned in BeagleBone SRM. Am I going to need an overlay to add to uboot for this?
All I'm trying to do is read from the EEPROM like I did with the "internal" one to confirm it is working. What am I doing wrong?
The issue was that the cape manager was "hogging" those addresses on i23c-2. We will need to disable the cape manager in order to free those addresses. After doing that it shows 0x57 under i2c-2 so it should work afterwards.
Please checkout the following link as to how to disable Cape Manager on BeagleBone:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/beagleboard/NG8cDWuv2Y0/69vk5F5ZAgAJ)
Make sure to edit the am335x-boneblack-uboot.dts file remove the include on line 11 and replace with the following:
#include "am335x-bone-common-no-capemgr.dtsi"
Note this will disable your i2c-2 line by default so either enable it via overlays or edit the am335x-bone-common-no-capemgr.dtsi & add after &i2c0 (around line 245):
&i2c2 {
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins>;
status = "okay";
clock-frequency = <100000>;
};

Rails/net-ssh - ssh to remote server with private key in Heroku

I'm trying to ssh to a remote server using a private key through Heroku.
I'm using this gem https://github.com/net-ssh/net-ssh to complete the request and have everything working fine locally.
The reason why everything works fine locally is because I have the private key saved with the passphrase entered. When I deploy to Heroku, I'm unable to use the agent like I have it on my PC and so the connection fails.
I have changed the settings on the connection using net-ssh to not use the agent but still can't get it functioning.
Worst case I will have to create a separate API call in php hosted elsewhere to complete this connection but I'm hoping I can make it work through my rails app in Heroku.
This is what I'm currently doing:
options = {}
options[:key_data] = ENV['LANDING_PAGE_SSH_KEY']
options[:keys_only] = true
options[:use_agent] = false
options[:verbose] = :debug
options[:port] = '18765'
options[:passphrase] = ENV['SSH_KEY_PASSPHRASE']
Net::SSH.start(ENV['SERVER_HOSTNAME'], ENV['SERVER_USERNAME'], options) do |ssh|
end
I've entered the private key in a global variable and everything else that I would need. This also works locally without using the agent but fails on Heroku with this message:
[2017-07-21T19:20:35.506794 #4] DEBUG -- socket[383b2bc]: read 52 bytes
2017-07-21T19:20:35.507070+00:00 app[web.1]: D, [2017-07-21T19:20:35.507016 #4] DEBUG -- socket[383b2bc]: received packet nr 3 type 6 len 28
2017-07-21T19:20:35.507262+00:00 app[web.1]: D, [2017-07-21T19:20:35.507210 #4] DEBUG -- net.ssh.authentication.session[3fd3f610f914]: trying none
2017-07-21T19:20:35.507477+00:00 app[web.1]: D, [2017-07-21T19:20:35.507412 #4] DEBUG -- socket[383b2bc]: queueing packet nr 4 type 50 len 44
2017-07-21T19:20:35.507603+00:00 app[web.1]: D, [2017-07-21T19:20:35.507553 #4] DEBUG -- socket[383b2bc]: sent 68 bytes
2017-07-21T19:20:35.536336+00:00 app[web.1]: D, [2017-07-21T19:20:35.536194 #4] DEBUG -- socket[383b2bc]: read 52 bytes
2017-07-21T19:20:35.536472+00:00 app[web.1]: D, [2017-07-21T19:20:35.536422 #4] DEBUG -- socket[383b2bc]: received packet nr 4 type 51 len 28
2017-07-21T19:20:35.536573+00:00 app[web.1]: D, [2017-07-21T19:20:35.536526 #4] DEBUG -- net.ssh.authentication.session[3fd3f610f914]: allowed methods: publickey
2017-07-21T19:20:35.536657+00:00 app[web.1]: D, [2017-07-21T19:20:35.536612 #4] DEBUG -- net.ssh.authentication.methods.none[3fd3f6103e84]: none failed
2017-07-21T19:20:35.536749+00:00 app[web.1]: D, [2017-07-21T19:20:35.536703 #4] DEBUG -- net.ssh.authentication.session[3fd3f610f914]: trying publickey
2017-07-21T19:20:35.537566+00:00 app[web.1]: Enter passphrase for <key in memory>:Completed 500 Internal Server Error in 337ms (ActiveRecord: 1.4ms)
2017-07-21T19:20:35.538404+00:00 app[web.1]:
2017-07-21T19:20:35.538406+00:00 app[web.1]: Errno::ENOTTY (Inappropriate ioctl for device):
Any suggestions?
In my case I needed to add the private key to the server's ssh setup
ssh-add ~/.ssh/path-to-private-key
and it started working.

Parsing system log file with pig

I have the log below trying to parse it by the indicated column number 1 as Date, 2 as Time, 3 as Task, 4 as Error_Line, and 5 all the rest columns as Error_Message
|1 | |2 | |3 | |4 | |5 |
09-15-16 05:23:45 B:VVBN 09064 Port 22 Device 10400 Remote 44 13331 Link Up RP2016
09-15-16 05:23:44 A:QAWE 09064 Port 22 Device 10400 Remote 44 13331 Link Up RP2016
09-15-16 05:23:44 B:VVBN 13425 Port 22 Device 10400 Remote 44 13331 Receive Time Error: 24666 23270 1396 69
09-15-16 05:23:43 B:QAWE 13372 Port 22 Device 10400 Remote 44 13331 Send Time Error: 444 1888 1444 69
09-15-16 05:23:43 A:VVBN 13425 Port 22 Device 10400 Remote 44 13331 Receive Time Error: 24666 23270 1396 69
09-15-16 05:23:43 A:CCBE 13372 Port 22 Device 10400 Remote 44 13331 Send Time Error: 444 1888 1444 69
09-15-16 05:21:56 B:VVBN 07270 Port 22 Device 10400 Remote 44 13331 AT Timer Expired
09-15-16 05:21:56 A:CCBE 07270 Port 22 Device 10400 Remote 44 13331 AT Timer Expired
here is my script
logs = LOAD '/data/test_log.txt' USING PigStorge(' ') AS (date: chararray, time: chararray, task: chararray, line_error: int, error_message: chararray);
date = GROUP logs BY date;
counts = FOREACH date GENERATE COUNT($4) as count;
DUMP counts;
notice there is one space between columns only there is five spaces between 3 and 4 columns.
I tried the script above but it just work good for date not for last column Error_message.
I am trying to get this output bag:
(09-15-16,05:23:45,B:VVBN,09064,Port 22 Device 10400 Remote 44 13331 Link Up RP2016)
(09-15-16,05:23:44,A:QAWE,09064,Port 22 Device 10400 Remote 44 13331 Link Up RP2016)
:
:
I just need to consider the first four columns any other columns in the log file mix them in one column 5.
Any suggestion to get the desired output.
You need to use MyRegExLoader provided by piggybank to process custom log files.
logs = LOAD '/data/test_log.txt' USING org.apache.pig.piggybank.storage.MyRegExLoader ('provide the regex ');

cap uses admin instead of ec2-user

I'm trying to do a "cap ec2onrails:setup" for my ROR website to an EC2 instance (Amazon image) but authentication keeps asking me for a password no matter what I do. I've tried almost anything I've read in this and/or other forums:
copy public key from ~/.ssh to ec2-user#_.sa-east-1.compute.amazonaws.com:/home/ec2-user/.ssh/authorized_keys2 (or authorized_keys)
generate private key using Amazon Management Console and then copying the public key from the server to my machine
adding any of these keys using ssh-add -l
generating new keys using ssh-keychain
using the public/private set of keys already in my machine (id_rsa & id_rsa.pub)
naming the keys following the above ^^ convention
chmod 400 for the keys in ~/.ssh
moving the keys to ~/.ec2
setting environment vars like stated here
Notes:
Connecting to the server using ssh and the AWS .pem key works just
fine
It doesn't matter how I set the "keys" value in "ssh_options",
Capistrano always seems to ignore it. However, it doesn't ignore the
keys listed in ssh-add -l
Here's how I try to set the key path
set :ssh_options, {:keys => ["/Users/dalef/.ssh/pk"]}
Here's the output code from my latest test, using verbose output
Damians-MacBook-Pro:test dalef$ cap ec2onrails:setup
[Deprecation Warning] This API has changed, please hook `deploy:create_symlink` instead of `deploy:symlink`.
* 2013-03-20 20:10:52 executing `ec2onrails:setup'
* 2013-03-20 20:10:52 executing `ec2onrails:server:update_hostname'
* executing "sudo -p 'sudo password: ' /usr/local/ec2onrails/bin/update_hostname"
servers: ["___.sa-east-1.compute.amazonaws.com"]
D, [2013-03-20T20:10:52.471872 #2647] DEBUG -- net.ssh.transport.session[3fe825c3c40c]: establishing connection to ___.sa-east-1.compute.amazonaws.com:22
D, [2013-03-20T20:10:52.539934 #2647] DEBUG -- net.ssh.transport.session[3fe825c3c40c]: connection established
I, [2013-03-20T20:10:52.540236 #2647] INFO -- net.ssh.transport.server_version[3fe825c45728]: negotiating protocol version
D, [2013-03-20T20:10:52.591866 #2647] DEBUG -- net.ssh.transport.server_version[3fe825c45728]: remote is `SSH-2.0-OpenSSH_5.3'
D, [2013-03-20T20:10:52.591965 #2647] DEBUG -- net.ssh.transport.server_version[3fe825c45728]: local is `SSH-2.0-Ruby/Net::SSH_2.6.6 x86_64-darwin12.2.0'
D, [2013-03-20T20:10:52.635419 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 784 bytes
D, [2013-03-20T20:10:52.635555 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 0 type 20 len 780
I, [2013-03-20T20:10:52.635654 #2647] INFO -- net.ssh.transport.algorithms[3fe825c484dc]: got KEXINIT from server
I, [2013-03-20T20:10:52.635844 #2647] INFO -- net.ssh.transport.algorithms[3fe825c484dc]: sending KEXINIT
D, [2013-03-20T20:10:52.636042 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 0 type 20 len 1620
D, [2013-03-20T20:10:52.636141 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 1624 bytes
I, [2013-03-20T20:10:52.636196 #2647] INFO -- net.ssh.transport.algorithms[3fe825c484dc]: negotiating algorithms
D, [2013-03-20T20:10:52.636319 #2647] DEBUG -- net.ssh.transport.algorithms[3fe825c484dc]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-sha1
* hmac_server: hmac-sha1
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [2013-03-20T20:10:52.636373 #2647] DEBUG -- net.ssh.transport.algorithms[3fe825c484dc]: exchanging keys
D, [2013-03-20T20:10:52.636563 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 1 type 34 len 20
D, [2013-03-20T20:10:52.636613 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 24 bytes
D, [2013-03-20T20:10:52.738438 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 152 bytes
D, [2013-03-20T20:10:52.738637 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 1 type 31 len 148
D, [2013-03-20T20:10:52.744324 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 2 type 32 len 140
D, [2013-03-20T20:10:52.744468 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 144 bytes
D, [2013-03-20T20:10:52.790733 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 720 bytes
D, [2013-03-20T20:10:52.790938 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 2 type 33 len 700
D, [2013-03-20T20:10:52.795329 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 3 type 21 len 20
D, [2013-03-20T20:10:52.795447 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 24 bytes
D, [2013-03-20T20:10:52.795542 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 3 type 21 len 12
D, [2013-03-20T20:10:52.795871 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: beginning authentication of `admin'
D, [2013-03-20T20:10:52.796008 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 4 type 5 len 28
D, [2013-03-20T20:10:52.796071 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 52 bytes
D, [2013-03-20T20:10:52.944233 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 52 bytes
D, [2013-03-20T20:10:52.944626 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 4 type 6 len 28
D, [2013-03-20T20:10:52.945125 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: trying publickey
D, [2013-03-20T20:10:52.945906 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: connecting to ssh-agent
D, [2013-03-20T20:10:52.946221 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: sending agent request 1 len 51
D, [2013-03-20T20:10:52.946460 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: received agent packet 2 len 5
D, [2013-03-20T20:10:52.946578 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: sending agent request 11 len 0
D, [2013-03-20T20:10:52.946859 #2647] DEBUG -- net.ssh.authentication.agent[3fe826263a88]: received agent packet 12 len 294
D, [2013-03-20T20:10:52.947478 #2647] DEBUG -- net.ssh.authentication.methods.publickey[3fe826263fd8]: trying publickey (b7:96:23:2d:21:f3:5e:dd:ba:e9:7c:7d:f5:4c:fd:0c)
D, [2013-03-20T20:10:52.947821 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 5 type 50 len 348
D, [2013-03-20T20:10:52.947994 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 372 bytes
D, [2013-03-20T20:10:52.993286 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 52 bytes
D, [2013-03-20T20:10:52.993497 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 5 type 51 len 28
D, [2013-03-20T20:10:52.993717 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: allowed methods: publickey
D, [2013-03-20T20:10:52.993904 #2647] DEBUG -- net.ssh.authentication.methods.publickey[3fe826263fd8]: trying publickey (40:2c:20:e7:0c:f4:65:32:76:7c:39:5e:83:84:70:b2)
D, [2013-03-20T20:10:52.994095 #2647] DEBUG -- tcpsocket[3fe825c40570]: queueing packet nr 6 type 50 len 348
D, [2013-03-20T20:10:52.994202 #2647] DEBUG -- tcpsocket[3fe825c40570]: sent 372 bytes
D, [2013-03-20T20:10:53.035308 #2647] DEBUG -- tcpsocket[3fe825c40570]: read 52 bytes
D, [2013-03-20T20:10:53.035556 #2647] DEBUG -- tcpsocket[3fe825c40570]: received packet nr 6 type 51 len 28
D, [2013-03-20T20:10:53.035693 #2647] DEBUG -- net.ssh.authentication.session[3fe826273f28]: allowed methods: publickey
E, [2013-03-20T20:10:53.035782 #2647] ERROR -- net.ssh.authentication.session[3fe826273f28]: all authorization methods failed (tried publickey)
Password:
Here's my list of keys for this latest test (just the one I retrieved from the server)
Damians-MacBook-Pro:test dalef$ ssh-add -l
2048 b7:96:23:2d:21:f3:5e:dd:ba:e9:7c:7d:f5:4c:fd:0c pk (RSA)
Is there anything I'm missing? I'm this close to trying password based authentication.
Thanks!!
Update
Still trying alternatives. I've also made sure I'm using the right key by comparing against AWS key fingerprint & authorized_keys
From Amazon:
dalef 90:04:34:df:75:cc:9c:f0:90:4f:77:17:98:ee:ec:c1:95:d9:f6:14
Damians-MacBook-Pro:.ssh dalef$ ec2-fingerprint-key dalef
90:04:34:df:75:cc:9c:f0:90:4f:77:17:98:ee:ec:c1:95:d9:f6:14
Damians-MacBook-Pro:.ssh dalef$ ssh-add dalef
Identity added: dalef (dalef)
Damians-MacBook-Pro:.ssh dalef$ ssh-add -l
2048 40:2c:20:e7:0c:f4:65:32:76:7c:39:5e:83:84:70:b2 id_rsa (RSA)
2048 e6:02:1a:a4:2a:f9:63:4a:b7:de:66:60:f2:fa:0c:b4 dalef (RSA)
[ec2-user#___ .ssh]$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcfgMIAbEfNAiSgi4zXsObR1zGPHzVbff2suB/J2rLVgr5XNfLhf+kTRzTij0IWsutYj45j/eI87xC912WYtNG2An8262JwqRJZfwbnfDHMjwPQRwlDNjgGWRZwl8x9HO1V7EmBCaEEpeXg0ogbdhM386f/TTdWdUOofSqTEjuN2Nk73OHirPAj7MuWSGwGAwKCS4In2KbGAP/hk0c/PsCx52J+zjp2lteEaA9qWIovQggRw73dAqV++czMwCx2+7GMGxGx21fgSH4cYZ7Q6XxAxBkmsO7yoKZHUFj5QobSJ1TVh7N/61bFInt6Ua6btTXC7jwaATzkOBkv/rwLgtN **dalef**
Still asks for password.
Update
Something must be really wrong with my setup. I tried allowing password connections but that doesn't work either. Do I need to start thinking of a Capistrano-alternative?
Here's the log
[ec2-user#___ ~]$ sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
[ec2-user#___ ~]$ sudo passwd ec2-user
Changing password for user ec2-user.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[ec2-user#___ ~]$ exit
...
E, [2013-03-21T00:31:02.582111 #3739] ERROR -- net.ssh.authentication.session[3fd0f6e21178]: all authorization methods failed (tried password)
connection failed for: admin#___.sa-east-1.compute.amazonaws.com (Net::SSH::AuthenticationFailed: admin)
From these logs what I assume is that Capistrano is trying to login as admin. How can I change that to ec2-user? (I've tried set :user, "ec2-user" in deploy.rb)
So after a lot of reading, I found the solution. This pointed me in the right direction: https://serverfault.com/questions/55343/cant-get-ssh-public-key-authentication-to-work
The main issue was that I didn't know what I was doing. So anyway if someone is interested in the solution I came up with:
Somehow Capistrano always uses an admin user, besides the one you setup, so I created one. You can go ahead and follow these steps: http://aws.amazon.com/articles/1233
I created my own set of pub/private keys using ssh-keygen -b 1024 -f ec2admin -t dsa
I copied the ec2admin.pub file to /home/admin/.ssh in the server, by using scp
I appended the pub contents to the /home/admin/.ssh/authorized_keys file in the server
Then it really helped to read the sshd log at: /var/log/secure (YMMV)
And finally solved three faulty permissions at /home:
chmod 700 /home/.ssh
chmod 600 /home/.ssh/*
chmod 755 /home/admin
And that did the trick. I can now login without a password. Thanks for your help!

Resources