Hunchentoot 是未知处理程序

Hunchentoot is unknown handler

我在 CI 上构建的网络应用程序的二进制文件无法 运行,如果在本地构建则成功。什么会导致这些差异,什么会导致 Hunchentoot 失败并显示此消息?

以下是不同的堆栈跟踪:

<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

和本地:

<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 
_

它一直在听。

它们 运行 具有相同的框架版本(最新),它们似乎 运行 相同的 Quicklisp dist 版本(参见第一个堆栈跟踪上的 lack-20181018),这是我本地的版本。 CI 建立在 daewok/lisp-devel-docker.

之上

我用这个起点:

(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)))))

再次感谢。

添加依赖项

           :clack-handler-hunchentoot

在我的 .asd 中做到了。谢谢 jkiiski。