This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 218883 - Exception opening ssh
Summary: Exception opening ssh
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-24 08:10 UTC by akobberup
Modified: 2012-11-23 08:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description akobberup 2012-09-24 08:10:46 UTC
When trying to open a ssh connection, the new tab in the terminal window is removed quickly and the folowing exception is written in the IDE log:


INFO [nativeexecution.support.logger]: [6239737 ms.] Error Uploading C:\Program Files\NetBeans Dev 201209220001\ide\bin\nativeexecution\Linux-x86\pty to xxx@test01.xxxx.xx:22:/var/tmp/dlight_root/d39770ea/pty
4: Failure
	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2491)
	at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:528)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:422)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:323)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.put(SftpSupport.java:422)
Caused: org.netbeans.modules.nativeexecution.api.util.FileInfoProvider$SftpIOException: Failure
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport.decorateSftpException(SftpSupport.java:207)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport.access$500(SftpSupport.java:91)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.put(SftpSupport.java:430)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.work(SftpSupport.java:390)
[catch] at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:293)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:272)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
INFO [nativeexecution.support.logger]: [6239739 ms.] Error occurred: Unable to upload pty to xxx@test01.xxxx.xx
java.io.IOException: Unable to upload pty to xxx@test01.xxxx.xx
	at org.netbeans.modules.nativeexecution.api.util.HelperUtility.getPath(HelperUtility.java:108)
	at org.netbeans.modules.nativeexecution.PtyNativeProcess.create(PtyNativeProcess.java:143)
[catch] at org.netbeans.modules.nativeexecution.AbstractNativeProcess.createAndStart(AbstractNativeProcess.java:135)
	at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:238)
	at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1.call(NativeExecutionService.java:193)
	at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1.call(NativeExecutionService.java:160)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService$2.run(NativeTaskExecutorService.java:82)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
4: Failure
	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2491)
	at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:528)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:422)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:323)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.put(SftpSupport.java:422)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.work(SftpSupport.java:390)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:293)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:272)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Comment 1 Andrew Krasny 2012-10-25 06:06:34 UTC
akobberup@netbeans.org,

do you get this error with every host or others work fine?
Could you, please, provide information about the IDE you use (help/about)
It would be also helpful to know that OS is on the remote system (which linux distributive)

Could you login to the remote host and look at the path /var/tmp/dlight_root/d39770ea/pty. Could it be that some directories are not writable?

Thanks, 
=Andrew
Comment 2 akobberup 2012-10-25 06:30:41 UTC
I get the error on two of our 6 environments.
I can log in just fine with cygwin  - just using ssh user@environment work fine.

The box i connect to is running centos - i do not know the version.

I do not think it is a userright problem, as i login as root, and the folder looks like this:

[root@staging ~]# ll /var/tmp/dlight_root/d39770ea/
total 16
-rwxr-xr-x 1 root root 9988 Apr 13  2012 pty

I were at the time of posting this bug using build 201209220001, and now using build 201210150002 i still get the error:

WARNING [org.netbeans.TopSecurityManager]: use of system property netbeans.user has been obsoleted in favor of InstalledFileLocator/Places at org.netbeans.modules.nativeexecution.support.hostinfo.impl.HostInfoFactory.getNBKey(HostInfoFactory.java:411)
INFO [nativeexecution.support.logger]: [13540 ms.] Error Uploading C:\Program Files\NetBeans Dev 201210150002\ide\bin\nativeexecution\Linux-x86\pty to <user>@<env>.<comp>.local:22:/var/tmp/dlight_root/d39770ea/pty
4: Failure
	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2491)
	at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:528)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:422)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:323)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.put(SftpSupport.java:422)
Caused: org.netbeans.modules.nativeexecution.api.util.FileInfoProvider$SftpIOException: Failure
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport.decorateSftpException(SftpSupport.java:207)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport.access$500(SftpSupport.java:91)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.put(SftpSupport.java:430)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.work(SftpSupport.java:390)
[catch] at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:293)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:272)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
INFO [nativeexecution.support.logger]: [13550 ms.] Error occurred: Unable to upload pty to <user>@<env>.<comp>.local
java.io.IOException: Unable to upload pty to <user>@<env>.<comp>.local
	at org.netbeans.modules.nativeexecution.api.util.HelperUtility.getPath(HelperUtility.java:108)
	at org.netbeans.modules.nativeexecution.PtyNativeProcess.create(PtyNativeProcess.java:135)
[catch] at org.netbeans.modules.nativeexecution.AbstractNativeProcess.createAndStart(AbstractNativeProcess.java:153)
	at org.netbeans.modules.nativeexecution.api.NativeProcessBuilder.call(NativeProcessBuilder.java:270)
	at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1.call(NativeExecutionService.java:193)
	at org.netbeans.modules.nativeexecution.api.execution.NativeExecutionService$1.call(NativeExecutionService.java:160)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.netbeans.modules.nativeexecution.support.NativeTaskExecutorService$2.run(NativeTaskExecutorService.java:82)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
4: Failure
	at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2491)
	at com.jcraft.jsch.ChannelSftp._put(ChannelSftp.java:528)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:422)
	at com.jcraft.jsch.ChannelSftp.put(ChannelSftp.java:323)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.put(SftpSupport.java:422)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.work(SftpSupport.java:390)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:293)
	at org.netbeans.modules.nativeexecution.api.util.SftpSupport$Uploader.call(SftpSupport.java:272)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2036)
Comment 3 Andrew Krasny 2012-10-25 11:09:54 UTC
There is a bug in jsch - if there is some output produced in your startup shell scripts then it's sfpt channel (which is used in this case) get broken..
Could it be your case? When you ssh to a host from cygwin is there any output (apart the shell prompt)?
Comment 4 akobberup 2012-10-25 11:16:09 UTC
No there is no output when i log in using cygwin..

$ ssh root@staging.xx.dk
Enter passphrase for key '/home/Anders/.ssh/id_rsa':
Last login: Thu Oct 25 08:07:03 2012 from 192.168.100.196
[root@staging ~]#


The centos version on that box by the way is 5.6

This has been working just fine in the versions before 201209220001, and i cant think of anything we have changed in our setup in the meantime..
Comment 5 Andrew Krasny 2012-10-25 15:24:22 UTC
This is interesting. Thank you - I'll take a look at what was changed since those days.
Comment 6 Andrew Krasny 2012-10-27 19:47:16 UTC
akobberup@netbeans.org,

looks like one of the possible reason for this could be that existent remote file (pty) cannot be overwritten because is used by some process (could be some hung/left process from previous sessions)... 

Could you, please, ssh to the remote machine and remove /var/tmp/dlight_root/d39770ea directory (or even whole /var/tmp/dlight_root) and then try NB once again?


Thanks in advance,
=Andrew
Comment 7 akobberup 2012-11-02 07:02:54 UTC
Hi again.

I can no longer reproduce the issue in build 201210280001 or 201211010001. 
I suspect that if the file has been locked, it is now somehow unlocked, as it has just been changed when i just logged in:

# ll /var/tmp/dlight_root/
drwxr-xr-x 2 root root 4096 Nov  2 07:47 d39770ea

# ll /var/tmp/dlight_root/d39770ea/
total 32
-rw------- 1 root root   452 Nov  2 07:53 env
-rwx------ 1 root root 18404 Nov  2 07:53 pty


Is there anything else i can do to shed light on this, or should we just close the issue?

No matter what, thank you for your time!

/Anders Kobberup
Comment 8 Andrew Krasny 2012-11-23 08:45:41 UTC
Anders, 

I think that now we can safely close this issue. There were some additional changes made to prevent other possible problems with pty upload... 

Thank you for your help!
=Andrew
Comment 9 akobberup 2012-11-23 08:53:23 UTC
Yes, i agree. Thanks for the fixes :)