Skip to content

Insufficient permissions raise IO ValueError instead of PermissionError #6523

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

Closed
BorjaEst opened this issue Apr 27, 2022 · 1 comment · Fixed by #7629
Closed

Insufficient permissions raise IO ValueError instead of PermissionError #6523

BorjaEst opened this issue Apr 27, 2022 · 1 comment · Fixed by #7629

Comments

@BorjaEst
Copy link

What is your issue?

I was getting the following error continuously when using xarray.open_mfdataset:

ValueError: did not find a match in any of xarray's currently installed IO backends ['netcdf4', 'h5netcdf', 'scipy', 'cfgrib', 'pydap', 'zarr']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies

When the file file was indeed a netcdf4:

$ ncdump -k myfile.nc 
classic

I was running my script with the command inside a docker container, which uses a different user and group than myself. It seems the issue was on the permisions of the file as only my user had access:

$ ls -la
total 39M
-rw-r----- 1 borja borja 39M Mär 23 12:15 myfile.nc

Changing permission rights with chmod a+r myfile.nc solved the thing:

$ ls -la
total 39M
-rw-r--r-- 1 borja borja 39M Mär 23 12:15 myfile.nc

The permission thing is perfectly fine, it was my error, however, it would be nice that the command open_mfdataset (or related) would raise PermissionError when permissions are not sufficient.

@BorjaEst BorjaEst added the needs triage Issue that has not been reviewed by xarray team member label Apr 27, 2022
@dcherian dcherian added topic-backends topic-error reporting and removed needs triage Issue that has not been reviewed by xarray team member labels Apr 27, 2022
@max-sixty
Copy link
Collaborator

Thanks, that is indeed confusing from xarray, we'd definitely take a PR for this.

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

Successfully merging a pull request may close this issue.

3 participants