Jenkins shell behaves differently than terminal

212 views
Skip to first unread message

Rūdolfs Sviklis

unread,
Jul 18, 2017, 9:05:37 AM7/18/17
to Jenkins Users

Hello,

 

I'm trying to deploy ruby webpage from jenkins shell with command "cap production deploy", but it throws an error (works if I do it manually from terminal):

 

dep...@10.105.27.132's password:(Backtrace restricted to imported tasks) cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as dep...@10.105.27.132: Inappropriate ioctl for device
Errno::ENOTTY: Inappropriate ioctl for device

 

If I perform the command manually from the terminal it executes without a problem. I have set up public keys so that I can execute the command without any need to enter password and I also added deploy keys to project in GitLab. So if I do an ssh connection from the terminal to the production server, it doesn’t ask for a password.

 

As I searched for an answer I saw that in most cases the problem is with the deploy keys, but I have added it to the project and I can execute the command manually from the terminal, so the problem must be in Jenkins shell. It seems that it probably uses some interpretation of the terminal and not the real thing.

 

Is there a way I can fix this, so I can execute the command from Jenkins shell?

 

Best Regards,

Rudolfs Sviklis

Mark Waite

unread,
Jul 18, 2017, 10:58:24 AM7/18/17
to Jenkins Users
I suspect the problem is in your deployment script or program, rather than in Jenkins.  You could check that by attempting to perform the same deployment from a cron job.  When a job is run from cron (or from Jenkins), there is no controlling terminal which can prompt the user for information.  The ENOTTY message is often a result of programs that incorrectly expect to communicate with a TTY.

There is also a hint on stackoverflow that a 32 bit program trying to communicate with a 64 bit kernel might cause a similar error message.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/40238b71-b867-4236-b6b0-e47889c1dd5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages