Issue

There are hundreds of files in the /tmp directory. Each file is 11,841 KB in size. The file name structure is qt_temp.xxxxx, where xxxxx is some random string.  The files are filled with messages similar to these:

Failed to send statistics report (open error): The requested resource is busy.

Failed to remove statistics file /usr/local/zendsvr6/tmp/stats/dLXK67.zstat . The requested resource is busy.

QSafeSqlQuery::exec -> error in query: insert into stats_daily (id, entry_type_id, entry_sub_type_id, app_id, node_id, counter_value, from_time, until_time, user_module, namespace, samples) values (NULL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?). [attempt to write a readonly database Unable to fetch row]

Environment

Zend Server for IBM i running on any supported version of IBM i.

Resolution

The messages indicate the statistics data base is damaged. Please try rebuilding it.  After completing this procedure, the old statistics will be gone, but new statistics will begin to accumulate.

This procedure will require a restart of Zend Server, so please schedule it for a time when it is OK for your site to be down for a few minutes.

For versions Zend Server 2020.0.x and higher

Please open Navigator and navigate to /usr/local/zendphp74/var/db

Expand the db folder and locate file statistics.db.

Leave Navigator open, and go to your 5250 emulator.  From the 5250 command line:

go zendphp74/zsvmenu

Use option '2. Stop Zend Server Subsystem'. From the command line at the bottom of the menu:

wrkactjob sbs(zendphp74)

Make sure there are no jobs running in this subsystem. If there are any, use F5 to re-display a few times, until the jobs are all gone. When the jobs are all gone, press enter to return to the menu.

Please go back into Navigator. Right click on the statistics.db file and select 'Rename...'. Rename the file to something like statistics.db.old. The name is arbitrary. Just use something so you can recognize the renamed file later when you decide to delete it.

Return to the 5250 emulator, where you should still be on the Zend Server for IBM i Service Menu. Use option '1. Start Zend Server Subsystem'. From the command line at the bottom of the menu:

wrkactjob sbs(zendphp74)

Make sure the ZSDAEMON jobs have restarted. If needed, use F5 a few times until the jobs have appeared. These are the jobs you are looking for:

ZSDAEMON     QTMHHTTP    BCI      .0  PGM-watchdog
ZSDAEMON     QTMHHTTP    BCI      .0  PGM-zsd    

Return to Navigator and use F5 to refresh the display. Verify that there is a new statistics.db file.

After resuming normal operation of your web site, check the /tmp directory to verify that the qt_temp.xxxxx files have stopped proliferating.  You may delete the old renamed statistics data base file whenever you like.

For versions Zend Server 9.1.x, 2018.0.x, 2019.0.x 

Please open Navigator and navigate to /usr/local/zendphp7/var/db

Expand the db folder and locate file statistics.db.

Leave Navigator open, and go to your 5250 emulator.  From the 5250 command line:

go zendphp7/zsvmenu

Use option '2. Stop Zend Server Subsystem'. From the command line at the bottom of the menu:

wrkactjob sbs(zendphp7)

Make sure there are no jobs running in this subsystem. If there are any, use F5 to re-display a few times, until the jobs are all gone. When the jobs are all gone, press enter to return to the menu.

Please go back into Navigator. Right click on the statistics.db file and select 'Rename...'. Rename the file to something like statistics.db.old. The name is arbitrary. Just use something so you can recognize the renamed file later when you decide to delete it.

Return to the 5250 emulator, where you should still be on the Zend Server for IBM i Service Menu. Use option '1. Start Zend Server Subsystem'. From the command line at the bottom of the menu:

wrkactjob sbs(zendphp7)

Make sure the ZSDAEMON jobs have restarted. If needed, use F5 a few times until the jobs have appeared. These are the jobs you are looking for:

ZSDAEMON     QTMHHTTP    BCI      .0  PGM-watchdog
ZSDAEMON     QTMHHTTP    BCI      .0  PGM-zsd    

Return to Navigator and use F5 to refresh the display. Verify that there is a new statistics.db file.

After resuming normal operation of your web site, check the /tmp directory to verify that the qt_temp.xxxxx files have stopped proliferating.  You may delete the old renamed statistics data base file whenever you like.

For versions 6 - 8.5.x

Please open Navigator and navigate to /usr/local/zendsvr6/var/db

Expand the db folder and locate file statistics.db.

Leave Navigator open, and go to your 5250 emulator.  From the 5250 command line:

go zendsvr6/zsvmenu

Use option '2. Stop Zend Server Subsystem'. From the command line at the bottom of the menu:

wrkactjob sbs(zendsvr6)

Make sure there are no jobs running in this subsystem. If there are any, use F5 to re-display a few times, until the jobs are all gone. When the jobs are all gone, press enter to return to the menu.

Please go back into Navigator. Right click on the statistics.db file and select 'Rename...'. Rename the file to something like statistics.db.old. The name is arbitrary. Just use something so you can recognize the renamed file later when you decide to delete it.

Return to the 5250 emulator, where you should still be on the Zend Server for IBM i Service Menu. Use option '1. Start Zend Server Subsystem'. From the command line at the bottom of the menu:

wrkactjob sbs(zendsvr6)

Make sure the ZSDAEMON jobs have restarted. If needed, use F5 a few times until the jobs have appeared. These are the jobs you are looking for:

ZSDAEMON     QTMHHTTP    BCI      .0  PGM-watchdog
ZSDAEMON     QTMHHTTP    BCI      .0  PGM-zsd    

Return to Navigator and use F5 to refresh the display. Verify that there is a new statistics.db file.

After resuming normal operation of your web site, check the /tmp directory to verify that the qt_temp.xxxxx files have stopped proliferating.  You may delete the old renamed statistics data base file whenever you like.