/usr/bin/curl -k -u "$key":"$secret" https://$HOST/api/core/backup/download/this -o $PFPATH/$(/bin/date +%Y%m%d).xml
{"errorMessage":"Unexpected error, check log for details"}
Likely https://github.com/opnsense/core/commit/897d3cce# opnsense-patch 897d3cceCheers,Franco
Maybe applied twice? Worth checking the error log as it mentions...
[26-Jul-2024 05:02:45 America/New_York] ArgumentCountError: Too few arguments to function OPNsense\Mvc\Response::setContentType(), 1 passed in /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/BackupController.php on line 200 and exactly 2 expected in /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Response.php:64Stack trace:#0 /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/BackupController.php(200): OPNsense\Mvc\Response->setContentType('application/oct...')#1 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php(165): OPNsense\Core\Api\BackupController->downloadAction('this')#2 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(156): OPNsense\Mvc\Dispatcher->dispatch(Object(OPNsense\Mvc\Request), Object(OPNsense\Mvc\Response), Object(OPNsense\Mvc\Session))#3 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(139): OPNsense\Mvc\Router->performRequest(Object(OPNsense\Mvc\Dispatcher))#4 /usr/local/opnsense/www/api.php(36): OPNsense\Mvc\Router->routeRequest('/api/core/backu...', Array)#5 {main}
Quote from: franco on July 26, 2024, 01:38:58 pmMaybe applied twice? Worth checking the error log as it mentions... This is the error reported by the CRASH reporter, there are no other errors in any other logs.Code: [Select][26-Jul-2024 05:02:45 America/New_York] ArgumentCountError: Too few arguments to function OPNsense\Mvc\Response::setContentType(), 1 passed in /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/BackupController.php on line 200 and exactly 2 expected in /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Response.php:64Stack trace:#0 /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/BackupController.php(200): OPNsense\Mvc\Response->setContentType('application/oct...')#1 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php(165): OPNsense\Core\Api\BackupController->downloadAction('this')#2 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(156): OPNsense\Mvc\Dispatcher->dispatch(Object(OPNsense\Mvc\Request), Object(OPNsense\Mvc\Response), Object(OPNsense\Mvc\Session))#3 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(139): OPNsense\Mvc\Router->performRequest(Object(OPNsense\Mvc\Dispatcher))#4 /usr/local/opnsense/www/api.php(36): OPNsense\Mvc\Router->routeRequest('/api/core/backu...', Array)#5 {main}
$this->response->setContentType('application/octet-stream', 'UTF-8');
Changing line 200 in /usr/local/opnsense/mvc/app/controllers/OPNsense/Core/Api/BackupController.php to this fixes the issue:Code: [Select]$this->response->setContentType('application/octet-stream', 'UTF-8');Or just pulling that Git commit haha.
root@firewall:~ # opnsense-patch 897d3cceFound local copy of 897d3cce, skipping fetch.Hmm... Looks like a unified diff to me...The text leading up to this was:--------------------------|From 897d3cce3a0b5117450ff6c36db0635cf2e19591 Mon Sep 17 00:00:00 2001|From: Ad Schellevis <ad@opnsense.org>|Date: Fri, 26 Jul 2024 10:22:24 +0200|Subject: [PATCH] MVC: Response->setContentType() default to empty, closes| https://github.com/opnsense/core/pull/7655||---| src/opnsense/mvc/app/library/OPNsense/Mvc/Response.php | 2 +-| 1 file changed, 1 insertion(+), 1 deletion(-)||diff --git a/src/opnsense/mvc/app/library/OPNsense/Mvc/Response.php b/src/opnsense/mvc/app/library/OPNsense/Mvc/Response.php|index 4efd7b6069..b003b25b54 100644|--- a/src/opnsense/mvc/app/library/OPNsense/Mvc/Response.php|+++ b/src/opnsense/mvc/app/library/OPNsense/Mvc/Response.php--------------------------Patching file opnsense/mvc/app/library/OPNsense/Mvc/Response.php using Plan A...Reversed (or previously applied) patch detected! Assuming -R.Hunk #1 succeeded at 61.doneAll patches have been applied successfully. Have a nice day.root@firewall:~ #