laravel-backup: File Not Found Exception Message when using Google Drive
I am using the google drive adapter from https://github.com/nao-pon/flysystem-google-drive
The adapter itself seems to be working as it should. For instance, a test route that saves a simple file and it is stored correctly.
Route::get('test', function() {
Storage::disk('google')->put('test.txt', 'Hello World');
});
When I run php artisan backup:run
I get the following error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "File not found: .",
"locationType": "parameter",
"location": "fileId"
}
],
"code": 404,
"message": "File not found: ."
}
}
There is more to the error dump but that seems to be the relevant information.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 2
- Comments: 37 (7 by maintainers)
That error is because you can’t use the folder name you have to get the folder ID of the google drive folder, that’s because google drive allow duplicated names, so the unique name in that case is the id, create a folder on google drive and open that folder, now go to the url:
https://drive.google.com/drive/u/1/folders/id_of_the_folder
Now configure the file like this:
‘backup’ => [
Hi everyone, I tested creating a backup on google drive and it works. But there are 2 following notes:
null
and in the package’s configbackup.php
specify thename
as blank''
. You don’t need to modify package’s source code for this. This is because google uses the folder ID’s as an identifier as names could be similar.I had the same problem and here is my solution: File Not Found Exception throws on line 85 of Spatie\Backup\BackupDestination\BackupDestination file. In line 81 of that file $this->backupName added to file destination to create a directory named app url. So google drive don’t support this type of creating directory. To resolve you may set config(‘laravel-backup.backup.name’) to empty ( ‘’ ).
i also have same issue but solution just pass empty name like this ` ‘backup’ => [
the issue is that we are passing name most of time on upload name not match and it gives error when you pass null then it store that backup which is created at that time
someone knows how to avoid that the deleted backups land in trash and fill up storage anyway?