I have added my google drive as a remote storage

…but when I do a dvc push, i get the below error. Any idea how to resolve this. i am following the getting started sessions to get myself familiar with the product

ERROR: unexpected error - : <HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/16uQro82U1-Ox3ABLZ0Oa7uNUJr0T9BD-?fields=driveId&supportsAllDrives=true&alt=json returned “File not found: 16uQro82U1-Ox3ABLZ0Oa7uNUJr0T9BD-”. Details: “[{‘domain’: ‘global’, ‘reason’: ‘notFound’, ‘message’: ‘File not found: 16uQro82U1-Ox3ABLZ0Oa7uNUJr0T9BD-’, ‘locationType’: ‘other’, ‘location’: ‘file’}]”>

Hi, could you please share the output of dvc push -v and dvc doctor? Thanks.

It is showing a permission error but I have already given the permission

Traceback (most recent call last):
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 121, in _gdrive_shared_drive_id
item.FetchMetadata(“driveId”)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/auth.py”, line 84, in _decorated
return decoratee(self, *args, **kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/files.py”, line 448, in FetchMetadata
raise ApiRequestError(error)
pydrive2.files.ApiRequestError: <HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/16uQro82U1-Ox3ABLZ0Oa7uNUJr0T9BD-?fields=driveId&supportsAllDrives=true&alt=json returned “File not found: 16uQro82U1-Ox3ABLZ0Oa7uNUJr0T9BD-”. Details: “[{‘domain’: ‘global’, ‘reason’: ‘notFound’, ‘message’: ‘File not found: 16uQro82U1-Ox3ABLZ0Oa7uNUJr0T9BD-’, ‘locationType’: ‘other’, ‘location’: ‘file’}]”>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/main.py”, line 55, in main
ret = cmd.do_run()
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/command/base.py”, line 45, in do_run
return self.run()
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/command/data_sync.py”, line 57, in run
processed_files_count = self.repo.push(
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/repo/init.py”, line 49, in wrapper
return f(repo, *args, **kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/repo/push.py”, line 56, in push
pushed += self.cloud.push(
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/data_cloud.py”, line 85, in push
return transfer(
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/objects/transfer.py”, line 153, in transfer
status = compare_status(src, dest, obj_ids, check_deleted=False, **kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/objects/status.py”, line 158, in compare_status
dest_exists, dest_missing = status(
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/objects/status.py”, line 131, in status
exists.update(odb.hashes_exist(hashes, name=odb.fs_path, **kwargs))
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/objects/db/base.py”, line 470, in hashes_exist
remote_hashes = self.list_hashes_exists(hashes, jobs, name)
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/objects/db/base.py”, line 421, in list_hashes_exists
ret = list(itertools.compress(hashes, in_remote))
File “/opt/miniconda3/lib/python3.9/concurrent/futures/_base.py”, line 608, in result_iterator
yield fs.pop().result()
File “/opt/miniconda3/lib/python3.9/concurrent/futures/_base.py”, line 445, in result
return self.__get_result()
File “/opt/miniconda3/lib/python3.9/concurrent/futures/_base.py”, line 390, in __get_result
raise self._exception
File “/opt/miniconda3/lib/python3.9/concurrent/futures/thread.py”, line 52, in run
result = self.fn(*self.args, **self.kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/objects/db/base.py”, line 412, in exists_with_progress
ret = self.fs.exists(fs_path)
File “/opt/miniconda3/lib/python3.9/site-packages/dvc/fs/fsspec_wrapper.py”, line 91, in exists
return self.fs.exists(path)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 225, in exists
self._get_item_id(path)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 192, in _get_item_id
item_ids = self._path_to_item_ids(base, create, use_cache)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 174, in _path_to_item_ids
item_ids = self._get_cached_item_ids(path, use_cache)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 170, in _get_cached_item_ids
return self._ids_cache[“dirs”].get(path, [])
File “/opt/miniconda3/lib/python3.9/site-packages/funcy/objects.py”, line 50, in get
return prop.get(instance, type)
File “/opt/miniconda3/lib/python3.9/site-packages/funcy/objects.py”, line 28, in get
res = instance.dict[self.fget.name] = self.fget(instance)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 82, in _ids_cache
for item in self._gdrive_list(
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 132, in _gdrive_list
param.update(self._list_params)
File “/opt/miniconda3/lib/python3.9/site-packages/funcy/objects.py”, line 28, in get
res = instance.dict[self.fget.name] = self.fget(instance)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 100, in _list_params
drive_id = self._gdrive_shared_drive_id(self.root)
File “/opt/miniconda3/lib/python3.9/site-packages/funcy/decorators.py”, line 45, in wrapper
return deco(call, *dargs, **dkwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/funcy/flow.py”, line 127, in retry
return call()
File “/opt/miniconda3/lib/python3.9/site-packages/funcy/decorators.py”, line 66, in call
return self._func(*self._args, **self._kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/pydrive2/fs/spec.py”, line 125, in _gdrive_shared_drive_id
raise PermissionError from exc
PermissionError

How did you setup gdrive? Did you follow this setup guide?

Hi, @skshetry not sure if this was solved but I encountered the same issue. I followed along with the remote storage setup. However, one difference is that I did not use dvc add because I had written the dependencies and outputs directly in the dvc.yaml file. Secondly, I only allowed dvc access / permission to see, create, and delete its own configuration data. If I need to change the dvc permissons, how do I do that after the initial setup?

–solved–
So I guess dvc needs access to everything. The authorization section was helpful, https://dvc.org/doc/user-guide/setup-google-drive-remote?_ga=2.39431651.1183132044.1651410796-478586346.1651410796#authorization
just delete the user credentials in the .dvc/tmp file and try again.