Why does my SimpleRisk Backup fail during Upgrade? (file_get_contents)

Introduction

With the release of SimpleRisk version 20200305-001 we have restructured our upgrade process. In doing so we are seeing a situation where users can error on attempting to backup their applications during the upgrade process. To identify if you have been affected by this please look at your apache error log. If you are seeing errors in regards to memory limitations please see: https://simplerisk.freshdesk.com/en/support/solutions/articles/6000246899-why-does-my-simplerisk-backup-fail-during-upgrade-. If you are seeing an error that looks like: [Insert TimeStamp  Here] [:error] [pid XXXXXX] [client insertclientIPhere PHP Warning:  file_get_contents(): SSL: Connection reset by peer in /var/www/html/simplerisk/includes/services.php on line 429, referer: https://mysimpleriskinstance/admin/register.php then please continue as this guide should provide a resolution. 

Before we get to the fix we should discuss a little more about the cause. This issue seems to prevail on systems using file bases php session storage. When doing this SimpleRisk is unable to use the session it should send the status 200 of completing the backup on. Because this status 200 is never returned  even though the SimpleRisk backup still takes place the upgrade process halts. This turns us toward our solution which will be to switch to database stored sessions for php.

How To Fix

This fix for this is a relatively simple one. We will need to edit your config.php to enable database session storage. 

First navigate to your simplerisk config.phpl location usually /var/www/simplerisk/includes/config.php.

Open config.php in your text editor of choice.

Find:
// Use database for sessions

define('USE_DATABASE_FOR_SESSIONS', 'false');

and replace with:


// Use database for sessions

define('USE_DATABASE_FOR_SESSIONS', 'true');

Save the file and you have completed all you need to resolve this issue.


Summary

You have now updated your session storage configuration to allow your SimpleRisk backup to go through. If you are still having problems with the backup phase of the update please review your apache error log “/var/log/apache2/error.log” in most cases and send the contents to support@simplerisk.com and we will be happy to assist you.