cancel
Showing results for 
Search instead for 
Did you mean: 

FTP Connection In Installed Alfresco

jbrasil
Confirmed Champ
Confirmed Champ

Hey guys,
I am not able to enable FTP within Alfresco.
I followed two documentation that I found on the Internet. However, it did not work.

http://formtektips.blogspot.com/2018/11/set-up-and-configure-ftps-with-alfresco.html

https://www.youtube.com/watch?v=ZLOub8xfH1s

See the screen prints.

imageimageimageimage

Error log in catalina.out

root@note-jbrasil:~# tail -f /opt/alfresco/tomcat/logs/catalina.out

2021-04-22 08:09:56,644 ERROR [org.alfresco.fileserver] [Sess_FTP1_192.168.100.28] Error from JLAN
java.lang.NullPointerException
at org.alfresco.jlan.ftp.FTPRequest.parseCommandLine(FTPRequest.java:124)
at org.alfresco.jlan.ftp.FTPRequest.<init>(FTPRequest.java:66)
at org.alfresco.jlan.ftp.FTPSrvSession.getNextCommand(FTPSrvSession.java:4581)
at org.alfresco.jlan.ftp.FTPSrvSession.run(FTPSrvSession.java:5047)
at java.lang.Thread.run(Thread.java:748)


Configuration in alfresco-global.properties

### FTP Server Configuration ###
ftp.enabled=true
ftp.port=2121
ftp.ipv6.enabled=false
ftp.keyStore=/root/.keystore
ftp.trustStore=/root/.truststore
ftp.keyStorePassphrase=secret
ftp.trustStorePassphrase=secret
ftp.requireSecureSession=true

# FTP server debugging
log4j.logger.org.alfresco.ftp.protocol=debug
log4j.logger.org.alfresco.ftp.server=debug

Version do Alfresco:
Community - 6.1.1 (r9d03d2fd-b168)

Am I doing something wrong?
Can you help?
With best regards,
José Roberto

8 REPLIES 8

arjunmony
Star Contributor
Star Contributor

Hi,

Are you using docker version or manual install?

Hey, I am using manual installation.
Thanks.

Hi,

Based on the configuration in your alfresco you should have the 2121 port open. Please check and confirm that first using the below command.

netstat -aon

In default the port (21) will be in open state, so let's update the global properties ftp.port value to 21 and lets see. I have tried the same in my manual install and its worked perfectly for me without any issues.

ftp.port=21
ftp.enabled=true
ftp.server.enables=true

image

Hi,
What version of Alfresco community edition are you using?
What version of your Linux?
Did you install Alfresco via shell script from the loftuxab website?
https://github.com/loftuxab/alfresco-ubuntu-install

It still didn't work 😞

root @ note-jbrasil: ~ # netstat -aon | grep -i "2121" | more

root @ note-jbrasil: / opt / alfresco / tomcat / shared / classes # netstat -aon | grep -i "2121" | more
tcp6 0 0 ::: 2121 ::: * HEAR OFF (0.00 / 0/0)
tcp6 0 0 192.168.100.28:2121 192.168.100.28:41744 TIME_WAIT timewait (55.64 / 0/0)

### FTP Server Configuration ###
ftp.port = 2121
ftp.enabled = true
ftp.server.enabled = true


root @ note-jbrasil: / home / jbrasil # tail -f /opt/alfresco/tomcat/logs/catalina.out | grep -i "ftp"

2021-04-26 14: 05: 41,363 ERROR [org.alfresco.fileserver] [Sess_FTP5_192.168.100.28] Error from JLAN
at org.alfresco.jlan.ftp.FTPRequest.parseCommandLine (FTPRequest.java:124)
at org.alfresco.jlan.ftp.FTPRequest. <init> (FTPRequest.java:66)
at org.alfresco.jlan.ftp.FTPSrvSession.getNextCommand (FTPSrvSession.java:4581)
at org.alfresco.jlan.ftp.FTPSrvSession.run (FTPSrvSession.java:5047)


Am I doing something wrong?
Thanks a lot.

I'm also using Alfresco 6.2 Manual install but windows machine. As i already said please change the port to 21 and give a try.

Hey,
I changed to port 21.
The incorrect login message is login incorrect.
I'm using the same username and password that I authenticate with Alfresco.

imageLogin incorrect

I followed the documentation on that site:

http://formtektips.blogspot.com/2018/11/set-up-and-configure-ftps-with-alfresco.html

Parameters in alfresco-global-properties:

### FTP Server Configuration ###
ftp.port=21
ftp.enabled=true
ftp.ipv6.enabled=false
ftp.keyStore=/root/.keystore
ftp.trustStore=/root/.truststore
ftp.keyStorePassphrase=secret
ftp.trustStorePassphrase=secret
ftp.requireSecureSession=true

View the logs:

root@note-jbrasil:/opt/alfresco/scripts# tail -f /opt/alfresco/tomcat/logs/catalina.out | grep -i "ftp"

2021-04-27 09:14:11,949 INFO [alfresco.ftp.server] [localhost-startStop-1] Starting server FTP ...
2021-04-27 09:14:11,950 ERROR [org.alfresco.fileserver] [FTP Server] [FTP] FTP Socket error : java.net.BindException: Permissão negada (Bind failed)
2021-04-27 09:14:11,951 ERROR [org.alfresco.fileserver] [FTP Server] Error from JLAN
at org.alfresco.jlan.ftp.FTPServer.run(FTPServer.java:554)

root@note-jbrasil:/opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes# netstat -aon | grep -i "192.168.100.28:21" | more

tcp 0 0 192.168.100.28:53866 192.168.100.28:21 TIME_WAIT timewait (37,11/0/0)
tcp 0 0 192.168.100.28:53868 192.168.100.28:21 TIME_WAIT timewait (56,13/0/0)

Am I doing something wrong?
Thanks a lot!!

stefan2
Champ on-the-rise
Champ on-the-rise

I am seeing the same issue in my ftp connection and logs.

If you look up the here mentioned nullpointer exception in class org.alfresco.jlan.ftp FTPRequest it is the variable cmdLine that is null: 

protected final void parseCommandLine(String cmdLine) {
int pos = cmdLine.indexOf(' ');

 I have tried the following but it had no effect:

* ports 21 or 2121

* add data ports (ftp.dataPortFrom=3022 ftp.dataPortTo=3052)

* active or passive mode

* disabling/enabling kerberos. 

Anyone who knows what is causing the ftprequest command to become null ?

stefan2
Champ on-the-rise
Champ on-the-rise

Finally figured this one out:

The FTP problem with the nullpointer when parsing the commandstring appeared when we upgraded java to minor version 1.8.322 . The parsing of the command is done by a UTF-8 library called ICU4J. My Alfresco 5.2 ships with an old icu4j version (2007) that contains a bug where it can not initialise because it tries to parse the java minor version into a number lesser then 256: https://stackoverflow.com/questions/64040255/invalid-version-number-version-number-may-be-negative-o...

So basically for fixing it you have two options:

* downgrade java to minor 255 or less. 

* upgrade ICU4j to version 68.1 or higher. 

I took the second solution, so far I haven t seen any incompatibilities for ICU4J version 68.2