Backup Errors to FTP

I can’t understand how you can’t duplicate it when I can’t get away from it - almost a third of my servers have stopped backing up to FTP and we are having to do it manually - Would you like access to a machine that is failing?

Due to liability reasons we are unable to go into people’s machines without it being through a support ticket. If we ended up breaking something Sangoma is fully liable.

  • FTP Sucks
  • FTP via PHP Exponentially Sucks.

So FTP seems super simple but there are a lot of quirks and oddly some flexibility on standards. Not so long ago after having to fix a new bug every other day with FTP I went through and patched in a library that was written to make FTP suck less. Unfortunately still within the bounds of super old code the library wasn’t fully effective. If you have things set up correctly FTP passes all tests gloriously (this is the whole can’t reproduce). If there is even 1 wrench anywhere it seems to fail gloriously.

The problem is currently in it’s patchwork state even with the library it is not fault-tolerant. I have abstracted out all of the FTP communication and have it 95% finished. Unfortunately, resources are not unlimited so it is taking some time to get this back on deck to finish out. The reason I need to block out time is because with this abstraction I am trying to avoid the landmines and tripwires we currently see. There is NO perfect way to do FTP. Part of the delay with the new code is unit testing. I am trying to get as much coverage as I can to ensure the code is fully unit tested and rock solid. So the issues you are seeing should be resolved once this code gets back in. Currently there I have an internal timeline but giving an official timeline is how one shoots themselves in the foot and I don’t want to be shot in the foot.

1 Like

I know all about FTP being difficult - not to mention that is is basically Clear-Text - like I said we are switching off to SFTP so for us it will soon be a non-issue.

Perhaps take FTP out as an option so you don’t get these reports?

We appreciate all you do!

FTP love or hate is a technology that is not likely to die soon. The rewritten code actually supports sftp too so that will be nice. As backup moves forward I do want to see a shift towards S3esque cloud storage services.

I got this same error and finally solved it by changing my FTP Server settings. I changed it from specifying Windows file system to Auto and I set it to Active rather than passive. Hope that will help you.

after upgrade from 12 to 13 version (10.13.66-22) I have this same problem again:

Whoops\Exception\ErrorException: Argument 1 passed to Touki\FTP\Model\Filesystem::setMtime() must be an instance of DateTime, boolean given, called in /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/WindowsFilesystemFactory.php on line 50 and defined in file /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php on line 260
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php:260
  2. Whoops\Run->handleError() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Model/Filesystem.php:260
  3. Touki\FTP\Model\Filesystem->setMtime() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/WindowsFilesystemFactory.php:50
  4. Touki\FTP\WindowsFilesystemFactory->build() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:162
  5. Touki\FTP\Manager\FTPFilesystemManager->findOneBy() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:262
  6. Touki\FTP\Manager\FTPFilesystemManager->findDirectoryByName() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:273
  7. Touki\FTP\Manager\FTPFilesystemManager->findDirectoryByDirectory() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTP.php:148
  8. Touki\FTP\FTP->directoryExists() /var/www/html/admin/modules/backup/
  9. FreePBX\modules\Backup\Backup->store_backup() /var/www/html/admin/modules/backup/bin/backup.php:148

Backup&Restore module version is I’ve enabled EDGE option but installed version is the latest.
No changes has been made to FTP server configuration lately. This client has one more PBX which runs a backup to the same FTP server with no problem. Backup&Restore module version on this PBX is 13.0.26.

One this I could try is to do a downgrade of Backup module.
Any more suggestion ?


You can’t downgrade but you should change the file system of the backup in backup and restore to Linux.

Thanks for the fast reply.
I’m not sure I understand your suggestion. “File system of the backup”? Can you explain a little bit…

Hi, I did a rollback to versions and the oldest but I’m still unable to do a backup to FTP server. Any suggestion?
tm1000, it seems you have a solution or suggestion but I haven’t understood what you wanted to say :frowning:

Here is the solution that could work for somebody:

It didn’t worked for me, but I solved it by changing FTP server from Windows to Linux…

Having the same issue on FreePBX 14.
Backup 14.0.6

Backup Lock acquired!
Running pre-backup hooks…
Adding items…
Building manifest…
Creating backup…
Storing backup…
Whoops\Exception\ErrorException: ftp_rawlist(): php_connect_nonb() failed: Operation now in progress (115) in file /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTPWrapper.php on line 295
Stack trace:

  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTPWrapper.php:295
  2. ftp_rawlist() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTPWrapper.php:295
  3. Touki\FTP\FTPWrapper->rawlist() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:155
  4. Touki\FTP\Manager\FTPFilesystemManager->findOneBy() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:262
  5. Touki\FTP\Manager\FTPFilesystemManager->findDirectoryByName() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/Manager/FTPFilesystemManager.php:273
  6. Touki\FTP\Manager\FTPFilesystemManager->findDirectoryByDirectory() /var/www/html/admin/modules/backup/vendor/touki/ftp/lib/Touki/FTP/FTP.php:148
  7. Touki\FTP\FTP->directoryExists() /var/www/html/admin/modules/backup/
  8. FreePBX\modules\Backup\Backup->store_backup() /var/www/html/admin/modules/backup/bin/backup.php:149

EDIT: already tried upgrading to edge .10 did not help

Having same issue with FreePBX

Any fixes?