teleclimber / Dropserver

An application platform for your personal web services. https://dropserver.org
Apache License 2.0
42 stars 1 forks source link

Sandbox shuts down due to uncaught error in app code #123

Open teleclimber opened 3 months ago

teleclimber commented 3 months ago

If I add this line to leftovers handler:

export async function getCurrentUser(ctx:Context) {
    console.log( await fetch("http://olivierforget.net") ); // add this line
        //...

And if the request is rejected with an error of some sort, the sandbox shuts down.

error: Uncaught (in promise) TypeError: error sending request for url (https://olivierforget.net/#undefined): error trying to connect: invalid peer certificate: UnknownIssuer
    console.log( await fetch("http://olivierforget.net") );
                 ^
    at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)
    at async fetch (ext:deno_fetch/26_fetch.js:391:7)
    at async getCurrentUser (file:///[...]/Code/Leftovers/app/handlers/users.ts:5:15)

Logs from the ds-dev side:

2024/03/21 10:49:34 [001] INFO: Got request / olivierforget.net GET http://olivierforget.net/
http://olivierforget.net/
2024/03/21 10:49:34 [001] INFO: Sending request GET http://olivierforget.net/
2024/03/21 10:49:34 [001] INFO: Received response 301 Moved Permanently
2024/03/21 10:49:34 [001] INFO: Copying response to client 301 Moved Permanently [301]
2024/03/21 10:49:34 [001] INFO: Copied 41 bytes to client error=<nil>
2024/03/21 10:49:34 [002] INFO: Running 1 CONNECT handlers
2024/03/21 10:49:34 [002] INFO: on 0th handler: &{2 <nil> 0x1005b9a60} olivierforget.net:443
2024/03/21 10:49:34 [002] INFO: Assuming CONNECT is TLS, mitm proxying it
2024/03/21 10:49:34 [002] INFO: signing for olivierforget.net
2024/03/21 10:49:34 [002] WARN: Cannot handshake client olivierforget.net:443 EOF
2024/03/21 10:49:34 sandboxproxy/sandboxproxy.go:65 (SandboxProxy, ServeHTTP(), sbTransport.RoundTrip()) Error: EOF
2024/03/21 10:49:34 sandbox/sandbox.go:498 a:11 v:0.6.2 as:15 (Sandbox, monitor(), s.cmd.Wait(), Exit Status: 1) Error: exit status 1
2024/03/21 10:49:34 sandbox/sandbox.go:708 a:11 v:0.6.2 as:15 (Sandbox, kill(), process.Signal(sig). Force: false) Error: os: process already finished
http: Server closed
2024/03/21 10:49:34 sandbox/sandbox.go:675 a:11 v:0.6.2 as:15 (Sandbox, cleanup()) Sandbox 4 cleanup complete

Although this could be due to my broken proxy? To investigate more.