cancel
Showing results for 
Search instead for 
Did you mean: 

FTP problem

quale
Champ in-the-making
Champ in-the-making
I've installed alfresco (version 1.1.2 and 1.2.0RC2) and it works very fine.
But there is a problem using ftp connection.

When I connect using ftp, it is impossible to create a directory or uploading a file. I always get the same error: Invalid path

C:\>ftp localhost
Connesso a pgranato
220 FTP server ready
Utente (pgranatoSmiley Sadnone)): admin
331 User name okay, need password for admin
Password:
230 User logged in, proceed
ftp> dir
200 Port OK
150 File status okay, about to open data connection
226 Closing data connection
ftp> mkdir pippo
550 Invalid path pippo
ftp> put testo.txt
200 Port OK
500 Invalid path
ftp>

I'm using Windows XP and the original alfresco configuration.
I'm sure I'm making some error but I cannot find out where.
Can someone help me?

Pasquale
27 REPLIES 27

rdanner
Champ in-the-making
Champ in-the-making
Hello,

I have to report the same behaviour with my 1.2.1 alfresco linux install. I can access FTP… at least CONNECT to it with correct credentials.. but i cannot get even a root directory listing. "conexion closed" error like others reported on this thread.

Trying to immagine what could be the difference between ones who experience the problem and those who dont, i can report i changed the name of the root space. Could this harm? Could translated alfresco versions handle this differently?

I can access the files using the webclient and webdav (though not working everytime… i suspect windows is badly handling webdav drives, but the error message being "invalid folder", it could be linked with this FTP problem, isnt'it?)

brian
Champ in-the-making
Champ in-the-making
There doesn?t seem to be a resolution to this FTP problem.  But is there a hint in these comments?  …

http://www.alfresco.org/jira/browse/AR-450?page=comments

It works for me on Windows but not on Linux.  Here's what I did…

I installed Alfresco 1.2.1 on Windows XP Professional SP4 with MySQL 5.0 and set the FTP port like so…

   <config evaluator="string-compare" condition="FTP Server">
   <port>8087</port>
   </config>

This works just fine.  I can browse and upload documents logged in as the admin user.

I then installed version 1.2.1 on Ubuntu 5.10 with MySQL 5.0 and with the same configuration:

   <config evaluator="string-compare" condition="FTP Server">
   <port>8087</port>
   </config>

After restarting Alfresco, the <port> element is ignored.  netstat shows Alfresco still listening on 21.  I can connect to port 21 as the admin user but no files or folders are shown, just the root "/" as described in previous posts in this thread.

FileZilla output:
Status:   Connecting to 10.100.13.39 …
Status:   Connected with 10.100.13.39. Waiting for welcome message…
Response:   220 FTP server ready
Command:   USER admin
Response:   331 User name okay, need password for admin
Command:   PASS *****
Response:   230 User logged in, proceed
Command:   FEAT
Response:   502 Command FEAT not implemented
Command:   SYST
Response:   215 UNIX Type: Java FTP Server
Status:   Connected
Status:   Retrieving directory listing…
Command:   PWD
Response:   257 "/"
Command:   TYPE A
Response:   200 Command OK
Command:   PASV
Response:   227 Entering Passive Mode (10,100,13,39,128,58)
Command:   LIST
Response:   150 File status okay, about to open data connection
Response:   226 Closing data connection
Status:   Directory listing successful
Command:   REST 0
Response:   350 Restart OK
Status:   Retrieving directory listing…
Command:   CDUP
Response:   550 Already at root directory
Error:   Could not retrieve directory listing
Command:   REST 0
Response:   350 Restart OK

The Alfresco Log:

07:45:43,380 ERROR [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] ImageMagickContentTransformer not available: Failed to execute command: imconvert /opt/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformer_init_source_65360.gif  /opt/alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformer_init_target_65361.png
07:45:56,353 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] Checking for patches to apply …
07:45:56,568 INFO  [org.alfresco.repo.admin.patch.PatchExecuter] No patches were required.
07:45:56,656 ERROR [org.alfresco.smb.protocol] Failed to get local domain/workgroup name, using default of WORKGROUP
07:45:56,657 ERROR [org.alfresco.smb.protocol] (This may be due to firewall settings or incorrect <broadcast> setting)
07:45:56,673 ERROR [org.alfresco.smb.protocol] File server configuration error, Failed to get IP address(es) for the local server, check hosts file and/or DNS setup
org.alfresco.error.AlfrescoRuntimeException: Failed to get IP address(es) for the local server, check hosts file and/or DNS setup
   at org.alfresco.filesys.server.config.ServerConfiguration.processCIFSServerConfig(ServerConfiguration.java:855)
   at org.alfresco.filesys.server.config.ServerConfiguration.init(ServerConfiguration.java:482)



   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
07:45:56,725 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco JVM - v1.5.0_06-b05; maximum heap size 506.313MB
07:45:56,727 INFO  [org.alfresco.service.descriptor.DescriptorService] Alfresco started (Community Network): Current version 1.2.1 schema 12 - Installed version 1.2.1 schema 12

rdanner
Champ in-the-making
Champ in-the-making
Hi,

I just tried to reproduce the problem here with and without the <rootDirectory> setting. It worked ok here with WS-FTP and FileZilla FTP clients, and also using an ftp:// URL in IE6. I logged on as the admin user.

Cheers

Gary

Are you able to under any conditions create a scenario where the shares list is null?

rdanner
Champ in-the-making
Champ in-the-making
Hi,

I just tried to reproduce the problem here with and without the <rootDirectory> setting. It worked ok here with WS-FTP and FileZilla FTP clients, and also using an ftp:// URL in IE6. I logged on as the admin user.

Cheers

Gary

Well… Im a bonehead and I didnt have my CIFS shared objects in my path so they were failing to load.  I was not paying attention to the CIFS error because I knew i didnt put the SO's in the path because I didnt care about CIFS. 

One gottcha with that, when the CIFS fails to load, all the file systems fail.  I dont know if this is the intended response or not which leaves us with some options…

we can make the error message tell people that if CIFS or any of the file systems have a configuration problem, they are all down.

or we can change the init() of ServerConfiguration or some other portion of the class script to something like this


    /**
     * Initialize the configuration using the configuration service
     */
    public void init()
    {
        // check that all required properties have been set
        if (authenticationManager == null)
        {
            throw new AlfrescoRuntimeException("Property 'authenticationManager' not set");
        }
        else if (m_authenticationComponent == null)
        {
            throw new AlfrescoRuntimeException("Property 'authenticationComponent' not set");
        }
        else if (authenticationService == null)
        {
            throw new AlfrescoRuntimeException("Property 'authenticationService' not set");
        }
        else if (m_nodeService == null)
        {
            throw new AlfrescoRuntimeException("Property 'nodeService' not set");
        }
        else if (m_personService == null)
        {
            throw new AlfrescoRuntimeException("Property 'personService' not set");
        }
        else if (m_transactionService == null)
        {
            throw new AlfrescoRuntimeException("Property 'transactionService' not set");
        }
        else if (diskInterface == null)
        {
            throw new AlfrescoRuntimeException("Property 'diskInterface' not set");
        }
        else if (configService == null)
        {
            throw new AlfrescoRuntimeException("Property 'configService' not set");
        }
       
        initialised = false;

        // Create the configuration context

        ConfigLookupContext configCtx = new ConfigLookupContext(ConfigArea);

        // Set the platform type

        determinePlatformType();

        try
        {
           Config config =  null;

           try
           {
               // Process the CIFS server configuration
               config = configService.getConfig(ConfigCIFS, configCtx);
               processCIFSServerConfig(config);
           }
           catch(Throwable eCIFSConfigFailure)
           {
              // Configuration error
              // Disable the CIFS server
              setNetBIOSSMB(false);
              setTcpipSMB(false);
              setWin32NetBIOS(false);
              setSMBServerEnabled(false);

              if(eCIFSConfigFailure instanceof UnsatisfiedLinkError)
              {
                 // Error accessing the Win32NetBIOS DLL code
                 logger.error("Error accessing Win32 NetBIOS, check DLL is on the path");
              }
              else
              {
                 // configuration error
                 logger.error("Error configuring CIFS Server [" + eCIFSConfigFailure.getMessage()+"]", eCIFSConfigFailure);
              }
           }

           try
           {
              // Process the FTP server configuration
              config = configService.getConfig(ConfigFTP, configCtx);
              processFTPServerConfig(config);
           }
           catch(Throwable eFtpConfigFailure)
           {
              // Configuration error
              this.setFTPServerEnabled(false);
              logger.error("Error configuring FTP Server [" + eFtpConfigFailure.getMessage()+"]", eFtpConfigFailure);
           }
              
           // Process the security configuration
           config = configService.getConfig(ConfigSecurity, configCtx);
           processSecurityConfig(config);


          
            // Process the filesystems configuration
            config = configService.getConfig(ConfigFilesystems, configCtx);
            processFilesystemsConfig(config);

            // Successful initialisation
            initialised = true;
        }
        catch (Throwable ex)
        {
            // Configuration error
            logger.error("File server configuration error [one or more filesystems may not be functioning properly], " + ex.getMessage(), ex);
        }
    }

Using more granular try-catch's to allow individual systems to fail while the others continue attempting to load.

Everything appears to work fine, but there may be some gremlins that allowing this to continue in such a simple way may introduce (due to partial initializations)  I looked quickly and didnt see anything that presented a huge issue but I would like to go back and really check.. in the mean time ill put this in the JIRA.

rdanner
Champ in-the-making
Champ in-the-making
Now that I have got my hands in the config a little bit with the FTP it was me wondering if we should look at implementing some sort of pattern for adding additional file systems / shares.

We could have a share registrion bean where extention file systems could register to be initialized, each system would be required to provide to the registration bean its own configuration which would have a lifecycle so if it blew up it would be responsible roll anything it was doing back.. in most cases you would expent that shares wouldnt need to modify anything outside of themselves but… who knows. 

Each filesystem could be given some unique name FTP CIFS WEBDAV SVN whatever and the registry could respond to questions like.. is such and such a file system available? or commands, shut down shuch and such a file system.

This way we could provide a clean start up and stop for each share type as well as providing an extension point for others (last night I heard a pretty interesting idea from someone for a system… ill let him share the thought <G>), and  keeping one from bombing out the rest.

anyway just a thought

joshmow
Champ in-the-making
Champ in-the-making
*******
SOLVED

ALWAYS CHECK YOUR FIREWALL (IPTABLES) SETTINGS!!!

SOLVED
*******

I am running Alfresco 1.3 on Fedora Core 5.

There is already an existing FTP server on the system for file transfers, so port 21 is not available to use for Alfresco FTP services.

I am using the following file-servers.xml file and have been unable to gain FTP access on an alternate port. The port does show up in netstat -an as:


tcp        0      0 :::6621                     :::*                        LISTEN

and I am prompt for a username/password for access using a web browser (Firefox) pointing to the URL: ftp://XX.XX.XX.XX:6621/Alfresco

I have tried using the login: admin (and its associated password) to gain access to ftp://XX.XX.XX.XX:6621/Alfresco but it always hangs at Beginning FTP connection… and never goes anywhere.

I am including my file-servers.xml file to see if anyone can spot a mistake or problem in it, but I have searched the forums without an luck in resolution.

An interesting observation is that <allowAnonymous/> will let me connect using port 6621, but I end up in /guest which is not the functionality I am looking for.

Thank you in advance for any information you can provide me to resovle this problem.


<alfresco-config area="file-servers">

   <config evaluator="string-compare" condition="CIFS Server">
      <host name="${localname}_A"/>
      <comment>Alfresco CIFS Server</comment>

      <!– Set to the broadcast mask for the subnet –>
      <broadcast>255.255.255.255</broadcast>

      <!– Use Java socket based NetBIOS over TCP/IP and native SMB on linux –>

      <tcpipSMB platforms="linux,solaris,macosx"/>
      <netBIOSSMB platforms="linux,solaris,macosx"/>
      <hostAnnounce interval="5"/>

      <!– Use Win32 NetBIOS interface on Windows –>
      <Win32NetBIOS/>
      <Win32Announce interval="5"/>

<!–
      <WINS>
         <primary>1.2.3.4</primary>
         <secondary>5.6.7.8</secondary>
      </WINS>
–>
      <sessionDebug flags="Negotiate,Socket"/>
   </config>

   <config evaluator="string-compare" condition="FTP Server">
      <port>6621</port>
<!–
      <allowAnonymous/>
      <rootDirectory>/Alfresco</rootDirectory>
      <debug flags="File,Search,Error,Directory,Info,DataPort"/>
–>
   </config>

   <config evaluator="string-compare" condition="Filesystems">
          <filesystems>
         <filesystem name="Alfresco">
            <store>workspace://SpacesStore</store>
            <rootPath>/app:company_home</rootPath>

                        <!– Add a URL file to each folder that links back to th
e web client –>
                        <urlFile>
               <filename>__AlfrescoClient.url</filename>
               <webpath>http://localhost:8080/alfresco/</webpath>
            </urlFile>

                        <!– Mark locked files as offline –>
                    <offlineFiles/>

                        <!– Client side drag and drop application for check in/
out via CIFS –>
<!–
            <dragAndDrop>
               <filename>__Alfresco.exe</filename>
               <path>alfresco/desktop/Alfresco.exe</path>
            </dragAndDrop>
–>

<!–
            <accessControl default="Write">
               <user name="admin" access="Write"/>
               <address subnet="90.1.0.0" mask="255.255.0.0" access="Write"/>
            </accessControl>
–>
         </filesystem>
      </filesystems>
   </config>

   <config evaluator="string-compare" condition="Filesystem Security">
      <authenticator type="alfresco">
      </authenticator>

<!–
      <globalAccessControl default="None">
         <user name="admin" access="Write"/>
         <address ip="90.1.0.90" access="Write"/>
      </globalAccessControl>

      <users>
         <localuser name="user">
            <password>user</password>
            <comment>Normal user account</comment>
         </localuser>

         <localuser name="administrator">
            <password>admin</password>
            <administrator/>
            <comment>Administrator account</comment>
         </localuser>
      </users>
–>
   </config>


</alfresco-config>

romschn
Star Collaborator
Star Collaborator
You can specify the default directory, to be displayed to the user when he logs in through FTP, in file-servers-context.xml.

Search for the bean ftpServerConfig in file-servers-context.xml and put an entry as shown in the example below :
<property name="rootDirectory">
<value>/Alfresco/Test</value>
</property>
The first part of the path should be the file system name, optionally followed by one or more folder names.

It will navigate the user to the specified folder.

Hope this helps

Thanks,

chrmcq
Champ in-the-making
Champ in-the-making
Does anyone have a solution for this problem? I have same issue with community 4.d. FTP logs are uninformative. Strace of the process shows nothing useful. Cannot put files from FTP client, but can create folders - can anyone advise?