thephpleague / flysystem-dropbox

Flysystem Adapter for Dropbox [ABANDONED] replacement: https://packagist.org/packages/spatie/flysystem-dropbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

301 Moved Permanently bug on dropbox

wingsergey opened this issue · comments

From yesterday I started receive such errors while using dropbox bundle.

Unexpected HTTP status 301
<a href="/1/metadata/auto/savemart_dev/savemart_stock_2016-04-22_14-09-23.zip?locale=&amp;list=false">Moved Permanently</a>.

Trace log that I can provide:
#0 xxx\vendor\dropbox\dropbox-sdk\lib\Dropbox\Client.php(789): Dropbox\RequestUtil::unexpectedStatus(Object(Dropbox\HttpResponse))
#1 xxx\vendor\dropbox\dropbox-sdk\lib\Dropbox\Client.php(745): Dropbox\Client->getMetadata('//savemart_dev/...', Array)
#2 xxx\vendor\league\flysystem-dropbox\src\DropboxAdapter.php(191): Dropbox\Client->getMetadata('//savemart_dev/...')
#3 xxx\vendor\league\flysystem-dropbox\src\DropboxAdapter.php(47): League\Flysystem\Dropbox\DropboxAdapter->getMetadata('savemart_stock
...')
#4 xxx\vendor\league\flysystem\src\Filesystem.php(54): League\Flysystem\Dropbox\DropboxAdapter->has('savemart_stock_...')
#5 xxx\vendor\league\flysystem\src\Filesystem.php(394): League\Flysystem\Filesystem->has('savemart_stock_...')
#6 xxx\vendor\league\flysystem\src\Filesystem.php(63): League\Flysystem\Filesystem->assertAbsent('savemart_stock_...')
#7 xxx\src\Valpio\CloudBackupBundle\Client\FlysystemClient.php(33): League\Flysystem\Filesystem->write('savemart_stock_...', 'PK\x03\x04\x14\x00\x00\x00\x00\x00\xA9~\x96H\x00...')
#8 xxx\src\Valpio\CloudBackupBundle\Manager\ClientManager.php(63): Valpio\CloudBackupBundle\Client\FlysystemClient->upload('D:\Projects\Fre...')
#9 xxx\src\Valpio\CloudBackupBundle\Manager\BackupManager.php(71): Valpio\CloudBackupBundle\Manager\ClientManager->upload(Array)
#10 xxx\src\Valpio\CloudBackupBundle\Command\BackupCommand.php(36): Valpio\CloudBackupBundle\Manager\BackupManager->execute()
#11 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php(259): Valpio\CloudBackupBundle\Command\BackupCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(860): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(Valpio\CloudBackupBundle\Command\BackupCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 xxx\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php(92): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(123): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 xxx\app\console(17): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#17 {main}

Can you please check on your side if all is ok? I am not sure what is wrong. Code was not chenged several days.

Using php 5.4.x

@wingsergey the code on this end didn't change either. Perhaps there was an API change?

@wingsergey I've added tests and a fix for this particular situation, I've pushed a new version 1.0.3. If you update the package it should be fixed now.

@frankdejonge Works, thank you.

@frankdejonge
got same error in other place
#0 xxx\vendor\dropbox\dropbox-sdk\lib\Dropbox\Client.php(789): Dropbox\RequestUtil::unexpectedStatus(Object(Dropbox\HttpResponse))
#1 xxx\vendor\dropbox\dropbox-sdk\lib\Dropbox\Client.php(773): Dropbox\Client->_getMetadata('//savemart_dev', Array)
#2 xxx\vendor\league\flysystem-dropbox\src\DropboxAdapter.php(251): Dropbox\Client->getMetadataWithChildren('//savemart_dev')
#3 xxx\vendor\league\flysystem\src\Filesystem.php(268): League\Flysystem\Dropbox\DropboxAdapter->listContents('', false)
#4 xxx\src\Valpio\CloudBackupBundle\Client\FlysystemClient.php(48): League\Flysystem\Filesystem->listContents()
#5 xxx\src\Valpio\CloudBackupBundle\Manager\ClientManager.php(92): Valpio\CloudBackupBundle\Client\FlysystemClient->clean()
#6 xxx\src\Valpio\CloudBackupBundle\Manager\BackupManager.php(98): Valpio\CloudBackupBundle\Manager\ClientManager->clean()
#7 xxx\src\Valpio\CloudBackupBundle\Command\cleanCloudCommand.php(38): Valpio\CloudBackupBundle\Manager\BackupManager->doCleaning()
#8 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command.php(259): Valpio\CloudBackupBundle\Command\CleanCloudCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(860): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(192): Symfony\Component\Console\Application->doRunCommand(Object(Valpio\CloudBackupBundle\Command\CleanCloudCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 xxx\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php(92): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 xxx\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php(123): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 xxx\app\console(17): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput))
#14 {main}

Thanks for help.