Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port Connection Issue? #5

Open
griffinkelly opened this issue Feb 24, 2018 · 12 comments
Open

Port Connection Issue? #5

griffinkelly opened this issue Feb 24, 2018 · 12 comments

Comments

@griffinkelly
Copy link

When I try to connect after running the server, it will never list the directories? It'll log in, but nothing more than that.

@benpetsch
Copy link

Facing the same issue. Does relate to the active passive port configuration. I'm wondering if it's possible to disable passive ports?

@griffinkelly
Copy link
Author

I got it to work with Docker, however not really sure if it had to do with passive/active port configurations. The thing that did it for me was using a masquerade-address which is port address you're hosting your serving the docker container on.

@benpetsch
Copy link

@griffinkelly do you mind sharing some details. which steps are necessary to achieve your setup?

@griffinkelly
Copy link
Author

Dropped the ball here. Did you figure out your issue? Happy to help

@andriykohut
Copy link
Owner

👋 Sorry, I don't really have enough time to address this issue these days, but it seems like a pyftpdlib bug or misconfiguration, perhaps it's worth having a look at https://github.com/giampaolo/pyftpdlib issues and pull requests?

@cperezvinsite
Copy link

Hi, i'm having the exact same issue, i reproduce this dockerfile and just have the same behavior, but if I run it without the docker it works fine, then, i suppose, like @benpetsch said, could be a passive ports, then, i run the docker using -p 3000-3010:3000-3010 but doesn't work either.

BTW, I'm using filezilla to test it

@yingshaoxo
Copy link

yingshaoxo commented Feb 4, 2019

I got the same problem here.

I can't visit it by ftp://127.0.0.1:21.

Here's the code I have used:
docker run -it --rm -p 21:21 --name ftp akogut/docker-pyftpdlib python ftpd.py --anon

@yingshaoxo
Copy link

I got the same problem here.

I can't visit it by ftp://127.0.0.1:21.

Here's the code I have used:
docker run -it --rm -p 21:21 --name ftp akogut/docker-pyftpdlib python ftpd.py --anon

But if I open some ports for docker, it will work as expected.

Here is the right code to start docker image:
docker run -it --rm -p 21:21 -p 3000-3010:3000-3010 --name ftp akogut/docker-pyftpdlib python ftpd.py --anon

@griffinkelly
Copy link
Author

The biggest issue I've had is that the connection, either between pyftplib or docker will drop the connection after 10-15 minutes of using it. It'll reconnect then drop which leads to a frustrating experience.

@griffinkelly
Copy link
Author

Ultimately this is what I ended up using:

options = {'sendfile': False, 'certfile': None, 'settings': None, 'host_port': '0.0.0.0:10021', 'verbosity': 1, 'traceback': False, 'passive-ports': "65000", 'masquerade-address': "0.0.0.0", 'daemonize': False, 'file-access-user': None, 'no_color': False, 'timeout': 600, 'pythonpath': None, 'keyfile': None, 'pidfile': None}

I opened 10021 and 65000 rather than 21, or antoher range.

@pich4ya
Copy link

pich4ya commented Dec 9, 2022

Happy to see that other people got the same issue here.

@cllatser
Copy link

Good morning, here is another one who had the same problem. The client connected but did not list the directories. After thinking about it a lot, I solved it with host network mode. Now it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants