Hunchentoot是未知的处理程序

时间:2019-01-15 16:33:18

标签: common-lisp hunchentoot

基于CI构建的Web应用程序的二进制文件无法运行,如果在本地构建,则可以成功运行。是什么原因导致这些差异,什么原因导致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版本(请参阅第一个stacktrace上的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)))))

再次感谢。

1 个答案:

答案 0 :(得分:0)

添加依赖项

           :clack-handler-hunchentoot

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