Skip to content

gdrive: raises unexpected error - name: drive version: v2 #5618

Closed
@0x2b3bfa0

Description

@0x2b3bfa0

Bug Report

Description

DVC native packages bundled with pyinstaller don't include the Google API Discovery cache directory containing the drive.v2.json file, which is essential for the Google Drive remote operations.

This issue could be seamlessly fixed with pyinstaller/pyinstaller-hooks-contrib#97, but we might need to find an alternative until the changes on that pull request get released through a stable channel. I guess that we could temporarily add the patched hook-googleapiclient.model.py file as part of our custom hooks directory.

How to reproduce

  1. Create an empty project:

    $ mkdir test && cd test
    $ git init && dvc init
    Initialized empty Git repository in ./test/.git/
    Initialized DVC repository.
  2. Add a dummy file:

    $ touch file && dvc add file
    WARNING: 'file' is empty.
    ···
  3. Configure the remote:

    $ dvc remote add origin gdrive://root
    $ dvc remote modify origin gdrive_use_service_account true   
    $ dvc remote modify origin gdrive_service_account_json_file_path account.json
  4. Reproduce the issue:

    $ dvc push --remote origin
    ERROR: unexpected error - name: drive  version: v2

Note: these steps have been reproduced with the official dvc_2.0.5_amd64.deb build.

Expected result

Ideally, dvc pull should be able to pull data from the Google Drive remote.

$ dvc push --remote origin
···

Environment information

Output of dvc doctor

$ dvc doctor
DVC version: 2.0.5 (deb)
---------------------------------
Platform: Python 3.7.10 on Linux-5.4.0-1040-azure-x86_64-with-debian-bullseye-sid
Supports: All remotes
Cache types: <https://error.dvc.org/no-dvc-cache>
Caches: local
Remotes: None
Workspace directory: ext4 on /dev/root
Repo: dvc, git

Additional Information

This issue is specific to pyinstaller builds, and has been succesfully reproduced with the binaries generated through the build_posix.sh packaging script:

pyinstaller \
--additional-hooks-dir $(pwd)/scripts/hooks dvc/__main__.py \
--name dvc \
--distpath $LIB_DIR \
--specpath $BUILD_DIR

Our iterative/setup-dvc GitHub Action also seems to be affected by this issue on every environment but the Windows ones, which rely exclusively on PyPI packages.

Metadata

Metadata

Assignees

Labels

bugDid we break something?

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions