Bug: Error on first backup

When the first backup is run, the SQL dump fails since the backup directory
does not yet exist. After the first try it seems to work ok.

I just wanted to report the bug.

root@PISERVER:~# pi-manage backup create
/usr/lib/python2.7/dist-packages/privacyidea/models.py:1662: SAWarning:
Unicode column received non-unicode default value.
default="/etc/privacyidea/dictionary")
No handlers could be found for logger "privacyidea.lib.stats"
The config file specified in PI_LOGCONFIG does not exist.
Could not use PI_LOGCONFIG. Using PI_LOGLEVEL and PI_LOGFILE.
Using PI_LOGLEVEL 20.
Using PI_LOGFILE /var/log/privacyidea/privacyidea.log.
The configuration name is: production
Additional configuration can be read from the file /etc/privacyidea/pi.cfg
The config file specified in PI_LOGCONFIG does not exist.
Could not use PI_LOGCONFIG. Using PI_LOGLEVEL and PI_LOGFILE.
Using PI_LOGLEVEL 20.
Using PI_LOGFILE /var/log/privacyidea/privacyidea.log.

         _                    _______  _______

___ () _____ _______ __/ / _ / __/ _ |
/ _ / __/ / |/ / _ `/ / // // // // / _// __ |
/ .
/
/ /
/|
/_,/_/_, ///// ||
/
/ /___/

/bin/sh: 1: cannot create
/var/lib/privacyidea/backup//dbdump-20160607-0823.sql: Directory nonexistent
tar: Removing leading `/’ from member names
tar: /var/lib/privacyidea/backup//dbdump-20160607-0823.sql: Cannot stat: No
such file or directory
tar: Exiting with failure status due to previous errors
Traceback (most recent call last):
File “/usr/bin/pi-manage”, line 619, in
manager.run()
File “/usr/lib/python2.7/dist-packages/flask_script/init.py”, line
405, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File “/usr/lib/python2.7/dist-packages/flask_script/init.py”, line
384, in handle
return handle(app, *positional_args, **kwargs)
File “/usr/lib/python2.7/dist-packages/flask_script/commands.py”, line
145, in handle
return self.run(*args, **kwargs)
File “/usr/bin/pi-manage”, line 169, in create
os.unlink(sqlfile)
OSError: [Errno 2] No such file or directory:
’/var/lib/privacyidea/backup//dbdump-20160607-0823.sql’
root@PISERVER:~#

Thanks!
THe “mkdir -p” call is just too late.

I will fix this.
Kind regards
CorneliusAm Dienstag, den 07.06.2016, 08:26 -0700 schrieb Aaron McCrea:

tar: /var/lib/privacyidea/backup//dbdump-20160607-0823.sql: Cannot
stat: No such file or directory


Cornelius Kölbel
@cornelinux
+49 151 2960 1417

NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798

Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel

signature.asc (836 Bytes)