Bug Report
push: Unnable access remote when gdrive_user_credentials_file is set into .dvc/config
Description
When attempting to use DVC with Google Drive credentials set in a customized file (gdrive_user_credentials_file ), an error is encountered. The issue arises when executing DVC commands that touch the remote storage, such as dvc push or dvc pull.
Reproduce
- Given a working Google Drive authentication info into
./gdrive/mydataset-credentials.json and the following .dvc/config file:
[core]
remote = mydataset
['remote "mydataset"']
url = gdrive://${folder_id}
gdrive_user_credentials_file = ./.gdrive/mydataset-credentials.json
- Try to use a command that touches the remote storage, such as
push or pull
Actual result:
$ dvc push
ERROR: unexpected error - Setting save_credentials_file should be type <class 'str'>
Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
Expected
DVC should use my credentials previously set.
Environment information
Output of dvc doctor:
$ dvc doctor
DVC version: 3.4.0 (pip)
------------------------
Platform: Python 3.10.9 on Linux-3.10.0-1160.49.1.el7.x86_64-x86_64-with-glibc2.17
Subprojects:
dvc_data = 2.3.3
dvc_objects = 0.23.0
dvc_render = 0.5.3
dvc_task = 0.3.0
scmrepo = 1.0.4
Supports:
gdrive (pydrive2 = 1.16.0),
http (aiohttp = 3.8.4, aiohttp-retry = 2.8.3),
https (aiohttp = 3.8.4, aiohttp-retry = 2.8.3)
Config:
Global: /home/thiago.maltempi/.config/dvc
System: /etc/xdg/dvc
Cache types: hardlink, symlink
Cache directory: nfs on 10.20.200.1:/exports/home
Caches: local
Remotes: gdrive
Workspace directory: nfs on 10.20.200.1:/exports/home
Repo: dvc (subdir), git
Repo.site_cache_dir: /var/tmp/dvc/repo/8059f048374a2688cbb2ff3c68b23a96
Troubleshooting
The error is thrown from \pydrive2\settings.py (see https://github.com/iterative/PyDrive2/blob/main/pydrive2/settings.py#L170).
So I added a print there, and got this:
print('---->', value, type(value))
'''----> ${my_full_path}/./.gdrive/mydataset-credentials.json <class 'dvc.config_schema.RelPath'>'''
The fix may probably be in the dvc end, before calling pydrive2.
Bug Report
push: Unnable access remote when
gdrive_user_credentials_fileis set into.dvc/configDescription
When attempting to use DVC with Google Drive credentials set in a customized file (
gdrive_user_credentials_file), an error is encountered. The issue arises when executing DVC commands that touch the remote storage, such asdvc pushordvc pull.Reproduce
./gdrive/mydataset-credentials.jsonand the following.dvc/configfile:pushorpulldvc pushActual result:
Expected
DVC should use my credentials previously set.
Environment information
Output of
dvc doctor:Troubleshooting
The error is thrown from
\pydrive2\settings.py(see https://github.com/iterative/PyDrive2/blob/main/pydrive2/settings.py#L170).So I added a
printthere, and got this:The fix may probably be in the
dvcend, before callingpydrive2.