vrk-kpa / xroad-joint-development

Unmaintained repository. Development moved to: https://github.com/nordic-institute/X-Road-development
19 stars 8 forks source link

As a Central Server Administrator I want that a backup file is not created if error(s) happens during the creation process so that erroneous & useless backup files are not created for nothing #206

Closed hanhaka closed 6 years ago

hanhaka commented 6 years ago

Affected components: Central Server UI Affected documentation: UC-CS Estimated delivery: Q1 / 2018 External reference: https://jira.csc.fi/browse/PVAYLADEV-989

Problem If Central Server administrator tries to create a backup file but some error(s) happens during the file creation, the backup file is still created even error was encountered. However, created backup file is NOT valid and it cannot be used as restoring backup. Backup file should not be created at all in this case.

Steps to reproduce error situation:

  1. Log in to Central Server
  2. Navigate to 'Back Up and Restore' -page
  3. Push 'Back Up Configuration' -button at the of the page
  4. If error situation happens during the backup file creation process, an error message is shown (see below picture). For example error situation can be simulated by setting /etc/xroad/devices.ini so that 'xroad' user don't have access rights for that file.
  5. Backup file is however created even error happened (see below picture)
  6. Created backup file is not a valid backup, and it cannot be used as restoring CS configuration

cs failed to create backup

cs erroneous backup created

Back up functionality must be fixed so that erroneous backup file is NOT created and not shown on UI if error(s) happens during the backup file creation. Note that it is also possible to create a backup file using command line script - in this case same logic & functionality must be followed: no erroneous backup file created and error message must be shown to command line prompt.

Acceptance criteria