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

dvc auth check #8235

Open
dberenbaum opened this issue Sep 2, 2022 · 10 comments
Open

dvc auth check #8235

dberenbaum opened this issue Sep 2, 2022 · 10 comments

Comments

@dberenbaum
Copy link
Contributor

@dberenbaum why don't we introduce a command in dvc for the check availability of buckets/directories? like dvc auth check s3://mybucket / dvc credentials azure://mycontainer

From @dmpetrov

@dberenbaum
Copy link
Contributor Author

Related: #6927. Maybe it could be an option to pass arbitrary information to dvc remote test to also test arbitrary credentials for things like get-url/import-url.

@dberenbaum
Copy link
Contributor Author

I did a quick look into it:

Even if we have a credentials check, the operations may fail due to permissions to list/read/write. So is it better to have a credentials check or a --dry-run type option? Would it have to start the operation and then interrupt?

@skshetry
Copy link
Member

skshetry commented Sep 2, 2022

My understanding here is that fsspec does not have a good way to check for authentication issues.
It may raise OSError on auth issues, but lots of api have assumptions that when OSError/IOError is raised, it is considered as FileNotFoundError instead (eg: isdir, info, walk, etc).

@daavoo
Copy link
Contributor

daavoo commented Sep 16, 2022

If the check is cheap to perform, I think would be also nice to include the check as part of dvc doctor.

Similar to how the Caches displays a link to the Troubleshooting page, we could do the same for the Remotes section.

@efiop
Copy link
Member

efiop commented Sep 16, 2022

@skshetry We are not limited by fsspec there, we can add any auth checks that we please on top and then consider propagading into upstream. But overall auth errors are handled differently depending on filesystem, in some it is better than in others. The OSError you've mentioned is just a bug, we've discussed this before.

What's important to remember here is that auth check is not going to be a silver bullet, as with many operations we won't know if we have access untill we try to do them. For example, s3 ls might work with some prefixes but not with others and so on, there are a lot of variables there. The best we can reasonably do is probably try listing a specified path, but even that is pretty limited.

@skshetry
Copy link
Member

The OSError you've mentioned is just a bug, we've discussed this before.

I'll consider this as a feature request Requesting a new feature rather than a bug Did we break something? .

What's important to remember here is that auth check is not going to be a silver bullet

I agree, I don't think the command helps, we should try to improve on error messages and exceptions. I'll suggest closing this in favour of #6353.

@daavoo
Copy link
Contributor

daavoo commented Sep 19, 2022

I agree, I don't think the command helps, we should try to improve on error messages and exceptions. I'll suggest closing this in favour of #6353.

The way I interpreted the request is that the command is not intended to be a silver bullet but rather a quick way of detecting errors regarding credentials and/or remote setup. Would be nice to clarify the use case for the command

@dberenbaum
Copy link
Contributor Author

@skshetry
Copy link
Member

skshetry commented Nov 7, 2022

The way I interpreted the request is that the command is not intended to be a silver bullet

An error could happen due to lot of things. Ideally, dvc should be able to inform users that the auth failed, in the commands where relevant, there should not be a need for a separate command.

@efiop
Copy link
Member

efiop commented Aug 16, 2023

Something like dvc remote check would be a very handy thing to have (e.g. on studio side as well). Something like

# dvc remote check
mys3remote: Unable to locate credentials
myazureremote: Auth failed
mylocalremote: Does not exist

(just from the top of my head, it should be something simple and informative). It doesn't have to be perfect, even calling fs.exists on remote path should be super informative. This should be a slim, simple and straightforward tool. Maybe we could also add some useful hints there, but that might risk bloating it, we should not try to create a space ship out of it (maybe some opt-in flags to the rescue, dunno).

MIght get to this in the near future for studio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants