-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Remote FTP Cleanup throwing Exception #261
Comments
The only time ftp_chdir($connection, ''); This should not be necessary, so you can try to put a It should look like this. /**
* Deletes the file.
*
* @throws \phpbu\App\Exception
*/
public function unlink()
{
try {
//$this->ftpClient->chHome();
$this->ftpClient->delete($this->pathname);
} catch (\Exception $e) {
throw new Exception($e->getMessage());
}
} If this change will fix the issue I will make some further tests on my end and remove the |
Unfortunately this does not fix the issue. The error persists. If I can be of any use to squash this bug, I'm all hands on deck :) |
Are you using any dynamic path elements like /backups/%Y/%m/ or something similar? |
Firstly, I really want to thank you for looking into this. I've been racking my brain with it for days. My paths are all static. I've confirmed so far that it's a windows problem because with a linux stack it works fine. Let me know if you need me to run any tests that you can think of! |
No worries, happy to help if I can. |
On the Linux side where the FTP Server is, I've no idea what they're running because it's out of my control. I don't think it matters anyway. On the Windows side, I have PHP 7.4.9 installed. |
Just to get this right. Is that what happens? |
Exactly. |
I've got the same problem when using phpbu on Windows 10 (PHP 7.2.31). To see if i could figure out what's going on I wrote a small test-script that only connects to a ftp-server and then calls ftp_chdir('') - and it will always throw the exact same warning - which kinda make sense as the function expects a directory-name and an empty string is not really a valid directory-name (at least I couldn't find anything about calling CWD with an empty string to get to the home-directory). I guess one way to fix it would be calling ftp_pwd after connecting to the remote server, store whatever path it returns as the home-directory and later use that stored value if chHome() is called. Edit: I also tested it on a shared webhosting server running PHP 7.2.33 on Linux and it throws the same error. So it's not a windows/linux issue. |
hello, same problem, tried from windows 10 (php 7.3 phpbu 6.0.14) to windows 2008 Gene6 FTP server, and from linux (php 7.0 with phpbu 5.2.10) to same FTP server error message from phpbu is the same Exception 'phpbu\App\Backup\Sync\Exception' with message '' I could debug from server side log, I see in the case of windows phpbu 6.0.14 after the STOR (command ran ok), the command MLSD to retrieve the remote list of files (as I understand) from my configured remote folder diablo2.test, but return 550 and for linux case I see the command NLST but seems no cleaner are done, as I configured amount:3 (type:quantity) and on the server there are more files present |
I update the FTP implementation as @chland suggested. I now store the home directory on the initial connect and if The |
Hello,
I'm using the remote FTP cleanup option as such
and I'm getting the following error
Exception 'phpbu\App\Backup\Sync\Exception' with message 'ftp_chdir(): Invalid number of parameters' in C:\Users\Sotiris\AppData\Roaming\Composer\vendor\phpbu\phpbu\src\Backup\Sync\Ftp.php:103
As you can see I'm using PHPBU on Windows but the FTP server is on Linux.
The files get uploaded just fine. It's just the remote cleanup that doesn't work.
Any thoughts?
The text was updated successfully, but these errors were encountered: