Question
· Jan 26, 2022

$ZF(-100) Troubles

Hello guys! I need some assistance with these problems I have.

The first one is that I need to execute a Python file, which is at /XY path. This PY is supposed to read an excel file and create a CSV version in /XZ path.

I am quite sure that the PY file is correct, but when using this function I get nothing but this error:

SET tSC = $ZF(-100,"/ASYNC /SHELL ", "python", "/data/InterSystems/IRIS/mgr/TEST01CODE/ExcelReading/ExcelToCSV.py")

ConfigItem 'FJ EXCEL READING' (FJ.BS.ExcelReading) started in job 3164

ERROR #00: (sin descripción de error)

Any ideas or suggestions?

The second error I have is very similar, but this time I need to Unzip a file in /XY path and leave the result in /XZ path using GNU/Linux commands. I have tried some varieties of this code:

SET tSC = $ZF(-100,"/ASYNC /SHELL ", "unzip '*.zip'", "/data/InterSystems/IRIS/mgr/TEST01CODE/ZipFiles")

From this I get the same error result from first case. Both are just Business Services with nothing but a Try Catch and Ens.InboundAdapter.

The folders are already created in their respective paths.

Thank you for your time and help!
 

Product version: IRIS 2020.1
$ZV: IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:23:13 EDT
Discussion (2)2
Log in or sign up to continue

Why not to use
strace -p <pid>
where the process is serving terminal (W $J, run set ret=$zu(-100,...) )
or host process in interoperability infrastructure
to check what is wrong from point of view of syscalls.
A quite standard way to figure out what goes wrong.
terminal and service process has different uid,gid.
terminal uid,gid has of logged user
and user make sence have irisusr supplement group in order
to run iris session ok.
service process (in particular BusinessService) uid,gid has irisusr:irisusr.
unless uid and gid has no relationship and use different name.
gid name might be changed in installer, irisusr is 'fixed',
but it might be changed in /etc/passwd.
to know process uid,gid
ps -eo pid,uid,gid,args | grep irisdb
check dir access right from
/data/InterSystems/IRIS/mgr/TEST01CODE
and below.

For zip case, I would use command pipe and one parses output
in order to know the result of operation.

This is what finally worked for me. /ASYNC was generating ERROR #00: (sin descripción de error)

set var0 ="python"
set var1 ="/path/to/python.py"
set var2 ="/path/to/file.xlsx"
set var3 ="/path/where/csv/file/goes/"

SET args = 3
SET args(1)=var1
SET args(2)=var2
SET args(3)=var3 var0_" "_var1_" "_var2_" "_var3,!

$ZF(-100 ,"/SHELL /LOGCMD" , var0 , .args)