magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.31k stars 116 forks source link

cl-no-applicable-method clone nil error when fetching MRs #681

Closed Davidbrcz closed 3 months ago

Davidbrcz commented 3 months ago

Hello

I recently started getting the following error when trying to fetch MRs from the gitlab instance I'm working with when I hit ' f f. Everything used to work flawlessly, but now the list of topics is not displayed.

Debugger entered--Lisp error: (cl-no-applicable-method clone nil)
  signal(cl-no-applicable-method (clone nil))
  cl-no-applicable-method(#s(cl--generic :name clone :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1ae6b61bc0e028c0>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba0b13a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b662d08469105e>)))) :method-table (#s(cl--generic-method :specializers (eieio-named) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode -0xf037e82ac4c7699>)) #s(cl--generic-method :specializers (eieio-instance-inheritor) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode -0xf037e82ac4c7699>)) #s(cl--generic-method :specializers (eieio-default-superclass) :qualifiers nil :call-con nil :function #f(compiled-function (obj &rest params) "Make a copy of OBJ, and then apply PARAMS." #<bytecode -0xaebb80990257920>))) :options nil) nil)
  apply(cl-no-applicable-method #s(cl--generic :name clone :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x1ae6b61bc0e028c0>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0x1cba0b13a96764e4>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x2b662d08469105e>)))) :method-table (#s(cl--generic-method :specializers (eieio-named) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode -0xf037e82ac4c7699>)) #s(cl--generic-method :specializers (eieio-instance-inheritor) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode -0xf037e82ac4c7699>)) #s(cl--generic-method :specializers (eieio-default-superclass) :qualifiers nil :call-con nil :function #f(compiled-function (obj &rest params) "Make a copy of OBJ, and then apply PARAMS." #<bytecode -0xaebb80990257920>))) :options nil) nil)
  #f(compiled-function (&rest args) #<bytecode 0xe192fa20bcb52ff>)(nil)
  apply(#f(compiled-function (&rest args) #<bytecode 0xe192fa20bcb52ff>) nil nil)
  clone(nil)
  forge-insert-pullreqs()
  magit-run-section-hook(magit-status-sections-hook)
  magit-status-refresh-buffer()
  magit-refresh-buffer()
  magit-refresh()
  magit-process-sentinel(#<process git> "finished\n")

Emacs version GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2024-06-26

Love the work and the efforts, thank you so much for magit.

tpeacock19 commented 3 months ago

I am still getting the same error with the latest master. forge--buffer-topics-spec seems to be nil. It does not happen the first time I install Forge. However, as soon as I close and reopen emacs it results in this same issue. I can confirm this happened with the following command:

/opt/homebrew/Cellar/emacs-plus\@31/31.0.50/Emacs.app/Contents/MacOS/Emacs \
    -Q \
    --eval \(setq\ debug-on-error\ t\) \
    -L /opt/homebrew/Cellar/emacs-plus\@31/31.0.50/share/emacs/31.0.50/lisp/emacs-lisp/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/dash-20240510.1327/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/transient-20240713.2102/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/with-editor-20240713.1931/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/magit-20240713.1925/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/magit-section-20240713.1925/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/git-commit-20240713.1925/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/forge-20240713.1917/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/ghub-20240713.1918/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/yaml-20231211.1501/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/emacsql-20240714.1824/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/closql-20240712.2215/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/markdown-mode-20240716.249/ \
    -L /Users/trey.peacock/.local/etc/emacs/elpa/treepy-20230715.2154/ \
    -l /Users/trey.peacock/.local/etc/emacs/elpa/magit-20240713.1925/magit 
Debugger entered--Lisp error: (cl-no-applicable-method clone nil)
  signal(cl-no-applicable-method (clone nil))
  cl-no-applicable-method(#s(cl--generic :name clone :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x189ede11325022cb>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x111a2082463a1535>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x1a05678245d32db5>)))) :method-table (#s(cl--generic-method :specializers (eieio-named) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode 0x26eadb2d457edab>)) #s(cl--generic-method :specializers (eieio-instance-inheritor) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode 0x26eadb2d457edab>)) #s(cl--generic-method :specializers (eieio-default-superclass) :qualifiers nil :call-con nil :function #f(compiled-function (obj &rest params) "Make a copy of OBJ, and then apply PARAMS." #<bytecode -0x74562b1df35c057>))) :options nil) nil)
  apply(cl-no-applicable-method #s(cl--generic :name clone :dispatches ((0 #s(cl--generic-generalizer :name eieio--generic-generalizer :priority 50 :tagcode-function cl--generic-struct-tag :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0x189ede11325022cb>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x111a2082463a1535>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x1a05678245d32db5>)))) :method-table (#s(cl--generic-method :specializers (eieio-named) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode 0x26eadb2d457edab>)) #s(cl--generic-method :specializers (eieio-instance-inheritor) :qualifiers nil :call-con curried :function #f(compiled-function (cl--nm) #<bytecode 0x26eadb2d457edab>)) #s(cl--generic-method :specializers (eieio-default-superclass) :qualifiers nil :call-con nil :function #f(compiled-function (obj &rest params) "Make a copy of OBJ, and then apply PARAMS." #<bytecode -0x74562b1df35c057>))) :options nil) nil)
  #f(compiled-function (&rest args) #<bytecode 0xdd8fb9236e74e6f>)(nil)
  apply(#f(compiled-function (&rest args) #<bytecode 0xdd8fb9236e74e6f>) nil nil)
  clone(nil)
  forge-insert-pullreqs()
  magit-run-section-hook(magit-status-sections-hook)
  magit-status-refresh-buffer()
  magit-refresh-buffer()
  magit-refresh()
  magit-process-sentinel(#<process git> "finished\n")
tarsius commented 3 months ago

Check the value of magit-status-mode-hook. Is forge--init-buffer-topics-spec a member of that list?

tpeacock19 commented 3 months ago

the value is:

(forge--init-buffer-topics-spec
 forge-connect-database-once
 arx-magit-remember-project)

However, I have now realized that this happens most commonly when I restore my the magit status window from a bookmark (using @alphapapa's activies.el but still leveraging the built-in bookmark functionality) in a brand new instance of emacs. When I kill all of the magit buffers and re-execute magit-status, then it works as expected.

Perhaps it has something to do with the magit bookmark support not initializing the forge spec variable?

tpeacock19 commented 3 months ago

Apologies, you can ignore this. It turns out I wasn't loading Forge until after the first magit-status call. Sorry for the noise.