@@ -44,38 +44,45 @@ func (p *Provider) ProcessExec(app, pid, command string, rw io.ReadWriter, opts
4444 break
4545 }
4646 }
47+ log .Logf ("pidFound: %t" , pidFound )
48+ log .Logf ("pid: %s" , pid )
4749
4850 if ! pidFound {
51+ log .Error (err )
52+
4953 return - 1 , errorNotFound (fmt .Sprintf ("process id not found for %s" , app ))
5054 }
5155
5256 dc , err := p .dockerClientFromPid (pid )
5357 if err != nil {
54- return - 1 , err
58+ return - 1 , log . Error ( err )
5559 }
5660
5761 c , err := p .dockerContainerFromPid (pid )
5862 if err != nil {
59- return - 1 , err
63+ return - 1 , log . Error ( err )
6064 }
65+ log .Logf ("container: %s" , c .ID )
6166
6267 cmd := []string {"sh" , "-c" , command }
6368
6469 tty := cb (opts .Tty , true )
70+ log .Logf ("tty: %t" , tty )
6571
6672 if opts .Entrypoint != nil && * opts .Entrypoint {
6773 cmd = append (c .Config .Entrypoint , cmd ... )
6874 } else {
6975 a , err := p .AppGet (app )
7076 if err != nil {
71- return - 1 , err
77+ return - 1 , log . Error ( err )
7278 }
7379
7480 if a .Tags ["Generation" ] == "2" {
7581 cmd = append ([]string {"/convox-env" }, cmd ... )
7682 }
7783 }
7884
85+ log .Logf ("Command: %s" , commandString (cmd ))
7986 eres , err := dc .CreateExec (docker.CreateExecOptions {
8087 AttachStdin : true ,
8188 AttachStdout : true ,
@@ -93,7 +100,10 @@ func (p *Provider) ProcessExec(app, pid, command string, rw io.ReadWriter, opts
93100 go func () {
94101 <- success
95102 if opts .Height != nil && opts .Width != nil {
96- dc .ResizeExecTTY (eres .ID , * opts .Height , * opts .Width )
103+ err := dc .ResizeExecTTY (eres .ID , * opts .Height , * opts .Width )
104+ if err != nil {
105+ log .Error (err )
106+ }
97107 }
98108 success <- struct {}{}
99109 }()
@@ -104,7 +114,7 @@ func (p *Provider) ProcessExec(app, pid, command string, rw io.ReadWriter, opts
104114 InputStream : io .NopCloser (rw ),
105115 OutputStream : rw ,
106116 ErrorStream : rw ,
107- RawTerminal : true ,
117+ RawTerminal : tty ,
108118 Success : success ,
109119 })
110120
@@ -116,6 +126,7 @@ func (p *Provider) ProcessExec(app, pid, command string, rw io.ReadWriter, opts
116126 if err != nil {
117127 return - 1 , log .Error (err )
118128 }
129+ log .Logf ("ExitCode: %d" , ires .ExitCode )
119130
120131 return ires .ExitCode , log .Success ()
121132}
0 commit comments