crazy-max / docker-pure-ftpd

Pure-FTPd Docker image based on Alpine Linux with MySQL, PostgreSQL and LDAP support
MIT License
56 stars 15 forks source link

FTP Client hanging at "Retrieving directory listing..." #16

Closed mannemvamsi closed 4 years ago

mannemvamsi commented 4 years ago

Behaviour

Tried to use the postgres authentication

Steps to reproduce this issue

  1. Docker-Compose Template
    
    version: "3.2"

services: pureftpd: image: crazymax/pure-ftpd container_name: pureftpd ports:


2. data/pureftpd-pgsql.conf

PGSQLServer 192.168.1.8 PGSQLPort 5432 PGSQLUser db_username PGSQLPassword db_password PGSQLDatabase database PGSQLCrypt any PGSQLGetPW SELECT password FROM users WHERE username='\L' PGSQLDefaultUID 1003 PGSQLDefaultGID 1003 PGSQLGetDir select '/home/ftpusers/'||'\L' as Dir ;

3. Used filezilla to login

host: 192.168.1.8 (localhost) username: mannem password: password port: 2100


#### Expected behaviour

Used Filezilla to Login

1. Successful login 
2. Auto create folder with login username
3. Listing files 
4. Allow files to upload 

#### Actual behaviour
1. Login Successful
2. Directory is created 
3. unable to retrieve directory listing

Filezilla Log

Status: Disconnected from server Status: Connecting to 192.168.1.8:2100... Status: Connection established, waiting for welcome message... Status: Insecure server, it does not support FTP over TLS. Status: Logged in Status: Retrieving directory listing... Command: PWD Response: 257 "/home/ftpusers/mannem" is your current location Command: TYPE I Response: 200 TYPE is now 8-bit binary Command: PASV Response: 227 Entering Passive Mode (122,172,42,239,117,50) Command: MLSD Error: Connection timed out after 20 seconds of inactivity Error: Failed to retrieve directory listing Status: Disconnected from server


### Configuration

Docker version 19.03.6, build 369ce74a3c
docker-compose version 1.17.1, build unknown
Ubuntu 18.04
Linux machine 4.15.0-109-generic #110-Ubuntu SMP Tue Jun 23 02:39:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

### Docker info

Client: Debug Mode: false

Server: Containers: 54 Running: 2 Paused: 0 Stopped: 52 Images: 298 Server Version: 19.03.6 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: runc version: init version: Security Options: apparmor seccomp Profile: default Kernel Version: 4.15.0-109-generic Operating System: Ubuntu 18.04.4 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.687GiB Name: machine ID: 55M6:KP7S:IIDJ:ZX56:FTXK:2PQ3:FNRN:WQLY:SNMW:NLUW:ZX3Z:C5ZX Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

WARNING: No swap limit support


### Logs

Starting pureftpd ... Starting pureftpd ... done Attaching to pureftpd pureftpd | [s6-init] making user provided files available at /var/run/s6/etc...exited 0. pureftpd | [s6-init] ensuring user provided files have correct perms...exited 0. pureftpd | [fix-attrs.d] applying ownership & permissions fixes... pureftpd | [fix-attrs.d] done. pureftpd | [cont-init.d] executing container initialization scripts... pureftpd | [cont-init.d] 01-config.sh: executing... pureftpd | Setting timezone to Europe/Paris... pureftpd | Use PostgreSQL authentication method pureftpd | Waiting 45s for database to be ready... pureftpd | PostgreSQL database ready! pureftpd | Flags pureftpd | Secure: --maxclientsnumber 5 --maxclientsperip 5 --antiwarez --customerproof --dontresolve --norename --prohibitdotfilesread --prohibitdotfileswrite pureftpd | Additional: -d -d pureftpd | All: -d -d --bind 0.0.0.0,2100 --ipv4only --passiveportrange 30000:30009 --noanonymous --createhomedir --nochmod --syslogfacility ftp --forcepassiveip 122.172.42.239 --maxclientsnumber 5 --maxclientsperip 5 --antiwarez --customerproof --dontresolve --norename --prohibitdotfilesread --prohibitdotfileswrite --login pgsql:/data/pureftpd-pgsql.conf pureftpd | [cont-init.d] 01-config.sh: exited 0. pureftpd | [cont-init.d] 02-service.sh: executing... pureftpd | [cont-init.d] 02-service.sh: exited 0. pureftpd | [cont-init.d] 03-uploadscript.sh: executing... pureftpd | [cont-init.d] 03-uploadscript.sh: exited 0. pureftpd | [cont-init.d] ~-socklog: executing... pureftpd | [cont-init.d] ~-socklog: exited 0. pureftpd | [cont-init.d] done. pureftpd | [services.d] starting services pureftpd | [services.d] done. pureftpd | ftp.info: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [INFO] New connection from 192.168.1.8 pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 220-You are user number 1 of 5 allowed. pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 220-Local time is now 06:39. Server port: 2100. pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 220-This is a private system - No anonymous login pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 220 You will be disconnected after 15 minutes of inactivity. pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] Command [auth] [TLS] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 500 This security scheme is not implemented pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] Command [auth] [SSL] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 500 This security scheme is not implemented pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] Command [user] [mannem] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] 331 User mannem OK. Password required pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [DEBUG] Command [pass] [<*>] pureftpd | ftp.info: Jul 7 04:39:09 pure-ftpd: (?@192.168.1.8) [INFO] mannem is now logged in pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] 230 OK. Current directory is /home/ftpusers/mannem pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] Command [opts] [UTF8 ON] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] 504 Unknown command pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] Command [pwd] [] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] 257 "/home/ftpusers/mannem" is your current location pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] Command [type] [I] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] 200 TYPE is now 8-bit binary pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] Command [pasv] [] pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] 227 Entering Passive Mode (122,172,42,239,117,48) pureftpd | ftp.debug: Jul 7 04:39:09 pure-ftpd: (mannem@192.168.1.8) [DEBUG] Command [mlsd] []

nomandera commented 4 years ago

I would strongly suspect you have some firewall or ACL blocking access to the PASV ports, port exhaustion or some bad port mapping.

This is based solely on knowing these symptoms in general not this specific container.

mannemvamsi commented 4 years ago

Thanks for the comment, could you provide some pointers in this regard. I tried providing 100+ ports, every port is accessible. but still no luck.