html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/2560#issuecomment-445944423,https://api.github.com/repos/pydata/xarray/issues/2560,445944423,MDEyOklzc3VlQ29tbWVudDQ0NTk0NDQyMw==,1217238,2018-12-10T19:37:31Z,2018-12-10T19:37:31Z,MEMBER,See also https://github.com/pydata/xarray/issues/2535 for rasterio/netCDF4 issues.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-445524755,https://api.github.com/repos/pydata/xarray/issues/2560,445524755,MDEyOklzc3VlQ29tbWVudDQ0NTUyNDc1NQ==,2622379,2018-12-09T10:06:24Z,2018-12-09T10:06:24Z,NONE,"I have done a bit more testing on this, and I believe the issue may not necessarily be with ``xarray`` but with ``rasterio`` (disclaimer: I haven't tested your pull request yet).
I can reproduce the following on Ubuntu and on Travis CI. On Mac OS none of these errors occur.
Minimum example:
```python
import xarray as xr
import numpy as np
import rasterio # The rasterio import makes the last line of this code fail.
ds = xr.Dataset()
ds['data'] = (('y', 'x'), np.ones((10, 10)))
ds.to_netcdf('test.nc', engine='netcdf4')
```
I was able to fix the error by prepending a
```python
import netCDF4
```
at the very top of the script.
A very similar thing happens with ``engine='h5netcdf'``. The same script works without ``rasterio``, fails with ``rasterio``, and can be fixed by inserting ``import h5netcdf`` at the top of the script.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-445504270,https://api.github.com/repos/pydata/xarray/issues/2560,445504270,MDEyOklzc3VlQ29tbWVudDQ0NTUwNDI3MA==,1217238,2018-12-09T01:58:47Z,2018-12-09T01:58:47Z,MEMBER,"If either of you have time, it would be great if you could test out https://github.com/pydata/xarray/pull/2595 to see if that resolves your issue without requiring the environment variable.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-445502216,https://api.github.com/repos/pydata/xarray/issues/2560,445502216,MDEyOklzc3VlQ29tbWVudDQ0NTUwMjIxNg==,1217238,2018-12-09T01:06:26Z,2018-12-09T01:06:26Z,MEMBER,"OK, I think I understand what's going on here and why this issue only appears with xarray v0.11.
The problem is related to how you are opening files with xarray but not closing them:
https://github.com/limix/limix/blob/8bc0861035cc60b3ce7bcbf7f147bcc828580828/limix/qtl/test/test_qtl_xarr.py#L20
With v0.11, xarray introduced a least-recently-used cache for netCDF files. This means xarray's LRUCache is holding on to a reference to your files, so they never get garbage collected, and automatically closed by netCDF4-Python. Hence the HDF5 locks never get released.
Although it is indeed a good practice to always explicitly close files, I think we should explore using weak references to keep track of files in our cache so we don't hold on to them for holding than necessary.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-445482824,https://api.github.com/repos/pydata/xarray/issues/2560,445482824,MDEyOklzc3VlQ29tbWVudDQ0NTQ4MjgyNA==,514522,2018-12-08T19:13:08Z,2018-12-08T19:13:08Z,CONTRIBUTOR,"Sorry guys. I've found the problem and solution.
The problem is that filesystem not supporting lock mechanism. The solution is to export the following variable: `export HDF5_USE_FILE_LOCKING=FALSE`.","{""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 2, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-445276713,https://api.github.com/repos/pydata/xarray/issues/2560,445276713,MDEyOklzc3VlQ29tbWVudDQ0NTI3NjcxMw==,1217238,2018-12-07T15:57:56Z,2018-12-07T15:57:56Z,MEMBER,"if you have a simpler example, that would make things easier to debug. The error you're seeing here is basically ""HDF5 encountered an error"" which could happen for any number of reasons.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-445270674,https://api.github.com/repos/pydata/xarray/issues/2560,445270674,MDEyOklzc3VlQ29tbWVudDQ0NTI3MDY3NA==,2622379,2018-12-07T15:39:05Z,2018-12-07T15:39:05Z,NONE,I am having the exact same problem. Have you found a solution/workaround?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-440909054,https://api.github.com/repos/pydata/xarray/issues/2560,440909054,MDEyOklzc3VlQ29tbWVudDQ0MDkwOTA1NA==,514522,2018-11-22T04:25:05Z,2018-11-22T04:25:05Z,CONTRIBUTOR,https://github.com/limix/limix/blob/2.0.0/limix/qtl/test/test_qtl_xarr.py,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-440908787,https://api.github.com/repos/pydata/xarray/issues/2560,440908787,MDEyOklzc3VlQ29tbWVudDQ0MDkwODc4Nw==,1217238,2018-11-22T04:22:50Z,2018-11-22T04:22:50Z,MEMBER,Could you share a link the file in which these tests are defined? I couldn't find it on the master branch.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458
https://github.com/pydata/xarray/issues/2560#issuecomment-440907957,https://api.github.com/repos/pydata/xarray/issues/2560,440907957,MDEyOklzc3VlQ29tbWVudDQ0MDkwNzk1Nw==,1217238,2018-11-22T04:16:16Z,2018-11-22T04:16:16Z,MEMBER,"Thanks for the report!
This might be an xarray issue, or it might also be a netCDF4 issue -- I wonder if you might have different versions of libnetcdf installed locally and on Traivs-CI?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,383057458