geonode icon indicating copy to clipboard operation
geonode copied to clipboard

Backup fails with no such file geoserver_catalog.zip

Open NyakudyaA opened this issue 2 years ago • 0 comments

Problem

when running

python manage.py backup -c /tmp/backup/settings.ini --backup-dir=/tmp/backup/ -v 3

You encounter the error

Before proceeding with the Backup, please ensure that:
 1. The backend (DB or whatever) is accessible and you have rights
 2. The GeoServer is up and running and reachable from this machine
You want to proceed? [n]|y: y
INFO    2023-09-21 11:37:14,228 *** Dumping GeoServer catalog [http://geoserver:8080/geoserver/] into '/tmp/backup/2023-09-21_113714/geoserver_catalog.zip'
INFO    2023-09-21 11:37:14,635 Async backup status: STARTED - 1/11
INFO    2023-09-21 11:37:17,655 Async backup status: STARTED - 6/11
INFO    2023-09-21 11:37:20,735 Async backup status: COMPLETED - 11/11
WARNING 2023-09-21 11:37:23,739 [Errno 2] No such file or directory: '/tmp/backup/2023-09-21_113714/geoserver_catalog.zip'
INFO    2023-09-21 11:37:23,739 *** Dump GeoServer raster data
INFO    2023-09-21 11:37:23,739 Dumping raster data from '/geoserver_data/data/geonode'...
INFO    2023-09-21 11:37:24,066 Dumped raster data from 

This seems to emanate from https://github.com/GeoNode/geonode/blob/master/geonode/br/management/commands/backup.py#L339 which defines a backup file and https://github.com/GeoNode/geonode/blob/master/geonode/br/management/commands/backup.py#L358 which sets "overwrite": "true" This implies that the Zip should already exist

Solution

  • Either set "overwrite": "false"
  • Create an empty zip file if "overwrite": "true"

NyakudyaA avatar Sep 21 '23 15:09 NyakudyaA