I wrote a little web service using Scott's YAJLINTO and YAJLDTAGEN. It works great until the request gets to about 8 array elements, about 6K of JSON. Then every second or third request returns error 500. The QZSRCGI job doesn't log anything, but the HTTP server error log gets the following:
ZSRV_MSG0108: Header from script is not valid. Bad header is ---------------- Start ---------------:
ZSRV_MSG0108: Header from script is not valid. Bad header is EndStruct: File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is 'sell_buy_conv_fact': File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is EndStruct: File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is uyer_number': File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is t: File name is
I don't know what generates the "EndStruct" or "---Start---" text, but the "'sell_buy_conv_fact'" and "uyer_number'" text are bits of the request JSON. So if I understand correctly, it seems like bits of the request are making their way into stdout and corrupting the response headers. Am I getting that right? Any ideas how that could happen?
ZSRV_MSG0108: Header from script is not valid. Bad header is ---------------- Start ---------------:
ZSRV_MSG0108: Header from script is not valid. Bad header is EndStruct: File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is 'sell_buy_conv_fact': File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is EndStruct: File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is uyer_number': File name is
ZSRV_MSG0108: Header from script is not valid. Bad header is t: File name is
I don't know what generates the "EndStruct" or "---Start---" text, but the "'sell_buy_conv_fact'" and "uyer_number'" text are bits of the request JSON. So if I understand correctly, it seems like bits of the request are making their way into stdout and corrupting the response headers. Am I getting that right? Any ideas how that could happen?
Code:
data-into req %data('*STDIN' : 'case=convert countprefix=num_ allowextra=yes allowmissing=yes') %parser('YAJLINTO'); ... data-gen res %data(ResBuffer : 'countprefix=num_') %gen('YAJL/YAJLDTAGEN' : '{"http status": ' + HTTP_Sts + ', "write to stdout": true}');
Comment