11 Replies Latest reply: Sep 27, 2011 10:33 AM by Laurel Zimmer RSS

    Problems with sample.basicftp

    Snap-OM Community Member

      Hi,

       

      I have just tested the samples from the Drive SDK.

      The 'HelloWorld' example works fine.

       

      I have then tested the 'sample.basicftp' and even I can connect to the FTP-Server no files or directories were listed.

      I also can't write on the FTP-Drive, because it is write protected.

      I have activated the debug messages in 'log4j.xml'.

       

      This is a snippet from the output of the log:

       

       

       

      ConnectHandler - -->In()   

      FtpClientHelper - connecting server: xxx.xxx.152.179 

      FtpClientHelper - connected   

      ConnectHandler - -->Out()   

      GetVolumeIconHandler - -->In()   

      GetVolumeIconHandler - -->Out()   

      GetConnectionDetailsHandler - -->In()   

      GetConnectionDetailsHandler - -->Out()   

      GetAssetsHandler - -->In()    

      GetAssetsHandler - -->In()    

      GetAssetsHandler - (assetId:null | parentId:/ | assetPath:/Contents)

      GetAssetsHandler - (assetId:null | parentId:/ | assetPath:/mach_kernel)

      GetAssetsHandler - Attempting to determine asset type: /Contents

      GetAssetsHandler - Attempting to determine asset type: /mach_kernel

      GetAssetsHandler - Asset not found

      GetAssetsHandler - -->Out()

      GetAssetsHandler - Asset not found

      GetAssetsHandler - -->Out()

      GetAssetsHandler - -->In()

      GetAssetsHandler - (assetId:null | parentId:/ | assetPath:/autoexec.bat)


      .....


      GetChildrenHandler - (assetId:/ | parentId:null | assetPath:/)

      GetChildrenHandler - -->Out()    

      GetAssetsHandler - -->In()    

      GetAssetsHandler - (assetId:null | parentId:/ | assetPath:/.TemporaryItems)

      GetAssetsHandler - -->Out()   

      GetAssetsHandler - -->In()   

      GetAssetsHandler - (assetId:null | parentId:/ | assetPath:/.Trashes)

      GetAssetsHandler - -->Out()   

      DisconnectHandler - -->In()   

      FtpClientHelper - disconnected server: xxx.xxx.152.179 

      DisconnectHandler - -->Out()  

       

       

       

       

       

      I wonder about the asset names 'Contents', 'mach_kernel', 'autoexec.bat' and so on.

      There are no files or directories on the remote or local system with these names.

       

      So my questions is:

      Is there an error in the sample, or is it me doing something wrong?

        • 1. Re: Problems with sample.basicftp
          Zhiqiang Liu Adobe Employee

          Hello,

           

          From the log, the platform you testing basicftp connector is Mac OS X, right?  Could you tell me your FTP server type, like IIS, Mac FTP server or Filezilla? Can you try to use a ftp client to connect your ftp server with your account?

           

           

          Thanks,

          Zhiqiang

          • 2. Re: Problems with sample.basicftp
            Snap-OM Community Member

            Hello,

             

            we are using pure-ftp on our own ftp server.

            But I also tested it with some other ftp servers (don't know which server type they are) with the same results.

            I have no problems to connect with other ftp clients (Cyberduck, OS X built in ftp client).

             

            My platform is Mac OS X 10.6.7.

             

             

            I have added some additional debug to the function 'GetConnectionDetailsHandler'.

            As I understand, the function sets the ftp server hostname and address.

             

             

            public void execute(IProgressMonitor monitor,

            GetConnectionDetailsRequest request, GetConnectionDetailsResponse response)

            throws RemoteHandlerException

            {

                 LOGGER.debug("-->In()");

                 FtpService service = this.getFtpService();


                 try

                 {

                      .......

             

             

                      LOGGER.debug(service.getHostName().toString());

                      LOGGER.debug(service.getHostAddress().toString());

                 }

             

             

             

            DEBUG ConnectHandler - -->In()

            DEBUG FtpClientHelper - connecting server: xxx.xxx.152.179

            DEBUG FtpClientHelper - connected

            DEBUG ConnectHandler - -->Out()

            DEBUG GetVolumeIconHandler - -->In()

            DEBUG GetVolumeIconHandler - -->Out()

            DEBUG GetConnectionDetailsHandler - -->In()

            DEBUG GetConnectionDetailsHandler - 192.168.30.208

            DEBUG GetConnectionDetailsHandler - 192.168.30.208

            DEBUG GetConnectionDetailsHandler - -->Out()

             

             

             

            I wonder why 'service.getHostAddress()' returns my local IP Address.

            That can't be right.

            • 3. Re: Problems with sample.basicftp
              Snap-OM Community Member

              Hello,

               

              as I wrote in my last post, I wonder about the local IP address.

              Therefore I started my local FTP server on my Mac.

               

              When I connect to my local FTP server everything seems to be alright.

              It is just a little bit unstabel because it hangs up my finder two times.

               

              So, could it be that you mixed up client - server in your sample?

              Maybe you have also developed and tested the sample in a local scenario?

              • 4. Re: Problems with sample.basicftp
                Lee Hui

                If the directory that user tries to access has no list priviledge, Adobe Drive will show empty directory, and it's correct.  Therefore, you need to check your pure ftp server configuration firstly, then remove your basicftp server in 'Recent Connections' Panel and reconnect it again.

                For the issue that service.getHostAddress() returns your local IP Address, you can edit /etc/hosts file, replacing your local address with the actual network address.

                As you mentioned that everything seems to be right when you connect to your local FTP server but failed when you connect to your remote FTP server, I tried to set up a pure ftp server on a machine and use Adobe Drive to connect it on another machine, it works well. Maybe you should check your network configuration firstly.

                Additionally, we can investigate your problem if  you can provide your pure ftp server connection info to us.

                • 5. Re: Problems with sample.basicftp
                  Snap-OM Community Member

                  Hi,

                  I made some further tests. I can connect to another Mac (tnftpd) here in our office.

                  But I have no chance to connect to our pure-ftp server even having full read/write access to the home directory.

                   

                  Here is a snippet from the pure-ftp server log:

                   

                  May  3 11:32:42 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] New connection from xxx.xxx.152.190
                  May  3 11:32:42 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] Logout.
                  May  3 11:32:42 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] New connection from xxx.xxx.152.190
                  May  3 11:32:42 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] olaf is now logged in
                  May  3 11:32:48 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] New connection from xxx.xxx.152.190
                  May  3 11:32:48 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] Logout.
                  May  3 11:32:49 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] New connection from xxx.xxx.152.190
                  May  3 11:32:49 ftp1 pure-ftpd: (?@xxx.xxx.152.190) [INFO] Logout.
                  .......

                   

                  It seems that drive always sends logout commands to the pure-ftp server.

                   

                  If you want to investigate it with our account, please send me your eMail address and i will give you my account informations.
                  • 6. Re: Problems with sample.basicftp
                    Lee Hui Community Member

                    Adobe Drive will ping server periodically, you can refer to SDK API: ICheckServerOnlineStatusHandler. Therefore, I think your log is reasonable.

                     

                    My email address is 'huli@adobe.com'.

                    • 7. Re: Problems with sample.basicftp
                      Lee Hui Community Member

                      Hi Snap-OM,

                       

                      I used FileZilla ftp client to connect your ftp server, and it showed empty directory which was the same as Adobe Drive's result. Then I used ftp command 'ls' to list the names of the files under the root directory, the console printed '425 Could not open data connection to port 36795: Connection refused'(I had closed my firewall). From this message, I think that you need to open a range of ports in your ftp server's firewall so that client can access ftp contents successfully.

                       

                      Thanks,

                      Hui

                      • 8. Re: Problems with sample.basicftp
                        Snap-OM Community Member

                        Hi,

                         

                        I deleted every file on the ftp account especially for your testing. Thats the reason why you have seen an empty directory.
                        Your error message only comes up when you use 'active' ftp, but we only allow passive ftp as I guess almost all ISP's.

                         

                        So it seems that your sample uses 'active' ftp. Is that right?
                        • 9. Re: Problems with sample.basicftp
                          Lee Hui Community Member

                          Hi,

                           

                          Thank you for your info. Currently,  basicftp sample uses 'active' mode. After changing the mode to passive, Adobe Drive can browse your ftp server's contents.

                           

                          Thanks,

                          Hui

                          • 10. Re: Problems with sample.basicftp
                            Lee Hui Community Member

                            We'll ship a new version of the sample with the next release of the SDK.

                            • 11. Re: Problems with sample.basicftp
                              Laurel Zimmer Adobe Employee

                              We plan to update this sample with the next release of the Adobe Drive SDK.