Bpy built as a py module: bpy.ops.wm.open_mainfile fails in docker

Hi there,

I built a web-frontend using django that leverages bpy as a blender module and it works well. Now it is time to deply to a cloud env and I baked a docker image.
But I have failures that occur in the image, but not in my test-env.

This typically is a result of missing libs that are assumed to be installed in a “normal” install (even though I operate already fairly barebones Void Linux machines).

But one issue that occurs in the docker image has me stumped, bpy.ops.wm.open_mainfile fails:

In [2]: bpy.ops.wm.open_mainfile(filepath="/base/eevee.blend")
Error: File format is not supported in file '/base/eevee.blend'
Error: File format is not supported in file '/base/eevee.blend'
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-cfe4d4c80a28> in <module>
----> 1 bpy.ops.wm.open_mainfile(filepath="/base/eevee.blend")

/opt/conda/envs/qwerty/lib/python3.7/site-packages/2.91/scripts/modules/bpy/ops.py in __call__(self, *args, **kw)
    130             ret = _op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
    131         else:
--> 132             ret = _op_call(self.idname_py(), None, kw)
    134         if 'FINISHED' in ret and context.window_manager == wm:

RuntimeError: Error: File format is not supported in file '/base/eevee.blend'

Any hints or tips ?

thanks, S

I’d probably check if that file got corrupted /base/eevee.blend the error you are getting is given when it tried all possible ways to read the file and nothing made sense.

Ah yes, I found the culprit. I am cloning a git repo into the docker image and the blend files are stored on LFS. Really an achilles heel that lfs.

Thanks for the heads up !