atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.82k stars 410 forks source link

Nyxt failing on old config with bad restart #2778

Closed franburstall closed 1 year ago

franburstall commented 1 year ago

Describe the bug

I fire nyxt for the first time in a few months. Clearly a lot has changed because I get a compilation error early in my config that crashes nyxt. No surprises so far.

BUT, nyxt then tries to restart with a --no-config flag and this fails too. First some warnings are reported but no browser window appears and I get my shell prompt back. However, proced reveals that there is a nyxt process running with a >4500 character argument that starts:

--eval (SERAPEUM:ADD-HOOK\ (NYXT:AFTER-INIT-HOOK\ NYXT:*BROWSER*)\^J\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (MAKE-INSTANCE\ 'NHOOKS:HANDLER\ :FN\^J\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (LAMBDA\ ()\^J\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (SETF\ (NYXT::STARTUP-ERROR-REPORTER-FUNCTION\^...

Here is what I see from the shell:

% nyxt

(sbcl:167694): Gtk-WARNING **: 15:17:52.589: Theme parsing error: gtk-contained-dark.css:2871:228: Missing closing bracket for :not()
Nyxt version 3-pre-release-2-921-g8d71ac19
<INFO> [15:17:52] Source location: #P"/home/fran/common-lisp/nyxt/"
<INFO> [15:17:52] Loading Lisp file #P"/home/fran/.config/nyxt/auto-config.3.lisp".

; file: /home/fran/.config/nyxt/auto-config.3.lisp
; in: DEFMETHOD CUSTOMIZE-INSTANCE (INPUT-BUFFER)
;     (NYXT:DISABLE-MODES '(NYXT/VI-MODE:VI-NORMAL-MODE) NYXT:INPUT-BUFFER)
; 
; caught STYLE-WARNING:
;   The first argument of type CONS cannot be used as a keyword.

;     (NYXT:ENABLE-MODES '(NYXT/EMACS-MODE:EMACS-MODE) NYXT:INPUT-BUFFER)
; 
; caught STYLE-WARNING:
;   The first argument of type CONS cannot be used as a keyword.
; 
; compilation unit finished
;   caught 2 STYLE-WARNING conditions
<INFO> [15:17:52] Loading Lisp file #P"/home/fran/.config/nyxt/config.lisp".
While evaluating the form starting at line 3, column 0
  of #P"/home/fran/.config/nyxt/config.lisp":
; 
; compilation unit aborted
;   caught 1 fatal ERROR condition
<INFO> [15:17:52] Listening to socket: #P"/run/user/1000/nyxt/nyxt.socket"
<WARN> [15:17:52] Restarting with ("nyxt" "--no-config").
<INFO> [15:17:52] Deleting socket #P"/run/user/1000/nyxt/nyxt.socket".
<INFO> [15:17:53] Source location: #P"/home/fran/common-lisp/nyxt/"
<INFO> [15:17:53] Loading Lisp file #P"/home/fran/.config/nyxt/auto-config.3.lisp".
<WARN> [15:17:53] Warning: Error in s-exp evaluation: There is no applicable method for the generic function
  #&lt;STANDARD-GENERIC-FUNCTION NYXT:AFTER-INIT-HOOK (1)&gt;
when called with arguments
  (NIL).
See also:
  The ANSI Standard, Section 7.6.6
<INFO> [15:17:53] Listening to socket: #P"/run/user/1000/nyxt/nyxt.socket"
<WARN> [15:17:53] Warning: Error in FFI method: keyword argument not a symbol: (NYXT/VI-MODE:VI-NORMAL-MODE).
<WARN> [15:17:53] Warning: Error on separate thread: There is no applicable method for the generic function
  #&lt;STANDARD-GENERIC-FUNCTION NYXT:ID (5)&gt;
when called with arguments
  (NIL).
See also:
  The ANSI Standard, Section 7.6.6

There is nothing I can see to do except kill that nyxt process.

Information

ASDF version: 3.3.1 ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY) Critical dependencies: (/home/fran/common-lisp/nyxt/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd /home/fran/common-lisp/nyxt/_build/cl-gobject-introspection/cl-gobject-introspection.asd /home/fran/common-lisp/nyxt/_build/cl-webkit/webkit2/cl-webkit2.asd)

aadcg commented 1 year ago

It seems to be that the error is coming the auto-config file located at /home/fran/.config/nyxt/auto-config.3.lisp. Could you try to delete it?

franburstall commented 1 year ago

Yup. With that file deleted, nyxt loads moreorless OK. However, I raised the issue because I thought nyxt was supposed to be more robust about being supplied out-dated config (especially auto-config!) now.

aadcg commented 1 year ago

@franburstall I share your opinion and your report is extremely valuable!

I'm not sure what happened here, but @Ambrevar and @aartaka might have some ideas.

Do you know which version/commit were you running before re-building it?

franburstall commented 1 year ago

Do you know which version/commit were you running before re-building it?

Sadly not but the last time I seriously played with nyxt was September 2022 and the out-dated auto-config.3.lisp was last modified 29-08-22.

Ambrevar commented 1 year ago

My bad, I had forgotten to update the restart code. Should be fixed with #2779. @franburstall You confirm?

Ambrevar commented 1 year ago

Merged on master.

Feel free to reopen if there is anything else.

franburstall commented 1 year ago

A bit late but I confirm that restarts actually work now!

Ambrevar commented 1 year ago

Thanks!