dOpensource / dsiprouter

UI Interface for implementing Kamailio to provide PBX Hosting and SIP Trunking Services
https://dsiprouter.org
Apache License 2.0
196 stars 105 forks source link

[BUG] Unable to download backup file from UI #503

Closed sandrobordacchini closed 1 year ago

sandrobordacchini commented 1 year ago

Describe the bug The Download Backup button returns an error

To Reproduce Steps to reproduce the behavior:

  1. Go to 'System Settings -> Backup and Restore'
  2. Click on 'Download Backup' button
  3. 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:

Client Info:

Additional context I have a similar installation (same OS) with a dsiprouter 0.70 (8b22e9b31399a0fe4c58969bd63304518fbb5539) and the download works ok.

devopsec commented 1 year ago

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 1 year ago

resolved in v0.721