Comments (11)
Did you follow all implementation steps ??
Here a tutorial: laravel-google-drive-ext-demo
from flysystem-google-drive-ext.
Yes I've followed the steps:
- Added a google drive storage provider
- Added drive credentials to .env
- Added custom adapter & added a custom service provider
- registered a google file system disk
Everything is working fine when I'm not using GOOGLE_DRIVE_TEAM_DRIVE_ID
. And as stated, the zip with the sql file is created and then this error occurs ^
Drive SDK permissions within the google organisation is also set to 'ON'
from flysystem-google-drive-ext.
what are you setting in folder? wich options are you setting?
Show some code, wich versions are you using?
i'm just guessing
Also manually copying files to google disk works?
from flysystem-google-drive-ext.
The only option I'm setting is the teamDriveId.
array:1 [▼ "teamDriveId" => "0YBee_YovmGFHUk9ANC" ]
I can see the drive listed $googleDisk->getAdapter()->getService()->teamdrives->listTeamdrives()->getTeamDrives()
here.
Define manually?
I can successfully Storage::cloud()->put()
with a new file or an existing image to the team drive successfully
from flysystem-google-drive-ext.
This is the function that's throwing the exception:
protected function copyToBackupDestinations(string $path): void
{
$this->backupDestinations
->each(function (BackupDestination $backupDestination) use ($path) {
try {
if (! $backupDestination->isReachable()) {
throw new Exception("Could not connect to disk {$backupDestination->diskName()} because: {$backupDestination->connectionError()}");
}
consoleOutput()->info("Copying zip to disk named {$backupDestination->diskName()}...");
$backupDestination->write($path);
consoleOutput()->info("Successfully copied zip to disk named {$backupDestination->diskName()}.");
$this->sendNotification(new BackupWasSuccessful($backupDestination));
} catch (Exception $exception) {
consoleOutput()->error("Copying zip failed because: {$exception->getMessage()}.");
$this->sendNotification(new BackupHasFailed($exception, $backupDestination));
throw $exception;
}
});
Here is the backup destination I'm using:
Spatie\Backup\BackupDestination\BackupDestination {#1678 ▼
#disk: Illuminate\Filesystem\FilesystemAdapter {#1676 ▼
#driver: League\Flysystem\Filesystem {#1673 ▼
-config: League\Flysystem\Config {#1674 ▼
-options: []
}
-pathNormalizer: League\Flysystem\WhitespacePathNormalizer {#1675}
-adapter: Masbug\Flysystem\GoogleDriveAdapter {[#1671 ▼]
(https://github.com/masbug/flysystem-google-drive-ext/issues/103#sf-dump-1940293931-ref21671)
#service: Google\Service\Drive {#1653 ▶}
#spaces: "drive"
#root: "0YBee_YovmGFHUk9ANC"
#publishPermission: array:3 [▶]
-cacheFileObjects: array:6 [▶]
-cacheHasDirs: array:1 [▶]
-useHasDir: false
-usePermanentDelete: false
-useSinglePathTransaction: false
-options: array:12 [▼
"spaces" => "drive"
"useHasDir" => false
"useDisplayPaths" => true
"usePermanentDelete" => false
"useSinglePathTransaction" => false
"publishPermission" => array:3 [▶]
"appsExportMap" => array:6 [▶]
"parameters" => []
"driveId" => null
"sanitize_chars" => array:57 [▶]
"sanitize_replacement_char" => "_"
"teamDriveId" => "0AAle_YovmDGHUk9PVA"
]
-useDisplayPaths: true
-rootId: null
-cachedPaths: []
-requestedIds: []
-optParams: array:9 [▶]
-prefixer: League\Flysystem\PathPrefixer {#1672 ▶}
}
-publicUrlGenerator: null
-temporaryUrlGenerator: null
}
#adapter: Masbug\Flysystem\GoogleDriveAdapter {[#1671 ▶](https://github.com/masbug/flysystem-google-drive-ext/issues/103#sf-dump-1940293931-ref21671)}
#config: []
#prefixer: League\Flysystem\PathPrefixer {#1677 ▶}
#temporaryUrlCallback: null
}
#diskName: "google"
#backupName: ""
+connectionError: null
#backupCollectionCache: null
}
from flysystem-google-drive-ext.
I can successfully Storage::cloud()->put() with a new file or an existing image to the team drive successfully
Weird, i am using spatie/laravel-backup without problems
"teamDriveId" is already deprecated, it was changed to "driveId" wich here is null
On folder did you set /
or null
from flysystem-google-drive-ext.
I can successfully Storage::cloud()->put() with a new file or an existing image to the team drive successfully
Weird, i am using spatie/laravel-backup without problems "teamDriveId" is already deprecated, it was changed to "driveId" wich here is null
On folder did you set
/
ornull
Hmm, you're right. Seems like the code for teamDriveId
still exists though for now, no?
I see in the demo you linked, in the service provider that $options['teamdriveId'] = $config['teamDriveId'];
is also being passed there.
When I change this to driveId
the backup no longer targets the team directory, and goes straight into my root directory.
my folder is currently null, however I pass '/' $config['folder'] ?? '/'
like so
from flysystem-google-drive-ext.
So, it is fixed now?? I don't have more ideas, try to do a debug
from flysystem-google-drive-ext.
Maybe this #57
from flysystem-google-drive-ext.
Debugging atm. Still not fixed. Have no issues with what was mentioned in #57
from flysystem-google-drive-ext.
Fixed the issue.
So replacing the option['teamDriveId']
with option['driveId']
yesterday didn't work. I added an additional option just now having both 'teamDriveId'
and also 'driveId'
and that solved the issue.
if (isset($config['teamDriveId'])) {
$options['teamDriveId'] = $config['teamDriveId'];
$options['driveId'] = $config['teamDriveId'];
}
Thanks for assisting, I appreciate it
from flysystem-google-drive-ext.
Related Issues (20)
- creating a new folder in my drive HOT 2
- Invalid value at 'payload' (Map) ? HOT 6
- Error in masbug because upgrade system Google API HOT 5
- Duplicate root directories created when instantiating the adapter HOT 3
- 401 Request had invalid authentication credentials (laravel jobs) HOT 4
- Problem with spatie laravel backup - League\Flysystem\UnableToReadFile HOT 8
- Don't list files and Directories in shared folder HOT 1
- Laravel 10 support HOT 2
- Can't display paths, just IDs HOT 1
- How to move app to live HOT 1
- Argument #1 ($value) must be of type Countable|array, null given in GoogleDriveAdapter.php:1037 HOT 3
- Fails to report delete error
- Moving folders will fall into the trash HOT 3
- Allowed memory size issue HOT 1
- create,delete,rename folder,get folder listing and data using folder id instead of name ,to remove duplicacy of same folder name HOT 2
- Rename Directory using laravel HOT 5
- useDisplayPaths is false, but return original filename HOT 4
- On live Server, google drive backup is giving error! HOT 1
- cannot list directory shortcuts HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flysystem-google-drive-ext.