Content
Updated by Tizian Rößler 14 days ago
### Steps to reproduce
1. Install BIM edition via k8s
2. Make sure `global.containerSecurityContext.readOnlyRootFilesystem` is set to true (default on many k8s clusters)
3. Try importing an IFC file
<br>
<br>
### What is the buggy behavior?
* You can get an error:
openproject-worker-default-7f65b7df6b-hfcgs openproject E, \[2025-05-30T08:08:24.601783 #7\] ERROR -- : \[Activelob\] \[Bim::IfcModels::IfcConversionJob\] \[3b3cd60b-d899-de
da-986e-daaefblbe69d\] Failed to convert IFC model #<Bim::IfcModels::IfcModel conversion\_status: "error®, title: "D7-301", id: 5, created\_at: "2025-05-30 08:08:22.6135
37000 +0000", updated\_at: "2025-05-30 08:08:24.587430261 +0000", project\_id: 13, uploader\_id: 8, is\_default: false, conversion\_error\_message: "Failed to convert model
to dae: terminate called a Failed to convert model to dae: terminate called after throwing an instance of 'COLLADASW: :StreamwWriterException
<br>
* Unfortunately this only happens on some systems
* When running the command manually `IfcConvert --use-element-guids --no-progress --verbose --threads 4 /tmp/minimal.ifc /tmp/minimal.dae --exclude entities IfcOpeningElement` you get the following error:
IfcOpenShell IfcConvert 0.7.11-fea8e3a5c (0CC 7.5.3)
Creating geometry...
Done creating geometry (215 objects)
Done writing geometry (215 objects)
Unable to write output file &#39;/tmp/minimal.dae&#39;, see &#39;.ifcopenshell.QOLQZUTP.tmp&#39; for the conversion result.
Log:
\[Notice\] \[2025-06-10 11:45:54\] exclude entities IfcOpeningElement
\[Notice\] \[2025-06-10 11:45:55\] Created 43 tasks for 215 products
\[Notice\] \[2025-06-10 11:45:55\] Initializing mapping took 23.924104ms
\[Notice\] \[2025-06-10 11:45:55\] Performing mapping took 0.020219ms
\[Notice\] \[2025-06-10 11:45:55\] Geometry interpretation took 32.721024ms
\[Notice\] \[2025-06-10 11:45:55\] Geometry interpretation took 32.721024ms
<br>
* When using `-threads 64` or not using the `--threads` parameter at all, it works
### What is the expected behavior?
1. Allow to configure the number of threads so that the users can configure a setting that works on their system system
<br>
### Analyze <br>
<br>
[Dir.mktmpdir](https://github.com/opf/openproject/blob/v16.0.1/modules/bim/app/services/bim/ifc_models/view_converter_service.rb#L60) is trying to create the folder in `/app/<random_folder_name>` it should create the folder in `/tmp/<random_folder_name>` or in `/app/tmp/<random_folder_name>` instead.
Also, IfcConvert is writing a temporary file to `pwd` dring conversion what is also `/app` on default, so the directory needs to be changed before calling `IfcConvert`
### Workaround
<br>
Building a custom container with the Dockerfile and the view\_converter\_service.rb attached to this work package and use it instead of the official container.
<br>
<br>
1. Install BIM edition via k8s
2. Make sure `global.containerSecurityContext.readOnlyRootFilesystem` is set to true (default on many k8s clusters)
3. Try importing an IFC file
<br>
<br>
### What is the buggy behavior?
* You can get an error:
openproject-worker-default-7f65b7df6b-hfcgs openproject E, \[2025-05-30T08:08:24.601783 #7\] ERROR -- : \[Activelob\] \[Bim::IfcModels::IfcConversionJob\] \[3b3cd60b-d899-de
da-986e-daaefblbe69d\] Failed to convert IFC model #<Bim::IfcModels::IfcModel conversion\_status: "error®, title: "D7-301", id: 5, created\_at: "2025-05-30 08:08:22.6135
37000 +0000", updated\_at: "2025-05-30 08:08:24.587430261 +0000", project\_id: 13, uploader\_id: 8, is\_default: false, conversion\_error\_message: "Failed to convert model
to dae: terminate called a Failed to convert model to dae: terminate called after throwing an instance of 'COLLADASW: :StreamwWriterException
<br>
* Unfortunately this only happens on some systems
* When running the command manually `IfcConvert --use-element-guids --no-progress --verbose --threads 4 /tmp/minimal.ifc /tmp/minimal.dae --exclude entities IfcOpeningElement` you get the following error:
IfcOpenShell IfcConvert 0.7.11-fea8e3a5c (0CC 7.5.3)
Creating geometry...
Done creating geometry (215 objects)
Done writing geometry (215 objects)
Unable to write output file &#39;/tmp/minimal.dae&#39;, see &#39;.ifcopenshell.QOLQZUTP.tmp&#39; for the conversion result.
Log:
\[Notice\] \[2025-06-10 11:45:54\] exclude entities IfcOpeningElement
\[Notice\] \[2025-06-10 11:45:55\] Created 43 tasks for 215 products
\[Notice\] \[2025-06-10 11:45:55\] Initializing mapping took 23.924104ms
\[Notice\] \[2025-06-10 11:45:55\] Performing mapping took 0.020219ms
\[Notice\] \[2025-06-10 11:45:55\] Geometry interpretation took 32.721024ms
\[Notice\] \[2025-06-10 11:45:55\] Geometry interpretation took 32.721024ms
<br>
* When using `-threads 64` or not using the `--threads` parameter at all, it works
### What is the expected behavior?
1. Allow to configure the number of threads so that the users can configure a setting that works on their system
<br>
### Analyze
<br>
[Dir.mktmpdir](https://github.com/opf/openproject/blob/v16.0.1/modules/bim/app/services/bim/ifc_models/view_converter_service.rb#L60) is trying to create the folder in `/app/<random_folder_name>` it should create the folder in `/tmp/<random_folder_name>` or in `/app/tmp/<random_folder_name>` instead.
Also, IfcConvert is writing a temporary file to `pwd` dring conversion what is also `/app` on default, so the directory needs to be changed before calling `IfcConvert`
### Workaround
<br>
Building a custom container with the Dockerfile and the view\_converter\_service.rb attached to this work package and use it instead of the official container.
<br>
<br>