Code Monkey home page Code Monkey logo

Comments (8)

chrisrollins65 avatar chrisrollins65 commented on July 3, 2024 3

Ok so I made some progress.

Looks like either not using the GOOGLE_DRIVE_FOLDER variable or setting the backup name to "" in the spatie backup config works. But if I try to define a custom folder and leave the default name in the backup config to env('APP_NAME'), then it fails.

I'm not sure where the problem lies here but I suspect that if the spatie backup feature is working for all the other file systems then I imagine it's something that this file system does differently. I tried to investigate more but I'm out of time to keep looking around for now.

One thing I did notice is that in the laravel-google-drive-ext-demo, in the routes file (web.php), these lines:

Route::get('list-files', function() {
    $recursive = false; // Get subdirectories also?
    $contents = collect(Storage::cloud()->listContents('/', $recursive));

If I change the / to any other directory, I get the same error that it's not found even though the directory exists. For example:

    $contents = collect(Storage::cloud()->listContents('dominarelingles', $recursive));

image

Is that listContents method supposed to allow us to define where we want to look, or is it only supposed to be used with the root directory, or is there something I'm missing here?

from flysystem-google-drive-ext.

obinnaelviso avatar obinnaelviso commented on July 3, 2024 2

I'm still facing the same issue, it works well when you omit a folder name but when you add the folder to the environment path it gives the same error. I got this error when trying to implement spatie backup with the package.

Also this error is not in version 1.0.0 but too bad I can't downgrade to this version on laravel 9. I hope this issue get fixed soon

Here is a fix for this issue. Check the last comment. I hope this helps
#77

from flysystem-google-drive-ext.

luisAg1996 avatar luisAg1996 commented on July 3, 2024 1

Hello @chrisrollins65 ,

I was having the exact same problem you mention, I spent many hours struggling and trying to find a solution for this error. I tried your workaround and it worked perfectly for me.

Just wanted to thank you for updating this Issue with your findings.

from flysystem-google-drive-ext.

parallels999 avatar parallels999 commented on July 3, 2024

This package doesn't use folderId, just folder name(regular path), read documentation

from flysystem-google-drive-ext.

chrisrollins65 avatar chrisrollins65 commented on July 3, 2024

Thanks, sorry I missed that. I've made the following changes but the error still occurs:

Service provider:

$adapter = new GoogleDriveAdapter($service, $config['folder']);

filesystems.php:

'folder' => env('GOOGLE_DRIVE_FOLDER'),

.env:

GOOGLE_DRIVE_FOLDER="Dominar el ingles"

Also tried this:

GOOGLE_DRIVE_FOLDER="/Dominar el ingles"

The folder is at the root of my Drive.

Seems like this is what the documentation says to do but it's still not working...

from flysystem-google-drive-ext.

parallels999 avatar parallels999 commented on July 3, 2024

Team drive??
Here is a working demo: laravel-google-drive-ext-demo
Also avoid whitespace

from flysystem-google-drive-ext.

chrisrollins65 avatar chrisrollins65 commented on July 3, 2024

Not a team drive, my own personal unshared drive.

I'll try installing that demo and seeing if it works for me.

On my own personal app I set GOOGLE_DRIVE_FOLDER to dominarelingles and also changed the name to match in my Google Drive. It still gives me the exact same error that it is unable to find "Dominar el ingles". I'm running this command as it is much faster than the backup command:

php artisan backup:list

Looks like there's a setting in spatie's backups.php where it sets the name to the app name:

'name' => env('APP_NAME', 'laravel-backup'),

And it looks like that's what is used by this package when looking? That would explain why it's still looking for "Dominar el ingles" instead of "dominarelingles" like I changed it to.

Curiously, if I omit that environment variable altogether (so it should be null), I don't get any error. Instead I get this:

> php artisan backup:list
+-------------------+--------+-----------+---------+--------------+--------------------+--------------+
| Name              | Disk   | Reachable | Healthy | # of backups | Newest backup      | Used storage |
+-------------------+--------+-----------+---------+--------------+--------------------+--------------+
| Dominar el ingles | google | ✅        | ❌      |            0 | No backups present |         0 KB |
+-------------------+--------+-----------+---------+--------------+--------------------+--------------+

Unhealthy backup destinations
-----------------------------
+-------------------+--------+------------------+----------------------------------------------------------+
| Name              | Disk   | Failed check     | Description                                              |
+-------------------+--------+------------------+----------------------------------------------------------+
| Dominar el ingles | google | Maximumageindays | No existe ninguna copia de seguridad de esta aplicación. |
+-------------------+--------+------------------+----------------------------------------------------------+

from flysystem-google-drive-ext.

obinnaelviso avatar obinnaelviso commented on July 3, 2024

I'm still facing the same issue, it works well when you omit a folder name but when you add the folder to the environment path it gives the same error. I got this error when trying to implement spatie backup with the package.

Also this error is not in version 1.0.0 but too bad I can't downgrade to this version on laravel 9. I hope this issue get fixed soon

from flysystem-google-drive-ext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.