jsreport / jsreport-dotnet

jsreport .NET sdk home repository
https://jsreport.net
MIT License
63 stars 9 forks source link

Error Permission denied on Docker linux #25

Closed epozsh closed 6 years ago

epozsh commented 6 years ago

Hello,

i am getting error when i try get pdf from html using chrome-pdf.

My project is .Net core 2.1 on windows when i debug it is working well, but o docker container i get the below error. I am using last version jsreport.Local,Binary,AspnetCode,Types,Binary.linux

Part of Dockerfile is

FROM microsoft/dotnet:2.1-runtime-stretch-slim

RUN apt-get update && \   
    apt-get install -y libfontconfig1

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        libgdiplus \
    && rm -rf /var/lib/apt/lists/*
.....

Error

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1] An unhandled exception has occurred while executing the request. System.ComponentModel.Win32Exception (13): Permission denied ....\Helpers.JsReport.HtmlToPdf.getPdf(String style, String body, String meta, String filename) in ...\Helpers\JsReport\HtmlToPdf.cs:line 64 at lambda_method(Closure , Object ) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync() at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync() at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context) 2018-10-05 23:21:30 ERR An unhandled exception has occurred while executing the request.

any help?

pofider commented 6 years ago

This is now covered in the documentation. Please add to your dockerfile what is there and update jsreport.Binary.Linux to the 2.2.2 https://jsreport.net/learn/dotnet-local#docker