common-lisphunchentoot

Hunchentoot is unknown handler


The binary of my web-app built on CI fails to run, and succeeds if built locally. What could cause those differences, what would cause Hunchentoot to fail with this message ?

Here are the different stacktraces:

<INFO> [14:42:11] weblocks/server server.lisp (start) -
  Starting weblocks WEBLOCKS/SERVER::PORT: 4000
  WEBLOCKS/SERVER::SERVER-TYPE: :HUNCHENTOOT DEBUG: T 
 <INFO> [14:42:11] weblocks/server server.lisp (start-server) -
  Starting webserver on WEBLOCKS/SERVER::INTERFACE: "localhost"
  WEBLOCKS/SERVER::PORT: 4000 DEBUG: T 
Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                    {10005C85B3}>:
  :HUNCHENTOOT is unknown handler.

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005C85B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SIMPLE-ERROR "~S is unknown handler." {100495FEC3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SIMPLE-ERROR "~S is unknown handler." {100495FEC3}>)
2: (INVOKE-DEBUGGER #<SIMPLE-ERROR "~S is unknown handler." {100495FEC3}>)
3: (UIOP/IMAGE:HANDLE-FATAL-CONDITION #<SIMPLE-ERROR "~S is unknown handler." {100495FEC3}>)
4: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "~S is unknown handler." {100495FEC3}>)
5: (ERROR "~S is unknown handler." :HUNCHENTOOT)
6: (CLACK.UTIL:FIND-HANDLER :HUNCHENTOOT)
7: (CLACK:CLACKUP #<CLOSURE (LAMBDA (LACK.MIDDLEWARE.SESSION::ENV) :IN "/home/lisp/quicklisp/dists/quicklisp/software/lack-20181018-git/src/middleware/session.lisp") {100467727B}> :ADDRESS "localhost" :SERVER :HUNCHENTOOT :PORT 4000 :DEBUG T)
8: (WEBLOCKS/SERVER::START-SERVER #<SERVER port=4000 stopped> :DEBUG T)
9: ((LAMBDA (#:G0 &REST #:G1) :IN WEBLOCKS/SERVER:START) NIL)
10: (WEBLOCKS/SERVER:START :DEBUG T :PORT 4000 :INTERFACE "localhost" :SERVER-TYPE :HUNCHENTOOT)
11: (TORRENTS:MAIN)
12: ((LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE))
13: (UIOP/IMAGE:CALL-WITH-FATAL-CONDITION-HANDLER #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE) {1004410D9B}>)
14: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
15: ((FLET "WITHOUT-INTERRUPTS-BODY-34" :IN SAVE-LISP-AND-DIE))
16: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting

and locally:

<INFO> [17:11:49] weblocks/server server.lisp (start) -
  Starting weblocks WEBLOCKS/SERVER::PORT: 4001
  WEBLOCKS/SERVER::SERVER-TYPE: :HUNCHENTOOT DEBUG: T 
 <INFO> [17:11:49] weblocks/server server.lisp (start-server) -
  Starting webserver on WEBLOCKS/SERVER::INTERFACE: "localhost"
  WEBLOCKS/SERVER::PORT: 4001 DEBUG: T 
_

and it keeps listening.

They run with the same framework version (latest), they seem to run the same Quicklisp dist version (see lack-20181018 on the first stacktrace), which is my local version. The CI is built on daewok/lisp-devel-docker.

I use this starting point:

(defun start ()
  (weblocks/debug:on)
  (weblocks/server:start :port *port*))

(defun stop ()
  (weblocks/server:stop))

(defun main ()
  (defvar *port* (find-port:find-port))

  (start)
  (handler-case (bt:join-thread (find-if (lambda (th)
                                             (search "hunchentoot" (bt:thread-name th)))
                                         (bt:all-threads)))
    (#+sbcl sb-sys:interactive-interrupt
      #+ccl  ccl:interrupt-signal-condition
      #+clisp system::simple-interrupt-condition
      #+ecl ext:interactive-interrupt
      #+allegro excl:interrupt-signal
      () (progn
           (format *error-output* "Aborting.~&")
           ;; (weblocks:stop)
           (uiop:quit 1))
    ;; for others, unhandled errors (we might want to do the same).
      (error (c) (format t "Woops, an unknown error occured:~&~a~&" c)))))

Thanks again.


Solution

  • Adding the dependency

               :clack-handler-hunchentoot
    

    in my .asd did it. Thanks jkiiski.