Some of users of my wf-app seem to face an error 500 while working. The errors show a viewExpiredException as cause of the problem. Generally this points to a session timeout issue. But as the user fires several request within seconds it doesn't make much sense, that one of the requests should fail with error 500 while others can be served as expected.

Unfortunately the behaviour is not 100% reproducible on any dialog. The logs expose the problem for several users but there is no clear pattern to find out which behaviour leads to these errors. Do I have any chance to isolate the real issue behind these error 500 logs?

asked 13.05.2019 at 07:02

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.4k102118122
accept rate: 77%

edited 13.05.2019 at 07:36

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958


These failures often occur when AJAX requests are being fired against the Engine. In most cases an Html Dialog has already been closed in the Process (Dialog Exit Event), but the users still sees the last view (and eventually Ajax Requests are being provoked) just before the redirect to the next real page within the workflow app is being sent.

To find the ajax element on the view which causes the problem is not that easy. As there are probably many elements with AJAX capabilities within your User Dialog. But you can get close to the element by enabling request logs on the Engine. Request logs will expose all data that is sent from a Dialog User and save it for later analysis. For ajax requests this is interesting because the payload of such a request will contain the AJAX ids that are being asked to update. And with this information you should be able to detect the element on the view that fires these requests.

Client request: alt text Server side log of this request: alt text


How to enable Request Logs

WARNING: enabled request logs will produce tremendous log data. Check that enough disk space is available or the engine will even refuse to start once there is no space left.

[1.] Enable the internal tomcat request log filter in webapps/ivy/WEB-INF/web.xml by adding the following xml config:

<filter>
    <filter-name>requestdumper</filter-name>
    <filter-class>org.apache.catalina.filters.RequestDumperFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>requestdumper</filter-name>
    <url-pattern>/faces/instances/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
</filter-mapping>

alt text

[2.] Route tomcat logs into an extra request log file with the configuration/log4jconfig.xml. Do so by adding the following xml config:

<log4j:configuration debug="false" xmlns:log4j="http://jakarta.apache.org/log4j/">
    ....
    <!-- Defines a log file called request.log -->
    <appender name="requestLog" class="org.apache.log4j.DailyRollingFileAppender"> 
        <param name="File" value="${user.dir}/logs/request.log"/> 
        <param name="DatePattern" value="'.'yyyy-MM-dd"/> 
        <layout class="org.apache.log4j.IvyLog4jLayout"> 
            <param name="DateFormat" value="HH:mm:ss"/>
        </layout> 
    </appender>

    <!-- limit the pressure on the filesystem -->
    <appender name="asyncRequestLog" class="org.apache.log4j.AsyncAppender">
            <param name="BufferSize" value="50000" />
            <appender-ref ref="requestLog" />
    </appender>

    <!-- route RequestDumperFilter logs to own file -->
    <category name="org.apache.catalina.filters.RequestDumperFilter" class="ch.ivyteam.log.Logger">
      <appender-ref ref="asyncRequestLog"/> 
      <priority value="DEBUG"/>
    </category>
    ....
</log4j:configuration>

alt text

link

answered 13.05.2019 at 07:08

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 13.05.2019 at 07:45

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×79
×28
×9
×5
×4

Asked: 13.05.2019 at 07:02

Seen: 3,550 times

Last updated: 13.05.2019 at 07:45