Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

backup on flysystem sftp disk fails #1595

Closed
design4business opened this issue Oct 21, 2022 · 0 comments
Closed

backup on flysystem sftp disk fails #1595

design4business opened this issue Oct 21, 2022 · 0 comments

Comments

@design4business
Copy link

disk on tinker ist working as expected

Psy Shell v0.11.8 (PHP 8.1.9 — cli) by Justin Hileman

Storage::disk('backup')->exists('example.txt');
=> false

Storage::disk('backup')->put('example.txt', 'Contents');
=> true

Storage::disk('backup')->exists('example.txt');
=> true

backup:run fails with

STFP Flysystem Conf

    'backup' => [
        'driver' => 'sftp',
        'host' => env('SFTP_HOST'),

        // Settings for basic authentication...
        'username' => env('SFTP_USERNAME'),
        //'password' => env('SFTP_PASSWORD'),

        // Settings for SSH key based authentication with encryption password...
        'privateKey' => env('SFTP_PRIVATE_KEY'),
        //'passphrase' => env('SFTP_PASSPHRASE'),

        // Optional SFTP Settings...
        // 'hostFingerprint' => env('SFTP_HOST_FINGERPRINT'),
        // 'maxTries' => 4,
        // 'passphrase' => env('SFTP_PASSPHRASE'),
        // 'port' => env('SFTP_PORT', 22),
         'root' => env('SFTP_ROOT', ''),
        // 'timeout' => 30,
        // 'useAgent' => true,
    ],

Spatie Backup Disk Conf

'disks' => [
'backup',
],

Errors

Copying zip failed because: Could not connect to disk backup because: ErrorException: foreach() argument must be of type array|object, bool given in /home/thisismyuserroot/html/vendor/league/flysystem-sftp-v3/SftpAdapter.php:277
Stack trace:
#0 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(259): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /home/thisismyuserroot/html/vendor/league/flysystem-sftp-v3/SftpAdapter.php(277): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap{closure}()
#2 /home/thisismyuserroot/html/vendor/league/flysystem/src/Filesystem.php(113): League\Flysystem\PhpseclibV3\SftpAdapter->listContents()
#3 /home/thisismyuserroot/html/vendor/league/flysystem/src/DirectoryListing.php(33): League\Flysystem\Filesystem->pipeListing()
#4 [internal function]: League\Flysystem\DirectoryListing::League\Flysystem{closure}()
#5 /home/thisismyuserroot/html/vendor/league/flysystem/src/DirectoryListing.php(81): iterator_to_array()
#6 /home/thisismyuserroot/html/vendor/league/flysystem/src/DirectoryListing.php(56): League\Flysystem\DirectoryListing->toArray()
#7 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(778): League\Flysystem\DirectoryListing->sortByPath()
#8 /home/thisismyuserroot/html/vendor/spatie/laravel-backup/src/BackupDestination/BackupDestination.php(140): Illuminate\Filesystem\FilesystemAdapter->files()
#9 /home/thisismyuserroot/html/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(286): Spatie\Backup\BackupDestination\BackupDestination->isReachable()
#10 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(262): Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup{closure}()
#11 /home/thisismyuserroot/html/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(304): Illuminate\Support\Collection->each()
#12 /home/thisismyuserroot/html/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(168): Spatie\Backup\Tasks\Backup\BackupJob->copyToBackupDestinations()
#13 /home/thisismyuserroot/html/vendor/spatie/laravel-backup/src/Commands/BackupCommand.php(58): Spatie\Backup\Tasks\Backup\BackupJob->run()
#14 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Spatie\Backup\Commands\BackupCommand->handle()
#15 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}()
#16 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#17 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#18 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\Container\BoundMethod::call()
#19 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(144): Illuminate\Container\Container->call()
#20 /home/thisismyuserroot/html/vendor/symfony/console/Command/Command.php(308): Illuminate\Console\Command->execute()
#21 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(126): Symfony\Component\Console\Command\Command->run()
#22 /home/thisismyuserroot/html/vendor/spatie/laravel-backup/src/Commands/BaseCommand.php(28): Illuminate\Console\Command->run()
#23 /home/thisismyuserroot/html/vendor/symfony/console/Application.php(1002): Spatie\Backup\Commands\BaseCommand->run()
#24 /home/thisismyuserroot/html/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#25 /home/thisismyuserroot/html/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#26 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\Component\Console\Application->run()
#27 /home/thisismyuserroot/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(155): Illuminate\Console\Application->run()
#28 /home/thisismyuserroot/html/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#29 {main}

@spatie spatie locked and limited conversation to collaborators Oct 21, 2022
@freekmurze freekmurze converted this issue into discussion #1596 Oct 21, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant