We recently upgrade to the latest of Episerver Commerce 13.24.0 and Episerver CMS to 11.19.0
Since the upgrade we are seeing this below error in(red) "Maintain Database Indexes". It takes about 30 minutes to 20 minutes and then times out. In integration environment I have tried executing the queries (SP "EpiAzureSQLMaintenance" in both cms and commerce DB) directly and they seem to run just fine, and finish in seconds. But when running via the sceduled job, it fails.
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. [The wait operation timed out]
That is strange. But you can just run the script on production DB as well. time out usually happens when the indexes are very fragmented, so if you pre-defrag them it will take less time to rebuild.
You can also adjust episerver::DataBaseIndicesJobCommandTimeOut to even higher value. But if that does not help then you are welcome to contact developer support service for further assistance
We are hosted in DCX. So can't really do anything on production DB. Will try to increase the value of this config and see if that helps. Or else create a support ticket where they can give us more detailed error logs.
I had this same error once. So I wrote to support desk and they ran it manually during off-peak hours. After that I changed the scheduled job to run slightly more often.
You can request managed services to maintain the indexes for you. They have a runbook for DXP which does the same as the script