Documenting this so future me's can find it. In our setup, we are publishing XML files to a local folder to the server. Our SAP system reads that folder and processes files that it finds. BGMS logs reported these errors when publishing:
2025-08-11 15:59:23,795 INFO [SessionThread-91] wt.system.err - java.io.FileNotFoundException: /mnt/sap-prd/inbound/ESIResponse_<Redacted>_11492.xml (Permission denied)
2025-08-11 15:59:23,795 INFO [SessionThread-91] wt.system.err - at java.base/java.io.FileOutputStream.open0(Native Method)
2025-08-11 15:59:23,795 INFO [SessionThread-91] wt.system.err - at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
2025-08-11 15:59:23,795 INFO [SessionThread-91] wt.system.err - at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
2025-08-11 15:59:23,795 INFO [SessionThread-91] wt.system.err - at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:155)
2025-08-11 15:59:23,796 ERROR [SessionThread-91] tasks.com.ptc.windchill.esi.export.ExportToFile - Error while executing the Write-To-File webject. com.infoengine.util.IEException; nested exception is:
java.io.FileNotFoundException: /mnt/sap-prd/inbound/ESIResponse_<Redacted>_11492.xml (Permission denied)
at com.ptc.windchill.esi.lite.tgt.webject.WriteToFile.writeToFile(WriteToFile.java:368)
at com.ptc.windchill.esi.lite.tgt.webject.WriteToFile.writeToFile(WriteToFile.java:218)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.io.FileNotFoundException: /mnt/sap-prd/inbound/ESIResponse_<Redacted>_11492.xml (Permission denied)
RHEL 9.2. User running Windchill does indeed have writes to create files in that folder. I verified myself by creating a file.
Solved! Go to Solution.
And the cause was SELinux:
node=hostname type=AVC msg=audit(1754942363.791:4835): avc: denied { write open } for pid=3174 comm="SessionThread-9" path="/mnt/sap-prd/inbound/ESIResponse_<redacted>_11492.xml" dev="cifs" ino=281474977235101 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:cifs_t:s0 tclass=file permissive=0
Was caused by:
Missing type enforcement (TE) allow rule.
I used the standard audit2allow -a -w and audit2allow -a -M <something> to load a new policy. I had to do it twice to pick up all the blocks. Hope this helps.
And the cause was SELinux:
node=hostname type=AVC msg=audit(1754942363.791:4835): avc: denied { write open } for pid=3174 comm="SessionThread-9" path="/mnt/sap-prd/inbound/ESIResponse_<redacted>_11492.xml" dev="cifs" ino=281474977235101 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:cifs_t:s0 tclass=file permissive=0
Was caused by:
Missing type enforcement (TE) allow rule.
I used the standard audit2allow -a -w and audit2allow -a -M <something> to load a new policy. I had to do it twice to pick up all the blocks. Hope this helps.
