nao-pon/flysystem-google-drive

with spatie/laravel-medialibrary its not working.

mohsinalandsterling opened this issue · 1 comments

It's working fine, but when I'm trying to use it with spatie/laravel-medialibrary. It gives following error.

Google\Service\Exception: {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "File not found: 1563.",
    "locationType": "parameter",
    "location": "fileId"
   }
  ],
  "code": 404,
  "message": "File not found: 1563."
 }
}
 in file C:\wamp642\www\ls-services\vendor\google\apiclient\src\Http\REST.php on line 128

#0 C:\wamp642\www\ls-services\vendor\google\apiclient\src\Http\REST.php(103): Google\Http\REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), 'Google\\Service\\...')
#1 [internal function]: Google\Http\REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google\\Service\\...')
#2 C:\wamp642\www\ls-services\vendor\google\apiclient\src\Task\Runner.php(182): call_user_func_array(Array, Array)
#3 C:\wamp642\www\ls-services\vendor\google\apiclient\src\Http\REST.php(66): Google\Task\Runner->run()
#4 C:\wamp642\www\ls-services\vendor\google\apiclient\src\Client.php(898): Google\Http\REST::execute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google\\Service\\...', Array, NULL)
#5 C:\wamp642\www\ls-services\vendor\google\apiclient\src\Service\Resource.php(238): Google\Client->execute(Object(GuzzleHttp\Psr7\Request), 'Google\\Service\\...')
#6 C:\wamp642\www\ls-services\vendor\google\apiclient-services\src\Drive\Resource\Files.php(101): Google\Service\Resource->call('create', Array, 'Google\\Service\\...')
#7 C:\wamp642\www\ls-services\vendor\nao-pon\flysystem-google-drive\src\GoogleDriveAdapter.php(1242): Google\Service\Drive\Resource\Files->create(Object(Google\Service\Drive\DriveFile), Array)
#8 C:\wamp642\www\ls-services\vendor\nao-pon\flysystem-google-drive\src\GoogleDriveAdapter.php(1207): Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter->ensureDriveFileExists('-- phpMyAdmin S...', '1563', 'lscms-(1).sql', NULL, 'application/x-s...')
#9 C:\wamp642\www\ls-services\vendor\nao-pon\flysystem-google-drive\src\GoogleDriveAdapter.php(1174): Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter->uploadStringToGoogleDrive('-- phpMyAdmin S...', '1563', 'lscms-(1).sql', NULL, NULL)
#10 C:\wamp642\www\ls-services\vendor\nao-pon\flysystem-google-drive\src\GoogleDriveAdapter.php(1096): Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter->uploadResourceToGoogleDrive(Resource id #19, '1563', 'lscms-(1).sql', NULL, NULL)
#11 C:\wamp642\www\ls-services\vendor\nao-pon\flysystem-google-drive\src\GoogleDriveAdapter.php(209): Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter->upload('1563/lscms-(1)....', Resource id #19, Object(League\Flysystem\Config))
#12 C:\wamp642\www\ls-services\vendor\nao-pon\flysystem-google-drive\src\GoogleDriveAdapter.php(224): Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter->write('1563/lscms-(1)....', Resource id #19, Object(League\Flysystem\Config))
#13 C:\wamp642\www\ls-services\vendor\league\flysystem\src\Filesystem.php(123): Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter->writeStream('1563/lscms-(1)....', Resource id #19, Object(League\Flysystem\Config))
#14 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemAdapter.php(248): League\Flysystem\Filesystem->putStream('1563/lscms-(1)....', Resource id #19, Object(League\Flysystem\Config))
#15 C:\wamp642\www\ls-services\vendor\spatie\laravel-medialibrary\src\Filesystem\Filesystem.php(88): Illuminate\Filesystem\FilesystemAdapter->put('1563/lscms-(1)....', Resource id #19, Array)
#16 C:\wamp642\www\ls-services\vendor\spatie\laravel-medialibrary\src\Filesystem\Filesystem.php(31): Spatie\MediaLibrary\Filesystem\Filesystem->copyToMediaLibrary('C:\\wamp642\\tmp/...', Object(App\Models\Media), NULL, 'lscms-(1).sql')
#17 C:\wamp642\www\ls-services\vendor\spatie\laravel-medialibrary\src\FileAdder\FileAdder.php(378): Spatie\MediaLibrary\Filesystem\Filesystem->add('C:\\wamp642\\tmp/...', Object(App\Models\Media), 'lscms-(1).sql')
#18 C:\wamp642\www\ls-services\vendor\spatie\laravel-medialibrary\src\FileAdder\FileAdder.php(364): Spatie\MediaLibrary\FileAdder\FileAdder->processMediaItem(Object(App\Models\FomTask), Object(App\Models\Media), Object(Spatie\MediaLibrary\FileAdder\FileAdder))
#19 C:\wamp642\www\ls-services\vendor\spatie\laravel-medialibrary\src\FileAdder\FileAdder.php(314): Spatie\MediaLibrary\FileAdder\FileAdder->attachMedia(Object(App\Models\Media))
#20 C:\wamp642\www\ls-services\app\Http\Controllers\ImageController.php(78): Spatie\MediaLibrary\FileAdder\FileAdder->toMediaCollection('attachments')
#21 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Controller.php(54): App\Http\Controllers\ImageController->store()
#22 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('store', Array)
#23 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\ImageController), 'store')
#24 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Route.php(205): Illuminate\Routing\Route->runController()
#25 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Router.php(695): Illuminate\Routing\Route->run()
#26 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 C:\wamp642\www\ls-services\vendor\tymon\jwt-auth\src\Http\Middleware\Authenticate.php(32): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Tymon\JWTAuth\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Router.php(697): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#33 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Router.php(672): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#34 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Router.php(636): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#35 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Routing\Router.php(625): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#36 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(167): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#37 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#38 C:\wamp642\www\ls-services\vendor\livewire\livewire\src\DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Livewire\DisableBrowserCache->handle(Object(Illuminate\Http\Request), Object(Closure))
#40 C:\wamp642\www\ls-services\nova\src\Http\Middleware\ServeNova.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Laravel\Nova\Http\Middleware\ServeNova->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 C:\wamp642\www\ls-services\vendor\anlutro\l4-settings\src\SaveMiddleware.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): anlutro\LaravelSettings\SaveMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 C:\wamp642\www\ls-services\vendor\fideloper\proxy\src\TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#49 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#50 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#52 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#53 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#56 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#57 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(142): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#58 C:\wamp642\www\ls-services\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#59 C:\wamp642\www\ls-services\public\index.php(59): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#60 {main}

It is without support
Try masbug/flysystem-google-drive-ext