Strange FTP absolute and relative path errors
-
Hi folks,
I’m having a serious issue with WordPress and FTP which I’m really struggling to resolve. I would greatly appreciate some help, because this is a deal-breaker for me moving my hosting to Vultr from DigitalOcean (all of whose IP addresses are blacklisted).
I have built a new WP install on a new machine (a VM from Vultr) and moved a site from a Digital Ocean machine. However, FTP within WP consistently fails, and I really can’t figure out why. It seems to be to do with the path WP is asking FTP to change to.
Details:
Both machines are running WP 6.0.3
DO Machine:
Ubuntu 16.04.7 LTS
kernel: 4.4.0-210-generic
vsftpd: version 3.0.3
apache: 2.4.18 (Ubuntu)
php: 7.0.33-0ubuntu0.16.04.16Vultr machine:
Ubuntu 20.04.5 LTS
kernel: 5.4.0-131-generic
vsftpd: version 3.0.3
apache: 2.4.41-4ubuntu3.12
php: 7.4.3I’ve checked the vsftpd config on both machines, and it’s identical.
wp-config.php has no clever stuff in it, but on the Vultr machine I have tried defining WP_CONTENT_DIR, WP_PLUGIN_DIR, FTP_BASE, FTP_CONTENT_DIR and FTP_PLUGIN_DIR in all combinations of absolute and relative paths and it’s made not a scrap of difference.
Each machine is built from a script whereby the users have a path of /var/www/USER/www for their WP installation, and their $HOME in /etc/passwd is /var/www/USER. Apache is set up accordingly and works fine on both machines.
Permissions are the usual WP permissions, and identical on each machine.
What is happening is that all works as expected on the DO machine, but FTP fails on the Vultr machine in 2 ways. Firstly, if I try to update the language files if just hangs. If I try to delete a plugin I get the message “Unable to locate WordPress plugin directory.” If I try and add one, I get the message “Installation failed: Unable to locate WordPress plugin directory.”
First off though, “normal” FTP via, say Filezilla, works perfectly well on each machine, as does command line FTP. Within FTP, users are chrooted to their home directory.
Looking at the FTP logs gives the following story during an FTP update on WP:
DO machine displays some CWD errors but gets on with it eventually. The Vultr machine just fails:
DO log (edited for brevity). Firstly it tries the absolute path, then later it uses the correct path and all succeeds:
CONNECT: Client “127.0.0.1”
FTP response: Client “127.0.0.1”, “220 Welcome to the XXX.convergent-ict.com FTP service.”
FTP command: Client “127.0.0.1”, “USER ****”
FTP response: Client “127.0.0.1”, “331 Please specify the password.”
FTP command: Client “127.0.0.1”, “PASS <password>”
OK LOGIN: Client “127.0.0.1”
FTP response: Client “127.0.0.1”, “230 Login successful.”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (127,0,0,1,156,153).”
FTP command: Client “127.0.0.1”, “TYPE A”
FTP response: Client “127.0.0.1”, “200 Switching to ASCII mode.”
FTP command: Client “127.0.0.1”, “NLST /var/www/USER/www/wp-content”
FTP response: Client “127.0.0.1”, “150 Here comes the directory listing.”
FTP response: Client “127.0.0.1”, “226 Transfer done (but failed to open directory).”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /var/www/USER/www/wp-content/”
FTP response: Client “127.0.0.1”, “550 Failed to change directory.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (127,0,0,1,156,131).”
FTP command: Client “127.0.0.1”, “NLST /”
FTP response: Client “127.0.0.1”, “150 Here comes the directory listing.”
FTP response: Client “127.0.0.1”, “226 Directory send OK.”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (127,0,0,1,156,152).”
FTP command: Client “127.0.0.1”, “LIST -a”
FTP response: Client “127.0.0.1”, “150 Here comes the directory listing.”
FTP response: Client “127.0.0.1”, “226 Directory send OK.”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “SYST”
FTP response: Client “127.0.0.1”, “215 UNIX Type: L8”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (127,0,0,1,156,68).”
FTP command: Client “127.0.0.1”, “NLST /www/”
FTP response: Client “127.0.0.1”, “150 Here comes the directory listing.”
FTP response: Client “127.0.0.1”, “226 Directory send OK.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /www/”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/www” is the current directory”
and so on…Vultr (this is the whole log for attempting to remove a plugin). Firstly, again, it goes for the absolute path but fails and dies:
CONNECT: Client “127.0.0.1”
FTP response: Client “127.0.0.1”, “220 Welcome to XXX.convergent-ict.com”
FTP command: Client “127.0.0.1”, “USER ****”
FTP response: Client “127.0.0.1”, “331 Please specify the password.”
FTP command: Client “127.0.0.1”, “PASS <password>”
OK LOGIN: Client “127.0.0.1”
FTP response: Client “127.0.0.1”, “230 Login successful.”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (*,156,102).”
FTP command: Client “127.0.0.1”, “QUIT”
FTP response: Client “127.0.0.1”, “221 Goodbye.”
CONNECT: Client “127.0.0.1”
FTP response: Client “127.0.0.1”, “220 Welcome to XXX.convergent-ict.com”
FTP command: Client “127.0.0.1”, “USER ****”
FTP response: Client “127.0.0.1”, “331 Please specify the password.”
FTP command: Client “127.0.0.1”, “PASS <password>”
OK LOGIN: Client “127.0.0.1”
FTP response: Client “127.0.0.1”, “230 Login successful.”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (*,156,105).”
FTP command: Client “127.0.0.1”, “TYPE A”
FTP response: Client “127.0.0.1”, “200 Switching to ASCII mode.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /var/www/USER/www/wp-content/plugins/”
FTP response: Client “127.0.0.1”, “550 Failed to change directory.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (*,156,141).”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PWD”
FTP response: Client “127.0.0.1”, “257 “/” is the current directory”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “PASV”
FTP response: Client “127.0.0.1”, “227 Entering Passive Mode (*,156,96).”
FTP command: Client “127.0.0.1”, “CWD /”
FTP response: Client “127.0.0.1”, “250 Directory successfully changed.”
FTP command: Client “127.0.0.1”, “QUIT”
FTP response: Client “127.0.0.1”, “221 Goodbye.”Thanks in advance for any help, which will be very greatly received.
Cheers, Laurie.
—
[signature moderated]
The topic ‘Strange FTP absolute and relative path errors’ is closed to new replies.