Problem Solving, Crash, Debugging and Trouble Shooting Issues

The purpose of this page is to help you explain why iDempiere or ADempiere is not behaving as expected. At a minimum, this information will help you get assistance from others.

If the Server Crashes

Perform the following steps (grab this data) before you restart the server:

2014-10-23 - Debugging how a Window, Tab or Field is Used - Search Code and Database

Trap the Issue in a Log File

System logs are a vital part of understanding how the system operates. Any time your iDempiere or ADempiere instance is not behaving as expected, please follow the below instructions before posting to the forum. By default, the system does not log much information. To help debug an issue, you must 'turn up the logging'. If you use my script, the default iDempiere information page is located at http://YourURL.com:8080. Below is an example. You are looking for the iDempiere Server Monitor (idempiereMonitor) link which is highlighted in red. Use u:SuperUser and p:System to log into the page. Trouble Shooting - iDempiere Server Monitor.png Perform the following:
  1. Set the Logging level to Fine. This will increase the amount of detail end  and rotate the logs.
  2. Click on the "Rotate Trace Log" link. This will create a new log file so that you do not need to search through old logs created to this point.
  3. Perform the action in iDempiere that represents the issue. This traps the issue in the current log.
  4. Click on the "Current" link to see the current log file which should now contain the details about your situation.
  5. Review the log to see if you can tell what is going on/wrong.
  6. Download or copy/paste the entire current log into a text file. Send the log text file with your email to the group.
  7. You may want to set the Trace Log Level back to "Warning" if you are concerned about disk space or performance.
Trouble Shooting - Change Logging Level.png INFO: is the setting you will use most often. Most production servers use either INFO or WARNING. The INFO setting will give you basic information, and it is helpful if something unexpected happens and you need to go back and see the details. FINE: is the setting you will use when you go to reenact the scenario. FINE gives you good visibility into what the system is doing.

Set Log Level and Download Log from iDempiere (Alternate)

You can also set the log level and download log files from inside iDempiere. Just log in with a user that has access to System Administrator role (example SuperUser). To open the below dialog, click on the logo in the upper-left corner next to the Menu Search box. Set logging level and download logs from inside iDempiere

Review the Logs

Reviewing logs can be intimidating. The best way to get started is by searching the logs on text that you believe should appear. Here are good items to find in your log to help you narrow your search:

How to Find your Record's ID

  1. Click on the record number located in the upper right corner of the below image.
  2. Look for the record's ID in the popup dialog.
Trouble Shooting - Finding a Record ID.png

SQL - How to find Locking or Blocking Sessions

See SQL Primer

SQL - Example to Review Change Logs

select * from ad_changelog_v where created between TO_TIMESTAMP('2019-05-01 13:00:00','YYYY-MM-DD HH24:MI:SS') and TO_TIMESTAMP('2019-05-01 14:00:00','YYYY-MM-DD HH24:MI:SS');

Eclipse is in a Bad State - There is are Errors Everywhere

There are times when you make a mistake. It could be a bad key press, you delete a directory, etc... Luckily, this is where source code control really helps. Here is a link with instructions to get your project back to the last committed state. If you are in this situation, please let me know if the below instruction help (either way - yes or no). Link to google group discussion

Server Crashed - Considerations and Thoughts

Your server just crashed. Below are the steps and considerations to perform your root cause analysis:
  1. Make sure your server's log is set tot the lowest level (see above). Logging is very taxing on your server (the JVM), and it can cause your server to grind to a halt.
  2. Review your logs to see what caused the crash (see above).
  3. Out of Memory is by far the single biggest issue that causes servers to crash. Make sure your server is sized according to your needs. Generally, iDempiere needs about 300MB of memory per concurrent user. This is a conservative number. The actual should be less per user.
  4. If your server is sized accordingly, and you are still running out of memory, make sure the Java heap memory setting (XMX) is set accordingly. You must tell Java how much memory it can access. The installation script automatically sets the XMX when you install iDempiere on dedicated servers (one for app server and one for DB). You can refer to the install script for how to set the XMX value. Here are the steps to see your XMX/heap memory. Log into iDempiere => Upper-Left corner => click on iDempiere logo => Info tab => Search on "heap".
  5. Database/SQL locking contentions can cause your system to halt (not necessarily crash). See SQL Primer for managing database locks.
  6. Creating plugins can cause your system to crash.
    1. Plugins can create and orphan database connections. See the above section for gaining access to the idempiereMonitor, which has a section named "DB Connection Pool" that give interesting statistics about the servers connections.
    2. Plugins can open other resources and not close them.
    3. Plugins can create excessive objects on the heap thus resulting in a higher than normal amount of heap usage
  7. Java Garbage collection is a memory intensive process. There are times when the system will run out of memory related GC. It is possible to tune GC for iDempiere.
    1. Great reference for Java 8
    2. Logilite deployment reference

JVM and Memory Profiling

Dedicated discussion

Logging in the Swing Client

To change the logging level in a Swing client, go to the Tools menu => Preference item =>Preference tab => Trace Level field. You can view the logs in one of two ways:
  1. Logs are maintained in your home directory's log folder. In my case it is /home/ubuntu/log.
  2. You can also view and download the logs through the Tools menu => Preference item =>Errors tab. You can either view the log through the dialog or download the log. See the following image.
Trouble Shooting - Swing Logging Log.png

Adding Your Own Logs

See the logging page.