Error rendering report on Google App Engine



  • Hello,
    I'm trying to publish the example asp.net core web application to Google App Engine.
    It works fine on local iis but not on GAE.

    added Dockerfile and app.yaml:

    Dockerfile

    FROM gcr.io/google-appengine/aspnetcore:2.0
    COPY . /app
    WORKDIR /app
    EXPOSE 8080
    ENV ASPNETCORE_URLS=http://*:8080
    ENTRYPOINT ["dotnet", "WebApp.dll"]
    

    app.yaml

    runtime: custom
    env: flex
    

    installed jsreport.Binary.Linux package and changed Startup.cs:

    public void ConfigureServices(IServiceCollection services)
            {
                services.AddMvc();
                services.AddJsReport(new LocalReporting().UseBinary(
                    RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ?
                    jsreport.Binary.Linux.JsReportBinary.GetBinary() :
                    jsreport.Binary.JsReportBinary.GetBinary())
                    .AsUtility().Create());
            }
    

    going to the report page throws this error:
    jsreport.Local.JsReportBinaryException: Error rendering report: Error: An error occurred while trying to execute the command: at onCriticalError ([eval]:36106:25) at [eval]:36061:13 at tryCatcher ([eval]:9718:23) at Promise._settlePromiseFromHandler ([eval]:38241:31) at Promise._settlePromise ([eval]:38298:18) at Promise._settlePromise0 ([eval]:38343:10) at Promise._settlePromises ([eval]:38418:18) at Async._drainQueue ([eval]:4650:16) at Async._drainQueues ([eval]:4660:10) at Immediate.Async.drainQueues [as _onImmediate] ([eval]:4534:14) at processImmediate [as _immediateCallback] (timers.js:396:17) {"originalError":{}}(Original) Error: An error occurred while trying to start daemonized process: An error has occurred when trying to initialize jsreport.. seems like there is already a server running in port: 8080 at null.<anonymous> ([eval]:37276:13) at listener ([eval]:13761:10) at EventEmitter.emit ([eval]:13849:22) at onData ([eval]:85833:8) at Lazy.<anonymous> ([eval]:52268:13) at Lazy.<anonymous> ([eval]:52250:19) at emitTwo (events.js:87:13) at Lazy.emit (events.js:172:7) at Lazy.<anonymous> ([eval]:52251:22) at emitOne (events.js:77:13) at Lazy.emit (events.js:169:7) at yieldTo ([eval]:52358:18) at Function.<anonymous> ([eval]:52396:27) at Lazy.<anonymous> ([eval]:52364:21) at emitOne (events.js:77:13) at Lazy.emit (events.js:169:7) at Socket.<anonymous> ([eval]:52227:22) at emitNone (events.js:67:13) at Socket.emit (events.js:166:7) at emitReadable (_stream_readable.js:419:10) at emitReadable (_stream_readable.js:413:7) at readableAddChunk (_stream_readable.js:164:13) {}
    at jsreport.Local.Internal.LocalUtilityReportingService.<RenderAsync>d__10.MoveNext

    Please suggest me how to work it.
    thanks.



  • I tried various ways, but it's still not working.
    In the case of running it with docker on linux, Is the dockerfile like this?

    FROM microsoft/aspnetcore:2.0
    RUN apt-get update && \   
        apt-get install -y libfontconfig1
    WORKDIR /app
    COPY . /app
    EXPOSE 8080
    ENV ASPNETCORE_URLS=http://*:8080
    ENTRYPOINT ["dotnet", "WebApp.dll"]
    

  • administrators

    about the error on Google App Engine we are now aware of it, thanks for reporting. the problem on Google App Engine is this An error has occurred when trying to initialize jsreport.. seems like there is already a server running in port: 8080, basically when running on Google App Engine somehow an env var called PORT is set to 8080, jsreport has some logic that when the PORT env var is defined no matter what, it uses that value to bind the jsreport server on that port, so your asp .net core server and your jsreport server is trying to use the same port and that is the reason of the error. we don't have a workaround for this right now but you can keep track of the problem here and know when it is finally resolved.

    In the case of running it with docker on linux, Is the dockerfile like this?

    i don't have much experience with net core but in this post there are other steps involved in order to setup a good net core image for your app so maybe you can take a look at that and try to run it. after that it should work, as long as you are using the correct jsreport linux binary on your app.



  • Thanks for the clear explanation, I understand.
    I hope that this problem is resolved.
    For now, I have confirmed that it works fine on Google Compute Engine(Linux VM) so I will use it.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.