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

passwd folder changed? #184

Open
MarcelRobitaille opened this issue Jul 28, 2022 · 8 comments
Open

passwd folder changed? #184

MarcelRobitaille opened this issue Jul 28, 2022 · 8 comments

Comments

@MarcelRobitaille
Copy link

I followed the docs to create my setup and it has been running fine for months. Today, I rebooted my served (I did not update anything at all), and now it looks like pure ftp expects the password file to be in a different location. I was mounting the volume like ./ftp_passwd/:/etc/pure-ftpd/passwd. However, I was unable to log in. I connected to the container and ran giving this result:

$ pure-pw show paperless
Unable to fetch info about user [paperless] in file [/etc/pure-ftpd/pureftpd.passwd]

It was looking for the password file in a different folder. I updated my volume to just /etc/pure-ftpd/. I also had to do pure-pw mkdb. Now, I am able to log in again.

What caused this change? Is this a bug or should the documentation be updated? Again, I did not update anything (not system packages or containers). I have pinned my version stilliard/pure-ftpd:hardened-1.0.36.

Relevant docker-compose.yml

  pure_ftpd:
    image: stilliard/pure-ftpd:hardened-1.0.36
    container_name: pure-ftpd
    ports:
      - "21:21"
      - "30000-30009:30000-30009"
    volumes:
      - "./consume/data:/home/paperless/"
      - "./ftp_passwd:/etc/pure-ftpd"
    environment:
      PUBLICHOST: "localhost"
      FTP_USER_NAME: paperless
      FTP_USER_PASS: <censored>
      FTP_USER_HOME: /home/paperless
    restart: unless-stopped
@stilliard
Copy link
Owner

Hi @MarcelRobitaille
I think when calling the pure-pw commands you may need to pass the path to the db file, e.g.
-f /etc/pure-ftpd/passwd/pureftpd.passwd
Hope this helps.

@MarcelRobitaille
Copy link
Author

Hi @stilliard. Thanks for the answer. I tried that. It may work to recreate the db, but it does not fix the problem permanently for me because it is still trying to use the old password file when I try to log in with ftp localhost. That's what I think based on what I experienced, but I am by no means an expert.

@stilliard
Copy link
Owner

Weird, nothing's changed for that version as it's tagged.
I'm unable to test right now but will try to over the weekend to see if there was an issue in that version maybe or something.

@MarcelRobitaille
Copy link
Author

Yeah it's really weird. I didn't update anything or even re-pull the container. I just rebooted my computer. It was working before and broken after.

@coilock
Copy link

coilock commented Jul 29, 2022

Hi everyone. I am possibly running into the same issue, as my container was also running fine for a longer period of time. Today I realized that the server was not responding after a reboot of the host system.
The logs indicate that there is indeed a problem with the passwd file:

root@srv0:/pool0/srv/cfg/paperless# docker-compose logs ftpd
Attaching to paperless_ftpd_1
ftpd_1       | Creating user...
ftpd_1       | Password:
ftpd_1       | Error.
ftpd_1       | Check that [ftp] doesn't already exist,
ftpd_1       | and that [/etc/pure-ftpd/passwd/pureftpd.passwd.tmp] can be written.
ftpd_1       | Enter it again:
ftpd_1       | Setting default port range to: 30010-30019
ftpd_1       | Setting default max clients to: 5
ftpd_1       | Setting default max connections per ip to: 5
ftpd_1       | Starting Pure-FTPd:
ftpd_1       |   pure-ftpd  -l puredb:/etc/pure-ftpd/pureftpd.pdb -E -j -R -P 192.168.178.130   -p 30010-30019 -c 5 -C 5

@stilliard
Copy link
Owner

Hi @MarcelRobitaille & @coilock ,

I've tested today starting the latest version, stopping it and starting again using your example docker-compose.yml file.
All worked as expected and I was able to use it on first start using the paperless user as well as after a stop and restart.
My only difference is rather than using the image: stilliard/pure-ftpd:hardened-1.0.36 tag I just used the latest one: image: stilliard/pure-ftpd

The output of the 2nd start does show an error saying:

pure-ftpd    | Enter it again: Error.
pure-ftpd    | Check that [paperless] doesn't already exist,
pure-ftpd    | and that [/etc/pure-ftpd/passwd/pureftpd.passwd.tmp] can be written.

However, this is just that it's trying to create the user again on start up and as the user already exists it does not need to so it's more of a warning that the user already exists.

Hope this helps clarify that message.

@stilliard
Copy link
Owner

Also I tested by exec'ing into the server with:

docker-compose exec pure_ftpd bash

and running:

pure-pw show paperless -f /etc/pure-ftpd/passwd/pureftpd.passwd

to confirm it shows the correct details and no error.

@stilliard
Copy link
Owner

I'm not sure what paperless is btw but as you both have a user called that I assume it's some platform for running docker maybe?
Is it possible that platform has some issue with keeping the volumes?
I'd suggest testing the container directly if possible by starting it, ftping in to check it works, stopping and starting it again to check you can still ftp in.
Hope this helps.

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

3 participants