Author's Note: This article has not been updated since initial writing. At least one significant change to my knowledge has occurred which changes the behavior in later versions. As of Caché 2018.1.6+/IRIS 2020.1.2+ versions, a code change (DP-405710) has resulted in Journal I/O Wait no longer counting the time the system spends waiting on QOS. Because of this, the failover risk regarding QOS and Journal I/O timeout is eliminated. Other system timeouts exist at larger timeout lengths which the QOS still may run afoul of (such as the Write Daemon timeout at 5 minutes), so excessive QOS timeouts are still discouraged.

I'm not familiar with INSTFREEZE and INSTATHAW, can you describe where those scripts come from?
 

However, if these are calling into the database and ultimately call the ExternalFreeze and ExternalThaw methods, the permissions for running an ExternalFreeze are more strict than those for running an ExternalThaw, which may be the root of the difference as to why thaw is succeeding and freeze is failing.

Delivered means that the message has been pulled off the queue, but hasn't been fully processed yet. Usually, this is due to a problem somewhere in the processing logic or an unhandled error performed by the component in question causing the component to hang, die, or be stuck in a loop.

The <STORE> error means that the process has run out of allowed memory and failed out.

My guess would be that something is stuck in a loop that sets more and more variables until the <STORE> error is hit, failing out the process and leaving the message stuck in the delivered state. However, you may want to open up a case with the WRC for more detailed analysis, as that is primarily speculation based on the limited data available.

I am curious as to why you would need to run the ^JRNRESTO utility programmatically. Journal restore is already automatic unless Cache is started in maintenance mode. Additionally, if you are using ^JRNRESTO regularly, you may want to open a case with the WRC, as journal restores should probably not be a regular occurrence.

In other words, what is your use case for repeated planned uses of ^JRNRESTO?