Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure OAuth failure #9833

Closed
ctafabiano opened this issue Oct 10, 2022 · 18 comments · Fixed by iterative/dvc-azure#55
Closed

Azure OAuth failure #9833

ctafabiano opened this issue Oct 10, 2022 · 18 comments · Fixed by iterative/dvc-azure#55
Assignees
Labels
A: cloud-versioning Related to cloud-versioned remotes bug Did we break something? fs: azure Related to the Azure filesystem p1-important Important, aka current backlog of things to do

Comments

@ctafabiano
Copy link

ctafabiano commented Oct 10, 2022

Bug Report

Description

When using OAuth authentication to connect to Azure with DVC and executing push/pull operations the following error is returned:
ERROR: unexpected error - Cannot combine AUTHORIZATION header with AUTH argument or credentials encoded in URL

This behaviour has been reported in a similar case: #5589, but the error we receive is a new one.
We are currently following Iterative's guide for configuring DVC<>Azure: https://iterative.ai/blog/azure-remotes-in-dvc

When trying any of the suggested workarounds we still receive the same error. It is possible we are doing something wrong or our Azure accounts config is not right, but in that case it would be helpful to have a different error message or update the guide :)

Related links we found around:
#2200
iterative/dvc.org#462
Azure/azure-sdk-for-python#18012

Reproduce

0. brew update && brew install azure-cli
1. dvc init
2. dvc remote add -d storage azure://RESOURCE/FOLDER
3. az login
4. dvc remote modify storage account_name 'USERNAME'
5. dvc add data/.
6. dvc push

If doing pull from an already uploaded DVC repo on Azure, we get the same error message:
ERROR: unexpected error - Cannot combine AUTHORIZATION header with AUTH argument or credentials encoded in URL

Expected

Files on data folder to be uploaded to Azure.
We are currently able to work fine (push and pull) with token authentication using AZURE_STORAGE_KEY, but this is a temporary solution for us and would like to move to full OAuth.

Environment information

Output of dvc doctor:

$ dvc doctor
DVC version: 2.29.0 (pip)
---------------------------------
Platform: Python 3.10.7 on macOS-12.5.1-arm64-arm-64bit
Subprojects:
	dvc_data = 0.14.0
	dvc_objects = 0.5.0
	dvc_render = 0.0.11
	dvc_task = 0.1.3
	dvclive = 0.11.0
	scmrepo = 0.1.1
Supports:
	azure (adlfs = 2022.10.0, knack = 0.10.0, azure-identity = 1.11.0),
	http (aiohttp = 3.8.3, aiohttp-retry = 2.8.3),
	https (aiohttp = 3.8.3, aiohttp-retry = 2.8.3)
Cache types: reflink, hardlink, symlink
Cache directory: apfs on /dev/disk3s8s1
Caches: local
Remotes: azure
Workspace directory: apfs on /dev/disk3s8s1
Repo: dvc
@daavoo
Copy link
Contributor

daavoo commented Oct 11, 2022

We are currently able to work fine (push and pull) with token authentication using AZURE_STORAGE_KEY, but this is a temporary solution for us and would like to move to full OAuth.

Hi @ctafabiano could you try setting dvc remote modify --local storage account_key 'mysecret' replacing 'mysecret' with the value you use for the env var.

See https://dvc.org/doc/command-reference/remote/modify#example-some-azure-authentication-methods

@ctafabiano
Copy link
Author

That works fine (same as using AZURE_STORAGE_KEY env var), but it's unrelated to the OAuth issue and we would like to move out of account_key authentication.

@dberenbaum
Copy link
Collaborator

Coming from iterative/dvc-azure#43 (comment), I see a similar issue but only for version_aware remotes. If I don't set account_key or connection_string, I get an error.

I have a config like this:

[core]
    remote = azure
['remote "azure"']
    url = azure://test/versioned
    account_name = dberenbaum
    version_aware = true

Here's the dvc push output:

$ dvc push -v
2023-03-28 13:15:34,853 DEBUG: v2.51.1.dev27+gefc2d7ad3, CPython 3.10.2 on macOS-13.2.1-arm64-arm-64bit
2023-03-28 13:15:34,854 DEBUG: command: /Users/dave/miniforge3/envs/dvc/bin/dvc push -v
2023-03-28 13:15:36,542 DEBUG: Pushing version-aware files to 'test/versioned'
2023-03-28 13:15:37,807 DEBUG: Querying status for '2800' files
2023-03-28 13:15:38,121 ERROR: unexpected error - Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:e21433a5-301e-0039-1598-617c02000000
Time:2023-03-28T17:15:38.1369596Z
ErrorCode:NoAuthenticationInformation
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>NoAuthenticationInformation</Code><Message>Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:e21433a5-301e-0039-1598-617c02000000
Time:2023-03-28T17:15:38.1369596Z</Message></Error>
Traceback (most recent call last):
  File "/Users/dave/Code/dvc/dvc/cli/__init__.py", line 210, in main
    ret = cmd.do_run()
  File "/Users/dave/Code/dvc/dvc/cli/command.py", line 26, in do_run
    return self.run()
  File "/Users/dave/Code/dvc/dvc/commands/data_sync.py", line 60, in run
    processed_files_count = self.repo.push(
  File "/Users/dave/Code/dvc/dvc/repo/__init__.py", line 65, in wrapper
    return f(repo, *args, **kwargs)
  File "/Users/dave/Code/dvc/dvc/repo/push.py", line 50, in push
    pushed += _push_worktree(
  File "/Users/dave/Code/dvc/dvc/repo/push.py", line 119, in _push_worktree
    return push_worktree(repo, remote, targets=targets, jobs=jobs, **kwargs)
  File "/Users/dave/Code/dvc/dvc/repo/worktree.py", line 176, in push_worktree
    pushed += checkout(
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_data/index/checkout.py", line 102, in checkout
    entry.meta = test_versioning(
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_data/index/checkout.py", line 37, in test_versioning
    transfer(src_fs, src_path, dest_fs, dest_path, callback=callback)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/generic.py", line 307, in transfer
    _try_links(
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/generic.py", line 247, in _try_links
    return copy(from_fs, from_path, to_fs, to_path, callback=callback)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/generic.py", line 84, in copy
    return _put(
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/generic.py", line 144, in _put
    return _put_one(from_paths[0], to_paths[0])
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/generic.py", line 136, in _put_one
    return put_file(from_path, to_path, callback=callback)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/callbacks.py", line 69, in func
    return wrapped(path1, path2, **kw)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/callbacks.py", line 41, in wrapped
    res = fn(*args, **kwargs)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/dvc_objects/fs/base.py", line 512, in put_file
    self.fs.put_file(os.fspath(from_file), to_info, callback=callback, **kwargs)
  File "/Users/dave/Code/filesystem_spec/fsspec/asyn.py", line 113, in wrapper
    return sync(self.loop, func, *args, **kwargs)
  File "/Users/dave/Code/filesystem_spec/fsspec/asyn.py", line 98, in sync
    raise return_result
  File "/Users/dave/Code/filesystem_spec/fsspec/asyn.py", line 53, in _runner
    result[0] = await coro
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/adlfs/spec.py", line 1754, in _put_file
    await bc.upload_blob(
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/core/tracing/decorator_async.py", line 79, in wrapper_use_tracer
    return await func(*args, **kwargs)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/storage/blob/aio/_blob_client_async.py", line 403, in upload_blob
    return await upload_block_blob(**options)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/storage/blob/aio/_upload_helpers.py", line 171, in upload_block_blob
    process_storage_error(error)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/storage/blob/_shared/response_handlers.py", line 181, in process_storage_error
    exec("raise error from None")   # pylint: disable=exec-used # nosec
  File "<string>", line 1, in <module>
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/storage/blob/aio/_upload_helpers.py", line 81, in upload_block_blob
    response = await client.upload(
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/core/tracing/decorator_async.py", line 79, in wrapper_use_tracer
    return await func(*args, **kwargs)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/storage/blob/_generated/aio/operations/_block_blob_operations.py", line 227, in upload
    map_error(status_code=response.status_code, response=response, error_map=error_map)
  File "/Users/dave/miniforge3/envs/dvc/lib/python3.10/site-packages/azure/core/exceptions.py", line 107, in map_error
    raise error
azure.core.exceptions.ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:e21433a5-301e-0039-1598-617c02000000
Time:2023-03-28T17:15:38.1369596Z
ErrorCode:NoAuthenticationInformation
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>NoAuthenticationInformation</Code><Message>Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:e21433a5-301e-0039-1598-617c02000000
Time:2023-03-28T17:15:38.1369596Z</Message></Error>

2023-03-28 13:15:38,189 DEBUG: Removing '/Users/dave/.58LJjWes4z8P3Fea2AsvjF.tmp'
2023-03-28 13:15:38,190 DEBUG: Removing '/Users/dave/.58LJjWes4z8P3Fea2AsvjF.tmp'
2023-03-28 13:15:38,190 DEBUG: Removing '/Users/dave/.58LJjWes4z8P3Fea2AsvjF.tmp'
2023-03-28 13:15:38,190 DEBUG: Removing '/Users/dave/repo/.dvc/cache/.oGGrK2g96FEEkKWndy3fRp.tmp'
2023-03-28 13:15:38,365 DEBUG: Version info for developers:
DVC version: 2.51.1.dev27+gefc2d7ad3
------------------------------------
Platform: Python 3.10.2 on macOS-13.2.1-arm64-arm-64bit
Subprojects:
        dvc_data = 0.46.0
        dvc_objects = 0.21.1
        dvc_render = 0.3.1
        dvc_task = 0.2.0
        scmrepo = 0.1.17
Supports:
        azure (adlfs = 2022.9.1, knack = 0.9.0, azure-identity = 1.7.1),
        gdrive (pydrive2 = 1.15.0),
        gs (gcsfs = 2022.11.0),
        hdfs (fsspec = 2022.11.0+0.gacad158.dirty, pyarrow = 7.0.0),
        http (aiohttp = 3.8.1, aiohttp-retry = 2.8.3),
        https (aiohttp = 3.8.1, aiohttp-retry = 2.8.3),
        oss (ossfs = 2021.8.0),
        s3 (s3fs = 2022.11.0+6.g804057f.dirty, boto3 = 1.24.59),
        ssh (sshfs = 2023.1.0),
        webdav (webdav4 = 0.9.4),
        webdavs (webdav4 = 0.9.4),
        webhdfs (fsspec = 2022.11.0+0.gacad158.dirty)
Cache types: reflink, hardlink, symlink
Cache directory: apfs on /dev/disk3s1s1
Caches: local
Remotes: azure
Workspace directory: apfs on /dev/disk3s1s1
Repo: dvc, git
Repo.site_cache_dir: /Library/Caches/dvc/repo/0b71882c6838c19b84e2b568d75d9717

@dberenbaum dberenbaum added the bug Did we break something? label May 11, 2023
@dberenbaum
Copy link
Collaborator

Another user ran into this: https://discord.com/channels/485586884165107732/485596304961962003/1106179670799552584

@efiop
Copy link
Contributor

efiop commented Jun 24, 2023

Hm, not able to reproduce right away. I wonder if there is some common problem with, maybe, az cli and python lib version mismatch or something. @dberenbaum Your azure-cli is from brew or from the same python env in which dvc is installed?

@dberenbaum
Copy link
Collaborator

🤦 You are right @efiop. Thanks for looking into it! I can confirm that reinstalling azure-cli in my virtual env fixes it. Let's close it then.

@efiop
Copy link
Contributor

efiop commented Jun 26, 2023

@dberenbaum Definitely worth documenting in azure and probably troubleshooting sections. Created iterative/dvc.org#4652 for now

@efiop
Copy link
Contributor

efiop commented Jun 26, 2023

@ctafabiano Could you check if you have the same problem of lib mismatch, please?

@smarais
Copy link

smarais commented Aug 3, 2023

Hi @efiop , I'm seeing a similar issue to this.

Notes:

  • I have Storage Blob Data Contributor set in my Azure IAM
  • az storage blob upload --file hello.txt --account-name mldatastephenmarais --container-name datasets --name myblobupload --auth-mode login works fine
  • dvc push works fine when setting the connection string but I'm trying to avoid this.

These are the exact steps that reproduce my issue (running on Ubuntu 20.04).

mkdir dvctest && cd dvctest

python3 -m venv .venv
source .venv/bin/activate

pip install dvc[azure] azure-cli

git init
dvc init
dvc remote add -d mldata azure://datasets
dvc remote modify mldata version_aware true
dvc remote modify mldata account_name 'mldatastephenmarais'

az login # Follow auth through the browser

echo "test" > test.txt
dvc add test.txt
dvc push -v

This is the error:

2023-08-03 14:23:13,924 DEBUG: v3.11.0 (pip), CPython 3.8.10 on Linux-5.15.0-78-generic-x86_64-with-glibc2.29
2023-08-03 14:23:13,924 DEBUG: command: /home/stephenmarais/ws/mlopstest/dvctest/.venv/bin/dvc push -v
2023-08-03 14:23:15,054 DEBUG: Pushing version-aware files to 'datasets'
2023-08-03 14:23:15,493 ERROR: unexpected error - Server failed to authenticate the request. Please refer to the information in the www-authenticate header.         
RequestId:1912a24b-601e-0083-7150-c6a165000000                                                                                                                       
Time:2023-08-03T21:23:15.4541899Z
ErrorCode:NoAuthenticationInformation
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>NoAuthenticationInformation</Code><Message>Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:1912a24b-601e-0083-7150-c6a165000000
Time:2023-08-03T21:23:15.4541899Z</Message></Error>
Traceback (most recent call last):
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/cli/__init__.py", line 209, in main
    ret = cmd.do_run()
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/cli/command.py", line 26, in do_run
    return self.run()
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/commands/data_sync.py", line 60, in run
    processed_files_count = self.repo.push(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/repo/__init__.py", line 64, in wrapper
    return f(repo, *args, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/repo/push.py", line 50, in push
    pushed += _push_worktree(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/repo/push.py", line 119, in _push_worktree
    return push_worktree(repo, remote, targets=targets, jobs=jobs, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc/repo/worktree.py", line 161, in push_worktree
    apply(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_data/index/checkout.py", line 351, in apply
    _create_files(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_data/index/checkout.py", line 106, in _create_files
    entry.meta = test_versioning(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_data/index/checkout.py", line 47, in test_versioning
    transfer(src_fs, src_path, dest_fs, dest_path, callback=callback)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/generic.py", line 308, in transfer
    _try_links(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/generic.py", line 247, in _try_links
    return copy(from_fs, from_path, to_fs, to_path, callback=callback)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/generic.py", line 84, in copy
    return _put(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/generic.py", line 144, in _put
    return _put_one(from_paths[0], to_paths[0])
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/generic.py", line 136, in _put_one
    return put_file(from_path, to_path, callback=callback)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/callbacks.py", line 69, in func
    return wrapped(path1, path2, **kw)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/callbacks.py", line 41, in wrapped
    res = fn(*args, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_objects/fs/base.py", line 540, in put_file
    self.fs.put_file(os.fspath(from_file), to_info, callback=callback, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/dvc_azure/spec.py", line 9, in put_file
    return super().put_file(*args, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/fsspec/asyn.py", line 121, in wrapper
    return sync(self.loop, func, *args, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/fsspec/asyn.py", line 106, in sync
    raise return_result
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/fsspec/asyn.py", line 61, in _runner
    result[0] = await coro
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/adlfs/spec.py", line 1602, in _put_file
    await bc.upload_blob(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/core/tracing/decorator_async.py", line 77, in wrapper_use_tracer
    return await func(*args, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/storage/blob/aio/_blob_client_async.py", line 414, in upload_blob
    return await upload_block_blob(**options)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/storage/blob/aio/_upload_helpers.py", line 172, in upload_block_blob
    process_storage_error(error)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/storage/blob/_shared/response_handlers.py", line 189, in process_storage_error
    exec("raise error from None")   # pylint: disable=exec-used # nosec
  File "<string>", line 1, in <module>
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/storage/blob/aio/_upload_helpers.py", line 82, in upload_block_blob
    response = await client.upload(
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/core/tracing/decorator_async.py", line 77, in wrapper_use_tracer
    return await func(*args, **kwargs)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/storage/blob/_generated/aio/operations/_block_blob_operations.py", line 244, in upload
    map_error(status_code=response.status_code, response=response, error_map=error_map)
  File "/home/stephenmarais/ws/mlopstest/dvctest/.venv/lib/python3.8/site-packages/azure/core/exceptions.py", line 112, in map_error
    raise error
azure.core.exceptions.ClientAuthenticationError: Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:1912a24b-601e-0083-7150-c6a165000000
Time:2023-08-03T21:23:15.4541899Z
ErrorCode:NoAuthenticationInformation
Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>NoAuthenticationInformation</Code><Message>Server failed to authenticate the request. Please refer to the information in the www-authenticate header.
RequestId:1912a24b-601e-0083-7150-c6a165000000
Time:2023-08-03T21:23:15.4541899Z</Message></Error>

2023-08-03 14:23:15,513 DEBUG: link type reflink is not available ([Errno 95] no more link types left to try out)
2023-08-03 14:23:15,513 DEBUG: Removing '/home/stephenmarais/ws/mlopstest/.cGUVyWSZdY6mJR3KPk7q4G.tmp'
2023-08-03 14:23:15,513 DEBUG: Removing '/home/stephenmarais/ws/mlopstest/.cGUVyWSZdY6mJR3KPk7q4G.tmp'
2023-08-03 14:23:15,513 DEBUG: Removing '/home/stephenmarais/ws/mlopstest/.cGUVyWSZdY6mJR3KPk7q4G.tmp'
2023-08-03 14:23:15,513 DEBUG: Removing '/home/stephenmarais/ws/mlopstest/dvctest/.dvc/cache/files/md5/.XgxoTDbpmiN3WPSeoz2Avx.tmp'
2023-08-03 14:23:15,516 DEBUG: Version info for developers:
DVC version: 3.11.0 (pip)
-------------------------
Platform: Python 3.8.10 on Linux-5.15.0-78-generic-x86_64-with-glibc2.29
Subprojects:
	dvc_data = 2.9.1
	dvc_objects = 0.24.1
	dvc_render = 0.5.3
	dvc_task = 0.3.0
	scmrepo = 1.1.0
Supports:
	azure (adlfs = 2023.4.0, knack = 0.11.0, azure-identity = 1.13.0),
	http (aiohttp = 3.8.5, aiohttp-retry = 2.8.3),
	https (aiohttp = 3.8.5, aiohttp-retry = 2.8.3)
Config:
	Global: /home/stephenmarais/.config/dvc
	System: /etc/xdg/xdg-ubuntu/dvc
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/nvme0n1p5
Caches: local
Remotes: azure
Workspace directory: ext4 on /dev/nvme0n1p5
Repo: dvc, git
Repo.site_cache_dir: /var/tmp/dvc/repo/6c839f48d59d2f7dececf3229cf79ed1

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
2023-08-03 14:23:15,517 DEBUG: Analytics is enabled.
2023-08-03 14:23:15,544 DEBUG: Trying to spawn '['daemon', '-q', 'analytics', '/tmp/tmp2l3h6b34']'
2023-08-03 14:23:15,545 DEBUG: Spawned '['daemon', '-q', 'analytics', '/tmp/tmp2l3h6b34']'

az --version gives

azure-cli                         2.51.0

core                              2.51.0
telemetry                          1.1.0

Extensions:
init                               0.1.0

Dependencies:
msal                              1.23.0
azure-mgmt-resource             23.1.0b2

Python location '/home/stephenmarais/ws/mlopstest/dvctest/.venv/bin/python3'
Extensions directory '/home/stephenmarais/.azure/cliextensions'

Python (Linux) 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

@dberenbaum
Copy link
Collaborator

@smarais Does it happen only when using version-aware?

@nonoxp
Copy link

nonoxp commented Aug 7, 2023

Same issue for me.
@dberenbaum I did the comparison, using version-aware will trigger the error, not using it will work fine.

edit : confirmed on both windows and Ubuntu

@dberenbaum dberenbaum reopened this Aug 7, 2023
@dberenbaum
Copy link
Collaborator

@efiop I'm not sure if it's a regression or I tested something differently when we closed this, but I can reproduce the issue with version_aware remotes.

@smarais
Copy link

smarais commented Aug 7, 2023

Hi @dberenbaum - I just ran a test without version aware and can also confirm it worked without and failed again with version aware enabled.

@dberenbaum dberenbaum transferred this issue from iterative/dvc-azure Aug 10, 2023
@dberenbaum dberenbaum added p1-important Important, aka current backlog of things to do fs: azure Related to the Azure filesystem A: cloud-versioning Related to cloud-versioned remotes labels Aug 10, 2023
@dberenbaum
Copy link
Collaborator

Transferred to dvc for more visibility and since it directly impacts dvc usage.

@efiop
Copy link
Contributor

efiop commented Aug 11, 2023

Ok, can reproduce as well now (not sure why I wasn't the last time, maybe used an admin account by accident or something). Seems like we need to add some other role than just Storage Blob Data Contributor by the look of it, but I might be wrong and it is something in adlfs. Investigating...

EDIT: nope, giving owner doesn't help, so something else is going on, likely on the adlfs->...->azure libraries side.
EDIT1: seems like adlfs assumes that we will provide credential during initialization (that should be AzureCLICredentials in this case), and so fails. Looking into it...
EDIT2: looks like we for some reason always use anon auth that we fall back to, which means that adlfs can't use default azure credentials (which include cli).

@efiop
Copy link
Contributor

efiop commented Aug 11, 2023

Btw, just for the record: a workaround is to use another auth mechanism (e.g. connection string).

efiop added a commit to efiop/dvc-azure that referenced this issue Aug 11, 2023
@efiop efiop reopened this Aug 11, 2023
@github-project-automation github-project-automation bot moved this from Done to Todo in DVC Aug 11, 2023
efiop added a commit to iterative/dvc-azure that referenced this issue Aug 11, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in DVC Aug 11, 2023
@efiop
Copy link
Contributor

efiop commented Aug 11, 2023

@ctafabiano @smarais Hey folks, could you please upgrade dvc-azure package with pip install -U dvc-azure (make sure it is 2.22.1) and see if that fixes it for you?

Turns out there was a bug in dvc-azure, where we accidentally made adlfs default to anon login when version_aware was enabled.

@smarais
Copy link

smarais commented Aug 14, 2023

Hi @efiop, this seems to have resolved the issue for me.
I appreciate the quick turnaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: cloud-versioning Related to cloud-versioned remotes bug Did we break something? fs: azure Related to the Azure filesystem p1-important Important, aka current backlog of things to do
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants