Open malte-v opened 4 years ago
Hi.
[CRITICAL][APP] invalid dap result from ghci. []
This seems that haskell-debug-adapter lost stdio handle to ghci-dap.
Could you run these commands from the console? and let me know the console result.
> cd /home/malte/testing/reflex-stack
> stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is app --ghci-options -fprint-evld-with-show
...
...
Prelude> :load /home/malte/testing/reflex-stack/app/Main.hs
Prelude> :trace main
...
...
gets an HTTPS request from the browser.
I tried to reproduce with a servant app, but could't.
➜ reflex-stack git:(master) ✗ stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is app --ghci-options -fprint-evld-with-show
Configuring GHCi with the following packages: app, backend, common, frontend
[DAP][INFO] start ghci-dap-0.0.14.0.
GHCi, version 8.8.3: https://www.haskell.org/ghc/ :? for help
> :load /home/malte/testing/reflex-stack/app/Main.hs
[1 of 6] Compiling Common.API ( /home/malte/testing/reflex-stack/common/src/Common/API.hs, interpreted )
[2 of 6] Compiling Backend ( /home/malte/testing/reflex-stack/backend/src/Backend.hs, interpreted )
[3 of 6] Compiling Frontend.API ( /home/malte/testing/reflex-stack/frontend/src/Frontend/API.hs, interpreted )
[4 of 6] Compiling Frontend.Router ( /home/malte/testing/reflex-stack/frontend/src/Frontend/Router.hs, interpreted )
[5 of 6] Compiling Frontend ( /home/malte/testing/reflex-stack/frontend/src/Frontend.hs, interpreted )
[6 of 6] Compiling Main ( /home/malte/testing/reflex-stack/app/Main.hs, interpreted )
Ok, six modules loaded.
*Main> :trace main
Running on https://localhost:8080
# gets HTTPS request
[1] 20518 segmentation fault (core dumped) stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is app
Here is the code, if you want to try to reproduce the issue: https://github.com/malte-v/reflex-stack/tree/739f8bd8466c65be9e6ae75ce3a3acf65a22690a As stated in the README, you need to run tools/certify
. It's ok to just always press enter when it asks for information. You also can skip adding the CA to your browser and just dismiss the usual warning about the invalid certificate. Thanks for looking into this!
This seems to be SSL-specific, which is probably why you couldn't reproduce the issue:
➜ ~ curl -v --insecure https://localhost:8080
* Trying ::1:8080...
* connect to ::1 port 8080 failed: Connection refused
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8080
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8080
When running regularly (not inside the debugger):
➜ ~ curl -v --insecure https://localhost:8080
* Trying ::1:8080...
* connect to ::1 port 8080 failed: Connection refused
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=AU; ST=Some-State; O=self-signed localhost certificate
* start date: Jul 1 16:51:37 2020 GMT
* expire date: Oct 4 16:51:37 2022 GMT
* issuer: C=AU; ST=Some-State; O=malte
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x563291dc78b0)
> GET / HTTP/2
> Host: localhost:8080
> user-agent: curl/7.70.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200
< date: Fri, 03 Jul 2020 14:03:54 GMT
< server: Warp/3.3.12
< content-type: text/html
<
<!DOCTYPE html>
<html>
<head>
<title>JSaddle</title>
</head>
<body>
</body>
<script src="/jsaddle.js"></script>
</html>
* Connection #0 to host localhost left intact
I can confirm that the issue does not occur when using HTTP.
What is your OS environment ? Could you run these commands from console ? (without ghci-dap, running original ghci.)
> cd /home/malte/testing/reflex-stack
> stack ghci --test --no-load --no-build --main-is app --ghci-options -fprint-evld-with-show
...
...
Prelude> :load /home/malte/testing/reflex-stack/app/Main.hs
Prelude> :trace main
...
...
gets an HTTPS request from the browser.
Regards.
Hey there, thanks for making this extension! I'm having some trouble getting it to work.
My app is a warp server that is accessed from a web browser. I'm able start debugging without any problems:
... but when my app gets an HTTPS request from the browser, the debugger exits with the following message:
Here are the contents of the log file and my
launch.json
:I've tried not printing the "Running on https://localhost:8080" message, but then I get the following error after reloading the browser:
So I don't think this is the culprit. I've installed these versions of the tools mentioned in the VSCode extension README:
Any idea what could have gone wrong here? Thanks!