Error when exporting XLSX Sonta Stats

An unexpected error has occurred

when try to export XLS from outbound calls sonata stats

Please provide some more information. Version of VitalPBX, Sonata Stats, Browser you used, screenshot
of the error etc etc tec.

VitalPBX Enterprise 3.2.1-1
Asterisk 18.10.0-1
Sonata Stats 1.0.6-2
All Browsers

image

Thank you for the reporting the issue, is this happening when you try to import the summary or the list?

1 Like

Have you updated your sonata stats installation?

1 Like

when trying to export the detailed list ,
and already updated the installation and tried to uninstall and install the addon with no solution

Could you please open the browser console and check if you see any error messages also check if there are any files in this location /usr/share/sonata/queues-stats/backend/storage/logs/ if you see any please share it

1 Like

the log file is here

[2022-05-24 14:30:17] production.ERROR: The filename and the fallback cannot contain the “/” and “” characters. {“userId”:1,“exception”:"[object] (InvalidArgumentException(code: 0): The filename and the fallback cannot contain the “/” and “\” characters. at /usr/share/sonata/queues-stats/backend/vendor/symfony/http-foundation/HeaderUtils.php:185)
[stacktrace]
#0 /usr/share/sonata/queues-stats/backend/vendor/symfony/http-foundation/ResponseHeaderBag.php(269): Symfony\Component\HttpFoundation\HeaderUtils::makeDisposition(‘attachment’, ‘outgoing calls …’, ‘outgoing calls …’)
#1 /usr/share/sonata/queues-stats/backend/vendor/symfony/http-foundation/BinaryFileResponse.php(176): Symfony\Component\HttpFoundation\ResponseHeaderBag->makeDisposition(‘attachment’, ‘outgoing calls …’, ‘outgoing calls …’)
#2 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(168): Symfony\Component\HttpFoundation\BinaryFileResponse->setContentDisposition(‘attachment’, ‘outgoing calls …’, ‘outgoing calls …’)
#3 /usr/share/sonata/queues-stats/backend/vendor/maatwebsite/excel/src/Excel.php(86): Illuminate\Routing\ResponseFactory->download(’/tmp/laravel-ex…’, ‘outgoing calls …’, Array)
#4 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Maatwebsite\Excel\Excel->download(Object(App\Exports\ExportCsvXlsx), ‘outgoing calls …’)
#5 /usr/share/sonata/queues-stats/backend/app/Exports/ReportExport.php(0): Illuminate\Support\Facades\Facade::__callStatic(‘download’, Array)
#6 /usr/share/sonata/queues-stats/backend/app/Http/Controllers/Api/OutgoingCallsDetailController.php(0): App\Exports\ReportExport::export(Object(Illuminate\Support\Collection), ‘xlsx’, ‘outgoing calls …’, ‘outgoing calls …’, ‘2022-05-24 00:0…’, ‘2022-05-24 23:5…’, ‘collection’)
#7 [internal function]: App\Http\Controllers\Api\OutgoingCallsDetailController->__invoke(Object(App\Http\Requests\StatsFilterOutgoingCallsDetailRequest))
#8 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#9 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction(’__invoke’, Array)
#10 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\Api\OutgoingCallsDetailController), ‘__invoke’)
#11 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#12 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(681): Illuminate\Routing\Route->run()
#13 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#14 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authorize.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Auth\Middleware\Authorize->handle(Object(Illuminate\Http\Request), Object(Closure), ‘outgoing_calls’)
#16 /usr/share/sonata/queues-stats/backend/app/Http/Middleware/CheckApp.php(0): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#17 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): App\Http\Middleware\CheckApp->handle(Object(Illuminate\Http\Request), Object(Closure))
#18 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#19 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Auth\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure), ‘api’)
#22 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(683): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#24 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(658): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#25 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(624): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#26 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Routing/Router.php(613): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#27 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(170): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#28 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(130): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#29 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#31 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#32 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#33 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#34 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(63): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /usr/share/sonata/queues-stats/backend/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(171): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(105): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(145): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#41 /usr/share/sonata/queues-stats/backend/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#42 /usr/share/sonata/queues-stats/backend/public/index.php(0): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#43 {main}
"}

Thank you we’ll analyse it

The issue is happening because of the / character which is not valid for a file, you can remove that character from the extensions as a temporary workaround, you can also send me an email to this address roger@vitalpbx.com and I can provide you instructions to apply a patch.

1 Like

I emailed you
And thanks for your assistance