# VTKHDF file unloading on Paraview 5.13 & 6.0

**URL:** https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074
**Category:** ParaView Support
**Created:** [August 14, 2025, 1:09am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074 "2025-08-14T01:09:37Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Greg\_Burgreen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/greg_burgreen/32/16848_2.png) [@Greg\_Burgreen](https://discourse.paraview.org/u/Greg_Burgreen)
#### Post date: [August 14, 2025, 1:09am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/1 "2025-08-14T01:09:37Z")

</div>

I am writing my own VTKHDF files. After a file is read into Paraview and later the display model is deleted from the display, I cannot write to the same VTKHDF file unit again until Paraview is completely shutdown. So, the running instance of Paraview is “holding on the HDF5 file pointer” or some similar operation.

The write error is:

```auto
HDF5-DIAG: Error detected in HDF5 (1.14.1-2) thread 0:
  #000: /.../src/H5F.c line 660 in H5Fcreate(): unable to synchronously create file
    major: File accessibility
    minor: Unable to create file
... SNIP ...

```

If I delete the file after unloading it from Paraview, I am able to again write the without any HDF5 issues.

---

<div class="post-metadata">

### Author: ![Lucas\_Givord](https://discourse.paraview.org/user_avatar/discourse.paraview.org/lucas_givord/32/6851_2.png) [@Lucas\_Givord](https://discourse.paraview.org/u/Lucas_Givord)
#### Post date: [August 14, 2025, 6:54am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/2 "2025-08-14T06:54:34Z")

</div>

Hello @Greg_Burgreen,

Indeed, that’s because the reader doesn’t close the vtkhdf file after we read it so the writer can’t override the file.

Could you please open an issue on VTK as it’s probably an issue in the vtkHDFReader : [https://gitlab.kitware.com/vtk/vtk/-/issues](https://gitlab.kitware.com/vtk/vtk/-/issues) ?

Thanks!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 25, 2025, 11:45am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/3 "2025-08-25T11:45:15Z")

</div>

I think this is already fixed in ParaView 6.0: [https://gitlab.kitware.com/vtk/vtk/-/issues/19764](https://gitlab.kitware.com/vtk/vtk/-/issues/19764)

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jpmorr/32/8745_2.png) [@jpmorr](https://discourse.paraview.org/u/jpmorr)
#### Post date: [August 25, 2025, 8:07pm UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/4 "2025-08-25T20:07:10Z")

</div>

@mwestphal I can confirm this is not fixed in ParaView 6.0.0 on Windows. I still need to completely shut Paraview to overwrite a file, even if it has been removed from the pipeline browser. Using python and h5py to write the files.

```python
  File "...\writer\vtkhdf.py", line 212, in write_vtkhdf_file
    with h5py.File(self.path, 'w') as f:
         ~~~~~~~~~ ^^^^^^^^^^^^^^^^
  File "...\.venv\Lib\site-packages\h5py\_hl\files.py", line 564, in __init__
    fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
  File "...\.venv\Lib\site-packages\h5py\_hl\files.py", line 244, in make_fid
    fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
  File "h5py\\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py\\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py\\h5f.pyx", line 122, in h5py.h5f.create
OSError: [Errno 0] Unable to synchronously create file (unable to lock file, errno = 0, error message = 'No error', Win32 GetLastError() = 33)

```

Note: file paths truncated here

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 26, 2025, 7:24am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/5 "2025-08-26T07:24:07Z")

</div>

> [@jpmorr](#):
>
> Using python and h5py to write the files.
> 
> ``

What do you mean ? Please provide steps to reproduce.

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jpmorr/32/8745_2.png) [@jpmorr](https://discourse.paraview.org/u/jpmorr)
#### Post date: [August 26, 2025, 8:23am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/6 "2025-08-26T08:23:51Z")

</div>

Sorry for being unclear. If I write simualtion data out to a vtkhdf file (using python and h5py) and load it into paraview, i can view the results and data. Then I close the mesh in the pipeline viewer becuase I want to edit the data in the vtkhdf file or just overwrite it with a newer version with updated results.

However it is not possible as ParaView keeps a lock on the file until it is closed - you need to shit paraview completely, even if you have other data you are still working on, to overwrite the vtkhdf file.

If you close paraview, then you can edit or overwrite the vtkhdf file.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 26, 2025, 9:01am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/7 "2025-08-26T09:01:56Z")

</div>

This is strange because I’m able to fo the following without issue:

- run ParaView, create UnstructuredCellTypes, Apply
- File → SaveData → file.vtkhdf
- File → OpenData → file.vtkhdf
- File → SaveData → file.vtkhdf

So I would expect your python script to behave the same.

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jpmorr/32/8745_2.png) [@jpmorr](https://discourse.paraview.org/u/jpmorr)
#### Post date: [August 26, 2025, 9:19am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/8 "2025-08-26T09:19:22Z")

</div>

But I guess the difference is that you are doing all of that within ParaView? Once I close the file in the pipline browser I am opening, editing or overwriting in another external software.

My workflow is slightly different:

- Simulation solver writes .vtkhdf file
- Open in ParaView and visulaise .vtkhdf file
- Close in Paraview pipeline browser when done
- Open python kernel in vscode and attempt to edit/overwrite .vtkhdf file  
– this is when the error is thrown by vscode or pycharm

Although the file is closed in ParaView, it seem to have kept a lock on the file and prevents the write. As the original post says, if you want to write to the file you first need to delete the file if you leave ParaView open or else close ParaView.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 26, 2025, 9:21am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/9 "2025-08-26T09:21:07Z")

</div>

> [@jpmorr](#):
>
> Although the file is closed in ParaView, it seem to have kept a lock on the file and prevents the write.

This should prevent the write from ParaView as well, but I defer to @Louis_Gombert and @Lucas_Givord

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jpmorr/32/8745_2.png) [@jpmorr](https://discourse.paraview.org/u/jpmorr)
#### Post date: [August 26, 2025, 9:28am UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/10 "2025-08-26T09:28:45Z")

</div>

The earlier post by @Lucas_Givord seems to suggest this may be the case and it does seem to be reproducible across different libraries.

I didn’t see an issue open - should i add one?

---

<div class="post-metadata">

### Author: ![Louis\_Gombert](https://discourse.paraview.org/user_avatar/discourse.paraview.org/louis_gombert/32/14576_2.png) [@Louis\_Gombert](https://discourse.paraview.org/u/Louis_Gombert)
#### Post date: [August 26, 2025, 3:11pm UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/11 "2025-08-26T15:11:25Z")

</div>

does your simulation solver close the file properly? I have only tested on Linux but could not seem to reproduce the issue with the steps here: [https://gitlab.kitware.com/vtk/vtk/-/issues/19764#note\_1694694](https://gitlab.kitware.com/vtk/vtk/-/issues/19764#note_1694694)

---

<div class="post-metadata">

### Author: ![jpmorr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jpmorr/32/8745_2.png) [@jpmorr](https://discourse.paraview.org/u/jpmorr)
#### Post date: [August 29, 2025, 6:21pm UTC](https://discourse.paraview.org/t/vtkhdf-file-unloading-on-paraview-5-13-6-0/17074/12 "2025-08-29T18:21:07Z")

</div>

Yes, it’s closed by the python context manager in all cases. I’m on windows but I’ll check on my linux workstation next week.
