Unknown internal error doing a GET to /api/config-backup

Brief description of the problem

Config Backup Page not working.
After upgrading to version 4.6.1-0 I can’t access anymore.

Detailed step by step instructions to reproduce the problem

Click on Config Backup page.

Web-UI screenshot

Error Traceback provided on the Web-UI

``` [04/Aug/2023 08:56:59] ERROR [storageadmin.views.config_backup:613] [Errno 2] No such file or directory: u'/opt/rockstor/static/config-backups/backup-2023-04-10-112640.json.gz' Traceback (most recent call last): File "/opt/rockstor/src/rockstor/storageadmin/views/config_backup.py", line 610, in get_queryset with gzip.open(fp, "rb") as f: File "/usr/lib64/python2.7/gzip.py", line 34, in open return GzipFile(filename, mode, compresslevel) File "/usr/lib64/python2.7/gzip.py", line 94, in __init__ fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb') IOError: [Errno 2] No such file or directory: u'/opt/rockstor/static/config-backups/backup-2023-04-10-112640.json.gz' [04/Aug/2023 08:56:59] INFO [storageadmin.views.config_backup:616] The file backup-2023-04-10-112640.json.gz is not gzipped, so compress it now. [04/Aug/2023 08:56:59] ERROR [system.osi:244] non-zero code(1) returned by command: ['/usr/bin/gzip', '/opt/rockstor/static/config-backups/backup-2023-04-10-112640.json.gz']. output: [''] error: ['gzip: /opt/rockstor/static/config-backups/backup-2023-04-10-112640.json.gz: No such file or directory', ''] [04/Aug/2023 08:56:59] ERROR [storageadmin.middleware:33] Exception occurred while processing a request. Path: /api/config-backup method: GET [04/Aug/2023 08:56:59] ERROR [storageadmin.middleware:34] ConfigBackup object can't be deleted because its id attribute is set to None. Traceback (most recent call last): File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(*args, **kwargs) File "/opt/rockstor/.venv/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view return self.dispatch(request, *args, **kwargs) File "/opt/rockstor/.venv/lib/python2.7/site-packages/rest_framework/views.py", line 495, in dispatch response = self.handle_exception(exc) File "/opt/rockstor/.venv/lib/python2.7/site-packages/rest_framework/views.py", line 455, in handle_exception self.raise_uncaught_exception(exc) File "/opt/rockstor/.venv/lib/python2.7/site-packages/rest_framework/views.py", line 466, in raise_uncaught_exception raise exc AssertionError: ConfigBackup object can't be deleted because its id attribute is set to None. ```

So, after upgrade my backup files are gone! How to delete from the database ?

My config backups are also gone after update to 5.0.2, but “Houston…” disappeared using refresh browser. I was able to backup my configs again, but the old is gone.

1 Like

Hi,

This is a curious one… I don’t recall seeing that before. Would you be able to confirm the status of the config backup folder?

ls -lah /opt/rockstor/static/config-backups/

@Flox, I can confirm the same issue on my instance. I just did not notice because I have not looked at that transaction since before the upgrade a few weeks ago.

Looks like, the directory doesn’t exist in my case:

ls -lah /opt/rockstor/static/config-backups/

ls: cannot access '/opt/rockstor/static/config-backups/': No such file or directory

When manually creating that directory, the WebUI works again, but of course any previously saved backups are not available anymore.

And now I can create a backup or upload one (from my client PC)

2 Likes

@phillxnet, @Flox could this be related to changes in the rpmbuild?

When looking here:

during an update we’re deleting the static inventory, which also contains the config-backups if I am not mistaken.

If that’s the case we probably need to change that statement or think about moving the config-backup directory to a different place so it’s out of the line of fire …

For reference:

where MEDIA_ROOT is:

2 Likes

Oh, and @marciopamplona, welcome to the Rockstor community.

1 Like

Yes, that’s exactly it.

I intended on detailing all this when getting the chance but you’ve already done it better than I could have, so thank you :slightly_smiling_face:

@marciopamplona , @eriklysoe ,

Thank you so much for this report; you’ve highlighted an important point that needs fixing. We’ll create an issue and credit you accordingly or if you can, please feel free to do so in our repo. This will be focused on for our next testing release hopefully.

2 Likes

Yes, I confirm that directory doesn’t exist anymore.

You’re welcome @Flox.

1 Like

@marciopamplona so as a workaround for now, you could create the directory, create a new backup (sorry you lost your old ones) and download it to a place different from Rockstor so you have it until the next release takes care of keeping the directory.

2 Likes

Sure, already did, thanks for the tip.
Would be great if we can have the option to specify the target directory to store the backups, so we can store them in a safer place outside the rockstor directory.

2 Likes

I think, because it’s part of the underlying Django settings that this is not quite as straightforward. Hence the ability to download them. But we can certainly consider the feasibility of having that directory in a less critical path, though, if you do a fresh reinstall, you would lose them as well unless they were downloaded to someplace else.

2 Likes

Once again, @Hooverdan is entirely right.
@marciopamplona, glad you say that. That’s actually exactly the plan. We’ll try to move that out of the static directory and allow it to be customized by users who want to do so. We probably won’t surface such customization in the UI at first, but it’ll be doable manually. A webUI option would then be implementable next.

3 Likes

I took the liberty to create an issue on the repo. Please feel free to adjust the details/title, etc.

3 Likes