lonely-lockley / archinsight

Simplicity in Code, Power in Design
https://archinsight.org
GNU Affero General Public License v3.0
55 stars 5 forks source link

Lot of internal server errors on BFF #21

Closed lonely-lockley closed 2 years ago

lonely-lockley commented 2 years ago

I can see a lot of errors in BFF logs

bff          | [Nest] 1  - 07/14/2022, 8:08:12 AM   ERROR [ExceptionsHandler] Converting circular structure to JSON
bff          |     --> starting at object with constructor 'ClientRequest'
bff          |     |     property 'socket' -> object with constructor 'Socket'
bff          |     --- property '_httpMessage' closes the circle
bff          | TypeError: Converting circular structure to JSON
bff          |     --> starting at object with constructor 'ClientRequest'
bff          |     |     property 'socket' -> object with constructor 'Socket'
bff          |     --- property '_httpMessage' closes the circle
bff          |     at JSON.stringify (<anonymous>)
bff          |     at RenderService.getError (/app/render/render.service.js:47:36)
bff          |     at /app/render/render.service.js:30:38
bff          |     at runMicrotasks (<anonymous>)
bff          |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
bff          |     at async RenderController.getImage (/app/render/render.controller.js:25:25)
bff          |     at async /app/node_modules/@nestjs/core/router/router-execution-context.js:46:28
bff          |     at async /app/node_modules/@nestjs/core/router/router-proxy.js:9:17

Would like to find out a reason

lonely-lockley commented 2 years ago

This happens when compiler backend reports an error

compiler     | 08:14:40.736 ERROR [default-nioEventLoopGroup-1-11] i.m.http.server.RouteExecutor - Unexpected error occurred: Unable to compile the source
compiler     | [kind=ERROR, line=22, message=cannot find symbol
compiler     |   symbol:   variable request
compiler     |   location: class com.github.lonelylockley.archinsight.gen.tms.Container]
compiler     | org.mdkt.compiler.CompilationException: Unable to compile the source
compiler     | [kind=ERROR, line=22, message=cannot find symbol
compiler     |   symbol:   variable request
compiler     |   location: class com.github.lonelylockley.archinsight.gen.tms.Container]
compiler     |  at org.mdkt.compiler.InMemoryJavaCompiler.compileAll(InMemoryJavaCompiler.java:106)

This behaviour can be reproduced with the following Insight language script:

container tms

service one
    name = One

service two
    name = Two

one -> twoo