Describe the bug
We now have an informative "Failed to create project file" error when trying to create a new project file overwriting an existing file that is currently open in another ilastik instance.
Despite catching the error that h5py runs into during the attempted file-open, the file ends up corrupted (can't be opened anymore - Unable to synchronously open file
Remainder from #3098 after dialog fix in #3226, although it seems the error message when trying to open the corrupted file has changed since then (used to be bad object header version number, now it's truncated file)
Expected behavior
The project file should still open fine after the failed attempt to overwrite it (not be corrupted)
To Reproduce
- Create a project file and open the workflow
- Start another ilastik instance
- Try to create a new project file with the same name
- Confirm overwriting the existing project (which is still open in the other instance) -> error dialog
- Back in the original instance: Close project
- Try to re-open the same project: fail with
Unable to synchronously open file
Error message/traceback
Traceback from attempting to overwrite the project file (this one is caught now and leads to the error pop up):
ERROR 2025-11-03 13:13:29,602 excepthooks 5076 21904 Unhandled exception in thread: 'MainThread'
ERROR 2025-11-03 13:13:29,621 excepthooks 5076 21904 Traceback (most recent call last):
File "C:\Program Files\ilastik-1.4.1.post1\lib\site-packages\ilastik\shell\gui\ilastikShell.py", line 612, in loadWorkflow
self.onNewProjectActionTriggered(workflow_class)
File "C:\Program Files\ilastik-1.4.1.post1\lib\site-packages\ilastik\shell\gui\ilastikShell.py", line 1518, in onNewProjectActionTriggered
self.createAndLoadNewProject(newProjectFilePath, workflow_class)
File "C:\Program Files\ilastik-1.4.1.post1\lib\site-packages\ilastik\shell\gui\ilastikShell.py", line 1529, in createAndLoadNewProject
newProjectFile = ProjectManager.createBlankProjectFile(
File "C:\Program Files\ilastik-1.4.1.post1\lib\site-packages\ilastik\shell\projectManager.py", line 151, in createBlankProjectFile
h5File = h5py.File(projectFilePath, mode="w", **h5_file_kwargs)
File "C:\Program Files\ilastik-1.4.1.post1\lib\site-packages\h5py\_hl\files.py", line 567, in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "C:\Program Files\ilastik-1.4.1.post1\lib\site-packages\h5py\_hl\files.py", line 237, 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 126, 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)
Traceback when trying to open the now corrupted project file:
ERROR 2026-08-06 15:15:00,922 log_exception 12600 13412 Traceback (most recent call last):
File "\ilastik\shell\projectManager.py", line 185, in openProjectFile
hdf5File = h5py.File(projectFilePath, mode)
File "\.conda\envs\ilastik\Lib\site-packages\h5py\_hl\files.py", line 555, in __init__
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "\.conda\envs\ilastik\Lib\site-packages\h5py\_hl\files.py", line 234, in make_fid
fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
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 106, in h5py.h5f.open
OSError: Unable to synchronously open file (truncated file: eof = 96, sblock->base_addr = 0, stored_eof = 14392)
Desktop:
- Confirmed as early as 1.4.1post1 and up to dd26c74 (after 1.4.2)
- Windows 11
Python 3.13.14 | packaged by conda-forge | (main, Jun 12 2026, 09:44:26) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import h5py
>>> h5py.__version__
'3.16.0'
Describe the bug
We now have an informative "Failed to create project file" error when trying to create a new project file overwriting an existing file that is currently open in another ilastik instance.
Despite catching the error that h5py runs into during the attempted file-open, the file ends up corrupted (can't be opened anymore -
Unable to synchronously open fileRemainder from #3098 after dialog fix in #3226, although it seems the error message when trying to open the corrupted file has changed since then (used to be
bad object header version number, now it'struncated file)Expected behavior
The project file should still open fine after the failed attempt to overwrite it (not be corrupted)
To Reproduce
Unable to synchronously open fileError message/traceback
Traceback from attempting to overwrite the project file (this one is caught now and leads to the error pop up):
Traceback when trying to open the now corrupted project file:
Desktop: