overtrue / laravel-filesystem-qiniu

A Qiniu Storage filesystem for Laravel
471 stars 35 forks source link

League\Flysystem\FileNotFoundException : File not found at path #22

Closed forgottener closed 2 years ago

forgottener commented 5 years ago
use Storage;

...

$qiniuGlanceDisk = Storage::disk('qiniu');
$qiniuGlanceDisk->read('1.txt');
File not found at path: 1.txt {"exception":"[object] (League\\Flysystem\\FileNotFoundException(code: 0): File not found at path: 1.txt at vendor/league/flysystem/src/Filesystem.php:389)
[stacktrace]
#0 vendor/league/flysystem/src/Filesystem.php(179): League\\Flysystem\\Filesystem->assertPresent('1.txt')
#1 [internal function]: League\\Flysystem\\Filesystem->read('glance_upload/1...')
#2 vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(729): call_user_func_array(Array, Array)
#3 app/Console/Commands/GlanceVideo.php(579): Illuminate\\Filesystem\\FilesystemAdapter->__call('read', Array)
#4 [internal function]: App\\Console\\Commands\\GlanceVideo->handle()
#5 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#6 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#8 vendor/laravel/framework/src/Illuminate/Container/Container.php(576): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#9 vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call(Array)
#10 vendor/symfony/console/Command/Command.php(255): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#11 vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#12 vendor/symfony/console/Application.php(908): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#13 vendor/symfony/console/Application.php(269): Symfony\\Component\\Console\\Application->doRunCommand(Object(App\\Console\\Commands\\GlanceVideo), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#14 vendor/symfony/console/Application.php(145): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#15 vendor/laravel/framework/src/Illuminate/Console/Application.php(90): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#16 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#17 artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#18 {main}
"} 
 League\Flysystem\FileNotFoundException  : File not found at path: 1.txt

  at vendor/league/flysystem/src/Filesystem.php:389
    385|      */
    386|     public function assertPresent($path)
    387|     {
    388|         if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) {
  > 389|             throw new FileNotFoundException($path);
    390|         }
    391|     }
    392|
    393|     /**

  Exception trace:

  1   League\Flysystem\Filesystem::assertPresent("1.txt")
      vendor/league/flysystem/src/Filesystem.php:179

  2   League\Flysystem\Filesystem::read("1.txt")
      vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:729

在artisan自己的脚本里试了下,copy,move,read都不行,fetch,getUrl倒是可以的,请问是咋回事啊?config/filesystems.php已经加了七牛的配置了

laravel版本是5.8, "overtrue/laravel-filesystem-qiniu": "^1.0"