Missing X_ERR.log on Fatal Error

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Missing X_ERR.log on Fatal Error

Post by jyoung »

I have a issue on our dev iSeries box where I am getting a fatal error on the server but I am not getting anything in the X_ERR.log file.

In an effort to trouble shoot, I am tracing the execution and where it seems to be dying is on something that really should not be causing it to do so.

Perhaps someone can at least tell my why I am not getting an entry in the X_ERR.log.

Here is the error one the page.
capture1.PNG
capture1.PNG (15.62 KiB) Viewed 7415 times
Here is the last entry in the X_ERR.log. NOTICE THE DATE! Today is 9/29!
capture3.PNG
capture3.PNG (15.18 KiB) Viewed 7415 times
My trace file ends as such:
capture2.PNG
capture2.PNG (24.61 KiB) Viewed 7415 times
Where the code writing these trace lines is

Code: Select all

#SYS_APPLN.TraceMessageData( "Converting Total Open: &1" #wk_TotalOpen )
#wk_TotalOpen := #wk_TotalOpen * .01
#SYS_APPLN.TraceMessageData( "Converted Total Open: &1" #wk_TotalOpen )

#SYS_APPLN.TraceMessageData( "Converting Current Open: &1" #wk_CurrentOpen )
#wk_CurrentOpen := #wk_CurrentOpen * .01
#SYS_APPLN.TraceMessageData( "Converted Current Open: &1" #wk_CurrentOpen )

#SYS_APPLN.TraceMessageData( "Converting Open 30: &1" #wk_Open30 )
#wk_Open30 := #wk_Open30 * .01
#SYS_APPLN.TraceMessageData( "Converted Open 30: &1" #wk_Open30 )

#SYS_APPLN.TraceMessageData( "Converting Open 60: &1" #wk_Open60 )
#wk_Open60 := #wk_Open60 * .01
#SYS_APPLN.TraceMessageData( "Converted Open 60: &1" #wk_Open60 )
So it seems like it blows up on the `#wk_Open30 := #wk_Open30 * .01` statement as I never get the "Converted ..." message.

But I don't have an entry in the X_ERR.log file.

Any thoughts on why a fatal error is not getting logged?

EDIT
The above code, is in a Function that is "called" from a Server Module.

Code: Select all

#SYS_APPLN.TraceMessageData( "Executing CMGOARData" )

exchange fields(#ExchangeFields)
call process(*DIRECT) function(CMGOARData) pass_lst(#DataList)
#SYS_APPLN.TraceMessageData( "CMGOARData Completed - Status: &1" #wk_Status )
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Missing X_ERR.log on Fatal Error

Post by MarkDale »

Hi

Sometimes you find the useful error information in the Job Log, rather than the X_Err.log.

e.g. wrksplf and display the spool file for LWEB_JOB that appears when then crash occurs


5 QPJOBLOG VF19PGMLIB QEZJOBLOG LWEB_JOB RDY 4 1


(Likewise, when using the IIS server, sometimes the error information is in the windows event viewer (Application events, source = LANSA).)

You have to check in two places.

Regards
Mark Dale
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Missing X_ERR.log on Fatal Error

Post by jyoung »

Unfortunately there was nothing in, or rather there was no job log created.
I got my boss who is an iSeries guru to help me make sure that nothing was missed, I would trigger the error and we could find nothing indicating an error had happened.

Then I started thinking it was a data issue so I narrowed down the data to the record it was crashing on and everything looks fine with it.

That lead me to the work fields. These fields are not stored, they are just holders of the sums from the fetched data.

I had all these work fields in a group by as such. (they are all packed (15,2))

Code: Select all

group_by name(#MyFields) fields(#wk_TotalOpen #wk_CurrentOpen #wk_Open30)
and initializing them as

Code: Select all

#MyFields := *DEFAULT
The boss mentioned sometime bizarre things happen with null fields, such as trying to multiply a null field by something.

I traced the "nullness" of the work fields using

Code: Select all

if (#wk_Open30.IsNull)
#SYS_APPLN.TraceMessageText("Open30 is null")
endif
Much to my surprise I was getting the trace message. This after setting the group_by to *DEFAULT and whose default value is *ZEROES.

I replaced the group_by with

Code: Select all

mthroutine name(InitializeOpenFields)
#wk_TotalOpen := 0
#wk_CurrentOpen := 0
#wk_Open30 := 0
#wk_Open60 := 0
#wk_Open90 := 0
#wk_Open120 := 0
#wk_OpenOver120 := 0
endroutine
And it worked just fine.

I can't explain it. I don't understand it. I don't understand why nothing was logged about it.

But this seems to have resolved the issue.
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Missing X_ERR.log on Fatal Error

Post by MarkDale »

I think ISNull will return True for 0, so your field might actually contain 0.

From the lansa documentation:
For example, the isnull intrinsic tests the value of the supplied value and returns a true if the value is blanks or zero.

You could try .IsSQLNull.

But if you have a simple example function that does this, and crashes, I would report it to support

defines the work field Packed 15 2, default is *Zeroes
#wk_Open30 := *default
#wk_Open30 := #wk_Open30 * .01
Post Reply