Created
June 6, 2014 20:12
-
-
Save raspasov/d7e957025e434e99a819 to your computer and use it in GitHub Desktop.
Pallet Debug with SSH Auth Fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
engage-rackspace.groups.core=> (pallet.api/converge (assoc eng-web-test :count 1) :compute rs :user midverse-user) | |
12:57:02.282 [operate-21] INFO pallet.ssh.execute - 23.253.42.140 22 os: infer-os: | |
12:57:14.982 [operate-21] ERROR pallet.action-plan - Exception in execute-action-map | |
clojure.lang.ExceptionInfo: SSH connect: server 23.253.42.140 port 22 user null password null pk-path /Users/raspasov/.ssh/midverse pk null | |
at clojure.core$ex_info.invoke(core.clj:4403) ~[clojure-1.6.0.jar:na] | |
at pallet.ssh.transport$connect_ssh_session.invoke(transport.clj:117) ~[na:na] | |
at pallet.ssh.transport$attempt_connect.invoke(transport.clj:153) ~[na:na] | |
at pallet.ssh.transport$connect$fn__8485.invoke(transport.clj:172) ~[na:na] | |
at pallet.ssh.transport$connect.invoke(transport.clj:171) ~[na:na] | |
at pallet.transport.ssh$lookup_or_create_state.invoke(ssh.clj:53) ~[na:na] | |
at pallet.transport.ssh$open.invoke(ssh.clj:62) ~[na:na] | |
at pallet.transport.ssh.SshTransport.open(ssh.clj:73) ~[na:na] | |
at pallet.ssh.execute$get_connection.invoke(execute.clj:74) ~[na:na] | |
at pallet.ssh.execute$with_connection_STAR_.invoke(execute.clj:96) ~[na:na] | |
at pallet.ssh.execute$ssh_script_on_target.invoke(execute.clj:132) ~[na:na] | |
at pallet.executors$default_executor.invoke(executors.clj:60) ~[na:na] | |
at pallet.action_plan$execute_action_map.invoke(action_plan.clj:598) ~[na:na] | |
at pallet.action_plan$execute$exec_action__4952$execute_with_error_check__4953.invoke(action_plan.clj:672) [na:na] | |
at clojure.algo.monads$fn__1960$m_bind_state__1965$fn__1966.invoke(monads.clj:340) [na:na] | |
at pallet.action_plan$map_action_f.invoke(action_plan.clj:541) [na:na] | |
at pallet.action_plan$execute.invoke(action_plan.clj:675) [na:na] | |
at pallet.core.api$execute_action_plan_STAR_.invoke(api.clj:179) [na:na] | |
at pallet.core.api$eval11515$fn__11517.invoke(api.clj:199) [na:na] | |
at clojure.lang.MultiFn.invoke(MultiFn.java:269) [clojure-1.6.0.jar:na] | |
at clojure.lang.AFn.applyToHelper(AFn.java:186) [clojure-1.6.0.jar:na] | |
at clojure.lang.AFn.applyTo(AFn.java:144) [clojure-1.6.0.jar:na] | |
at clojure.core$apply.invoke(core.clj:630) [clojure-1.6.0.jar:na] | |
at clojure.core$partial$fn__4234.doInvoke(core.clj:2474) [clojure-1.6.0.jar:na] | |
at clojure.lang.RestFn.invoke(RestFn.java:397) [clojure-1.6.0.jar:na] | |
at pallet.core.primitives$async_fsm$run_async__11648$async_fsm__11650.invoke(primitives.clj:42) [na:na] | |
at pallet.algo.fsmop$report_exceptions$report_exceptions__2654.invoke(fsmop.clj:64) [na:na] | |
at clojure.lang.AFn.call(AFn.java:18) [clojure-1.6.0.jar:na] | |
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_21] | |
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_21] | |
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_21] | |
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_21] | |
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_21] | |
Caused by: com.jcraft.jsch.JSchException: Auth fail | |
at com.jcraft.jsch.Session.connect(Session.java:512) ~[jsch-0.1.50.jar:na] | |
at com.jcraft.jsch.Session.connect(Session.java:183) ~[jsch-0.1.50.jar:na] | |
at clj_ssh.ssh$connect.invoke(ssh.clj:327) ~[na:na] | |
at pallet.ssh.transport$connect_ssh_session.invoke(transport.clj:101) ~[na:na] | |
... 31 common frames omitted | |
So to fix this, I inlined the following hack in the transport.clj file in the ssh-transport-0.5.1.jar : | |
(defn attempt-connect | |
[agent endpoint authentication options] | |
;START HACK | |
(let [authentication (if (= nil (-> authentication :user :username)) | |
(assoc-in authentication [:user :username] "midverse") | |
authentication)] | |
;END HACK | |
(logging/debugf | |
"attempt-connect username: %s password: %s" | |
(-> authentication :user :username) | |
(when-let [pw (-> authentication :user :password)] | |
(string/replace pw #"." "*"))) | |
(let [ssh-session (ssh/session | |
agent | |
(:server endpoint) | |
{:username (-> authentication :user :username) | |
:strict-host-key-checking (:strict-host-key-checking | |
options :no) | |
:port (:port endpoint 22) | |
:password (-> authentication :user :password)}) | |
_ (.setDaemonThread ssh-session true) | |
_ (connect-ssh-session ssh-session endpoint authentication options) | |
sftp-channel (ssh/ssh-sftp ssh-session)] | |
(connect-sftp-channel sftp-channel endpoint authentication) | |
{:ssh-session ssh-session | |
:sftp-channel sftp-channel | |
:endpoint endpoint | |
:authentication authentication | |
:options options}) )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment