Avoid raising 500 error when restore fail because of wrong status
We should warn user that restore might not work when backup status is not healthy.
| [2023-04-30 07:22:21,730][ERROR ][86.49.248.132][admin][CP Server Thread-6][cherrypy.error.140064994595936] HTTP |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Traceback (most recent call last): |
| File "/opt/minarca-server/lib/python3.9/site-packages/cherrypy/_cprequest.py", line 638, in respond |
| self._do_respond(path_info) |
| File "/opt/minarca-server/lib/python3.9/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond |
| response.body = self.handler() |
| File "/opt/minarca-server/lib/python3.9/site-packages/cherrypy/lib/encoding.py", line 223, in __call__ |
| self.body = self.oldhandler(*args, **kwargs) |
| File "/opt/minarca-server/lib/python3.9/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__ |
| return self.callable(*self.args, **self.kwargs) |
| File "/opt/minarca-server/lib/python3.9/site-packages/rdiffweb/controller/page_restore.py", line 121, in default |
| filename, fileobj = repo.restore(path, int(date), kind=kind) |
| File "/opt/minarca-server/lib/python3.9/site-packages/rdiffweb/core/librdiff.py", line 1222, in restore |
| raise CalledProcessError(1, cmdline, output) |
| subprocess.CalledProcessError: Command '[b'/opt/minarca-server/bin/python3', b'-m', b'rdiffweb.core.restore', b'--restore-as-of', b'1677701006', b'--encoding', b'utf-8', b'--kind', b'tar.gz', b'/backups/admin/vmtests-iPro-2/', b'-']' returned non-zero exit status 1. |
| [2023-04-30 07:22:21,731][ERROR ][86.49.248.132][admin][CP Server Thread-6][rdiffweb.rdw_app] error page: 500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. |
Edited by Patrik Dufresne