[BUG] Unable to download backup file from UI
sandrobordacchini opened this issue · 2 comments
sandrobordacchini commented
Describe the bug
The Download Backup button returns an error
To Reproduce
Steps to reproduce the behavior:
- Go to 'System Settings -> Backup and Restore'
- Click on 'Download Backup' button
- See error:
{"error":"server","msg":"send_file() got an unexpected keyword argument 'attachment_filename'"}
Expected behavior
Download of backup (an sql file) was expected
Screenshots
When this happens i get in /var/log/dsiprouter.log:
[2023-04-13 14:37:42] [5141->140142923573056] [ERROR]: ((( EXCEPTION )))
[CLASS]: <class 'TypeError'>
[VALUE]: send_file() got an unexpected keyword argument 'attachment_filename'
((( BACKTRACE )))
[FILE]: /opt/dsiprouter/gui/modules/api/api_routes.py
[LINE NUM]: 2712
[FUNCTION]: createBackup()
[SOURCE]: return send_file(backup_path, attachment_filename=backup_name, as_attachment=True), StatusCodes.HTTP_OK
Server Info:
- OS:
Linux lbvms 4.19.0-23-amd64 #1 SMP Debian 4.19.269-1 (2022-12-20) x86_64 GNU/Linux
- Distro:
Debian GNU/Linux 10 (buster)
- dSIPRouter Version: 0.72 (6cd2148)
- Kamailio Version: kamailio 5.5.6 (x86_64/linux)
- Python Package Versions: see python3.txt attached file
Client Info:
- Device: PC
- OS: Windows 10
- Client Software: Chrome 111
Additional context
I have a similar installation (same OS) with a dsiprouter 0.70 (8b22e9b) and the download works ok.
devopsec commented
Flask API for send_file
changed in the newer version.
ref: https://flask.palletsprojects.com/en/2.2.x/api/#flask.send_file
devopsec commented
resolved in v0.721