Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled SB-INT:CLOSED-STREAM-ERROR using SSL + Hunchentoot #127

Closed
aarvid opened this issue Oct 5, 2015 · 4 comments · Fixed by #152
Closed

Unhandled SB-INT:CLOSED-STREAM-ERROR using SSL + Hunchentoot #127

aarvid opened this issue Oct 5, 2015 · 4 comments · Fixed by #152

Comments

@aarvid
Copy link

aarvid commented Oct 5, 2015

I get this error while using port 443 and ssl. :debug is true.

Unhandled SB-INT:CLOSED-STREAM-ERROR in thread #<SB-THREAD:THREAD
                                                 "hunchentoot-worker-179.253.59.43:58519" RUNNING
                                                  {100360A7B3}>:
 #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58519"
    {100315D483}> is closed

This occurs a few minutes after getting home page and then idling. It does not occur with port 80 and no ssl.

It is evoked in caveman by

(start :port 443 :ssl t :ssl-key-file "~/server.key"
       :ssl-cert-file "~/tullius.cert" :ssl-key-password "*******") 
@aarvid
Copy link
Author

aarvid commented Oct 5, 2015

error output log:

;; Swank started at port: 4006.
WARNING: PARSE-VERSION: "0.1.03" contains leading zeros
WARNING: Invalid :version specifier "0.1.03" for component "cl-date-time-parser" from file #P"/home/ec2-user/quicklisp/dists/quicklisp/software/cl-date-time-parser-20140713-git/cl-date-time-parser.asd", using NIL instead
Unhandled SB-INT:CLOSED-STREAM-ERROR in thread #<SB-THREAD:THREAD
                                                 "hunchentoot-worker-179.253.59.43:58519" RUNNING
                                                  {100360A7B3}>:
  #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58519"
    {100315D483}> is closed

Backtrace for: #<SB-THREAD:THREAD "hunchentoot-worker-179.253.59.43:58519" RUNNING {100360A7B3}>
Unhandled SB-INT:CLOSED-STREAM-ERROR in thread #<SB-THREAD:THREAD
                                                 "hunchentoot-worker-179.253.59.43:58520" RUNNING
                                                  {1002C2E8A3}>:
  #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58520"
    {1002C2BBC3}> is closed

Backtrace for: #<SB-THREAD:THREAD "hunchentoot-worker-179.253.59.43:58520" RUNNING {1002C2E8A3}>
0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX))
1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10082E2F1B}>)
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10082E2EEB}>)
3: (PRINT-BACKTRACE :STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDERR* {10001527C3}> :START 0 :FROM :INTERRUPTED-FRAME :COUNT NIL :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL)
4: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-INT:CLOSED-STREAM-ERROR {10082E0AA3}> #<unavailable argument>)
5: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SB-INT:CLOSED-STREAM-ERROR {10082E0AA3}>)
6: (INVOKE-DEBUGGER #<SB-INT:CLOSED-STREAM-ERROR {10082E0AA3}>)
7: ((:METHOD HUNCHENTOOT:MAYBE-INVOKE-DEBUGGER (T)) #<SB-INT:CLOSED-STREAM-ERROR {10082E0AA3}>) [fast-method]
8: (SIGNAL #<SB-INT:CLOSED-STREAM-ERROR {10082E0AA3}>)
9: (ERROR SB-INT:CLOSED-STREAM-ERROR :STREAM #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58520" {1002C2BBC3}>)
10: (SB-KERNEL:CLOSED-FLAME #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58520" {1002C2BBC3}>)
11: (FINISH-OUTPUT #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58520" {1002C2BBC3}>)
12: ((FLET HUNCHENTOOT::CLOSE-STREAM :IN HUNCHENTOOT:PROCESS-CONNECTION) #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58520" {1002C2BBC3}>)
13: 
0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX))
1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10082DED9B}>)
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {10082DED6B}>)
3: (PRINT-BACKTRACE :STREAM #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDERR* {10001527C3}> :START 0 :FROM :INTERRUPTED-FRAME :COUNT NIL :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL)
4: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-INT:CLOSED-STREAM-ERROR {1008207EE3}> #<unavailable argument>)
5: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SB-INT:CLOSED-STREAM-ERROR {1008207EE3}>)
6: (INVOKE-DEBUGGER #<SB-INT:CLOSED-STREAM-ERROR {1008207EE3}>)
7: ((:METHOD HUNCHENTOOT:MAYBE-INVOKE-DEBUGGER (T)) #<SB-INT:CLOSED-STREAM-ERROR {1008207EE3}>) [fast-method]
8: (SIGNAL #<SB-INT:CLOSED-STREAM-ERROR {1008207EE3}>)
9: (ERROR SB-INT:CLOSED-STREAM-ERROR :STREAM #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58519" {100315D483}>)
10: (SB-KERNEL:CLOSED-FLAME #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58519" {100315D483}>)
11: (FINISH-OUTPUT #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58519" {100315D483}>)
12: ((FLET HUNCHENTOOT::CLOSE-STREAM :IN HUNCHENTOOT:PROCESS-CONNECTION) #<SB-SYS:FD-STREAM for "socket 172.30.0.248:443, peer: 179.253.59.43:58519" {100315D483}>)
13: ((FLET #:CLEANUP-FUN-400 :IN HUNCHENTOOT:PROCESS-CONNECTION)) [cleanup]
14: ((:METHOD HUNCHENTOOT:PROCESS-CONNECTION (HUNCHENTOOT:ACCEPTOR T)) #<HUNCHENTOOT:EASY-SSL-ACCEPTOR (host *, port 443)> #<USOCKET:STREAM-USOCKET {100322C883}>) [fast-method]
15: ((FLET #:CLEANUP-FUN-400 :IN HUNCHENTOOT:PROCESS-CONNECTION)) [cleanup]
14: ((:METHOD HUNCHENTOOT:PROCESS-CONNECTION (HUNCHENTOOT:ACCEPTOR T)) #<HUNCHENTOOT:EASY-SSL-ACCEPTOR (host *, port 443)> #<USOCKET:STREAM-USOCKET {1002C2BCF3}>) [fast-method]
15: ((:METHOD HUNCHENTOOT:PROCESS-CONNECTION :AROUND (HUNCHENTOOT:ACCEPTOR T)) #<HUNCHENTOOT:EASY-SSL-ACCEPTOR (host *, port 443)> #<USOCKET:STREAM-USOCKET {1002C2BCF3}>) [fast-method]
16: ((FLET HUNCHENTOOT::PROCESS-CONNECTION% :IN HUNCHENTOOT::HANDLE-INCOMING-CONNECTION%) #<HUNCHENTOOT:EASY-SSL-ACCEPTOR (host *, port 443)> #<USOCKET:STREAM-USOCKET {1002C2BCF3}>)
17: ((LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS))
18: ((FLET #:WITHOUT-INTERRUPTS-BODY-1089 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
19: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
20: ((FLET #:WITHOUT-INTERRUPTS-BODY-549 :IN SB-THREAD::CALL-WITH-MUTEX))
21: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFE56A6C8B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "hunchentoot-worker-179.253.59.43:58520" RUNNING {1002C2E8A3}>> NIL T NIL)
22: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "hunchentoot-worker-179.253.59.43:58520" RUNNING {1002C2E8A3}> NIL #<CLOSURE (LAMBDA NIL :IN BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS) {1002C2E82B}> (#<SB-THREAD:THREAD "hunchentoot-worker-179.253.59.43:58520" RUNNING {1002C2E8A3}> #<SB-THREAD:THREAD "hunchentoot-worker-179.253.59.43:58519" RUNNING {100360A7B3}> #<SB-THREAD:THREAD "clack-handler-hunchentoot" RUNNING {1009B2EE73}> #<SB-THREAD:THREAD "Hierarchy Watcher" RUNNING {1009E30103}> #<SB-THREAD:THREAD "Swank 4006" RUNNING {10031E6D23}> #<SB-THREAD:THREAD "Swank Sentinel" RUNNING {10031E69B3}> #<SB-THREAD:THREAD "main thread" RUNNING {1002BF6863}>) NIL NIL NIL NIL)
23: ("foreign function: call_into_lisp")
24: ("foreign function: new_thread_trampoline")

unhandled condition in --disable-debugger mode, quitting

@aarvid
Copy link
Author

aarvid commented Oct 6, 2015

This issue is moot for me. I continue to get the error but my site works since I changed the configuration of sb-daemon to allow for errors.

Also I am now planning to switch to nginx as a reverse proxy to handle ssl.

@aarvid
Copy link
Author

aarvid commented Oct 6, 2015

I got nginx handling ssl on port 443 and as a proxy for clack/hunchentoot on port 8080. With the added benefit that nginx will redirect http://mysite.com to https://mysite.com.

So for me this is really not an important issue.

@stylewarning
Copy link
Contributor

stylewarning commented May 31, 2016

This is affecting me, even without SSL.

dkochmanski added a commit to dkochmanski/clack that referenced this issue Jun 12, 2018
Method binds hunchentoot:*catch-errors-p* to NIL, so hunchentoot tries to invoke
a debugger if a condition comes to it. Error condition wasn't handled by clack
if it happened in handle-response, because handler-case was wrapped around
funcall, not the whole expression.

HANDLE-RESPONSE might have raisen an exception from SSL library (and other
communication methods) for instance when peer has closed the connection - that
lead to uncought closed stream error condition. Fixes fukamachi#127.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants