[jira] [Created] (VFS-351) Small patch to not swallow SFTP exception from JSCH

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (VFS-351) Small patch to not swallow SFTP exception from JSCH

ASF GitHub Bot (Jira)
Small patch to not swallow SFTP exception from JSCH
----------------------------------------------------

                 Key: VFS-351
                 URL: https://issues.apache.org/jira/browse/VFS-351
             Project: Commons VFS
          Issue Type: Bug
            Reporter: John Bäckstrand
            Priority: Trivial


A customer had a stacktrace where the end of it looked something like this:

Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "***".
        at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:506)
        at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh(SftpFileObject.java:92)
        ... 27 more
Caused by: org.apache.commons.vfs2.FileSystemException: Could not change to work directory "/".
        at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:144)
        at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:152)
        at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:115)
        at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:497)


But SftpFileSystem actually got an exception from JSch that it did not set as cause for the newly created exception, making debugging harder.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Issue Comment Edited] (VFS-351) Small patch to not swallow SFTP exception from JSCH

ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/VFS-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039103#comment-13039103 ]

John Bäckstrand edited comment on VFS-351 at 5/25/11 1:06 PM:
--------------------------------------------------------------

One-line patch attached:

Index: core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
===================================================================
--- core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java (revision 1127468)
+++ core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java (working copy)
@@ -142,7 +142,7 @@
                     catch (SftpException e)
                     {
                         throw new FileSystemException("vfs.provider.sftp/change-work-directory.error",
-                            workingDirectory);
+                            workingDirectory, e);
                     }
                 }
             }

      was (Author: sandos):
    One-line patch
 

> Small patch to not swallow SFTP exception from JSCH
> ----------------------------------------------------
>
>                 Key: VFS-351
>                 URL: https://issues.apache.org/jira/browse/VFS-351
>             Project: Commons VFS
>          Issue Type: Bug
>            Reporter: John Bäckstrand
>            Priority: Trivial
>              Labels: sftp
>         Attachments: vfscdpatch.diff
>
>
> A customer had a stacktrace where the end of it looked something like this:
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "***".
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:506)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh(SftpFileObject.java:92)
>         ... 27 more
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not change to work directory "/".
>         at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:144)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:152)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:115)
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:497)
> But SftpFileSystem actually got an exception from JSch that it did not set as cause for the newly created exception, making debugging harder.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Issue Comment Edited] (VFS-351) Small patch to not swallow SFTP exception from JSCH

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/VFS-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039103#comment-13039103 ]

John Bäckstrand edited comment on VFS-351 at 5/25/11 1:07 PM:
--------------------------------------------------------------

One-line patch attached


      was (Author: sandos):
    One-line patch attached:

Index: core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
===================================================================
--- core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java (revision 1127468)
+++ core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java (working copy)
@@ -142,7 +142,7 @@
                     catch (SftpException e)
                     {
                         throw new FileSystemException("vfs.provider.sftp/change-work-directory.error",
-                            workingDirectory);
+                            workingDirectory, e);
                     }
                 }
             }
 

> Small patch to not swallow SFTP exception from JSCH
> ----------------------------------------------------
>
>                 Key: VFS-351
>                 URL: https://issues.apache.org/jira/browse/VFS-351
>             Project: Commons VFS
>          Issue Type: Bug
>            Reporter: John Bäckstrand
>            Priority: Trivial
>              Labels: sftp
>         Attachments: vfscdpatch.diff
>
>
> A customer had a stacktrace where the end of it looked something like this:
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "***".
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:506)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh(SftpFileObject.java:92)
>         ... 27 more
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not change to work directory "/".
>         at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:144)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:152)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:115)
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:497)
> But SftpFileSystem actually got an exception from JSch that it did not set as cause for the newly created exception, making debugging harder.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (VFS-351) Small patch to not swallow SFTP exception from JSCH

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/VFS-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Bäckstrand updated VFS-351:
--------------------------------

    Attachment: vfscdpatch.diff

One-line patch

> Small patch to not swallow SFTP exception from JSCH
> ----------------------------------------------------
>
>                 Key: VFS-351
>                 URL: https://issues.apache.org/jira/browse/VFS-351
>             Project: Commons VFS
>          Issue Type: Bug
>            Reporter: John Bäckstrand
>            Priority: Trivial
>              Labels: sftp
>         Attachments: vfscdpatch.diff
>
>
> A customer had a stacktrace where the end of it looked something like this:
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "***".
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:506)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh(SftpFileObject.java:92)
>         ... 27 more
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not change to work directory "/".
>         at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:144)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:152)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:115)
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:497)
> But SftpFileSystem actually got an exception from JSch that it did not set as cause for the newly created exception, making debugging harder.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (VFS-351) Small patch to not swallow SFTP exception from JSCH

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/VFS-351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039104#comment-13039104 ]

John Bäckstrand commented on VFS-351:
-------------------------------------

This might be a Jsch bug, partly, in that it does not seem to throw IOException properly, instead re-throwing everything as SftpException ?

> Small patch to not swallow SFTP exception from JSCH
> ----------------------------------------------------
>
>                 Key: VFS-351
>                 URL: https://issues.apache.org/jira/browse/VFS-351
>             Project: Commons VFS
>          Issue Type: Bug
>            Reporter: John Bäckstrand
>            Priority: Trivial
>              Labels: sftp
>         Attachments: vfscdpatch.diff
>
>
> A customer had a stacktrace where the end of it looked something like this:
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "***".
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:506)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh(SftpFileObject.java:92)
>         ... 27 more
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not change to work directory "/".
>         at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:144)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:152)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:115)
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:497)
> But SftpFileSystem actually got an exception from JSch that it did not set as cause for the newly created exception, making debugging harder.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (VFS-351) Small patch to not swallow SFTP exception from JSCH

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/VFS-351?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers resolved VFS-351.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 2.1

Patch applied. Please verify and close.

> Small patch to not swallow SFTP exception from JSCH
> ----------------------------------------------------
>
>                 Key: VFS-351
>                 URL: https://issues.apache.org/jira/browse/VFS-351
>             Project: Commons VFS
>          Issue Type: Bug
>            Reporter: John Bäckstrand
>            Priority: Trivial
>              Labels: sftp
>             Fix For: 2.1
>
>         Attachments: vfscdpatch.diff
>
>
> A customer had a stacktrace where the end of it looked something like this:
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not determine the type of file "***".
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:506)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.refresh(SftpFileObject.java:92)
>         ... 27 more
> Caused by: org.apache.commons.vfs2.FileSystemException: Could not change to work directory "/".
>         at org.apache.commons.vfs2.provider.sftp.SftpFileSystem.getChannel(SftpFileSystem.java:144)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.statSelf(SftpFileObject.java:152)
>         at org.apache.commons.vfs2.provider.sftp.SftpFileObject.doGetType(SftpFileObject.java:115)
>         at org.apache.commons.vfs2.provider.AbstractFileObject.getType(AbstractFileObject.java:497)
> But SftpFileSystem actually got an exception from JSch that it did not set as cause for the newly created exception, making debugging harder.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira