vermiculus / magithub

**DEPRECATED - please use Forge instead!** -- Magit-based interfaces to GitHub
GNU General Public License v3.0
579 stars 63 forks source link

Variable binding depth exceeds max-specpdl-size #362

Closed humitos closed 5 years ago

humitos commented 6 years ago

Thanks for magithub!

I've been trying to debug this by myself, but I don't have enough knowledge of emacs/magit/magithub to find out the issue and be able to be more verbose in my description. I'm sorry.

I'm experimenting this issue any time that I want to update the cache / pull new issues or PR or anything that magithub needs to pull:

/usr/share/emacs/26.1/lisp/emacs-lisp/cl-print.elc:Error: Lisp nesting exceeds ‘max-lisp-eval-depth’
Debug on Error enabled globally
magithub: (06:12.145) ghub-request("GET" "/repos/readthedocs/readthedocs-ops" nil :query nil :payload nil :unpaginate nil :headers nil :username nil :auth magithub :host nil)
magithub: (06:13.119) checking if the API is available
magithub: (06:13.119) making sure authinfo is unlocked
magithub: (06:13.128) used cached value for api-last-checked
Entering debugger...
cl--generic-make-next-function: Symbol’s function definition is void: t

What I noticed today, and that's why I decide today to report the issue, was that it only happens on PRIVATE repositories. That must be a clue :)

I tried increasing the limits of max-lisp-eval-depth and then max-specpdl-size was reached. I increaded the later one and then the other one was reached. I increased them both a an insane value and Emacs freeze :D

Let me know if there is anything that I can do to help you debugging this.

vermiculus commented 6 years ago

A couple questions:

humitos commented 6 years ago

Do you have the stacktrace from the debugger?

For some reason that I don't know, no buffer is created for this as I should have seen in other tests :/

Does this happen on all private repositories, or just a few?

At least all the private repositories under Read the Docs organization (https://github.com/rtfd/).

I don't have any other private repository in Github at the moment to test.

aspiers commented 6 years ago

I'm experiencing this now:

  call-process("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "config" "-z" "--get-all" "magithub.online")
  apply(call-process "git" nil (t nil) nil ("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "config" "-z" "--get-all" "magithub.online"))
  process-file("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "config" "-z" "--get-all" "magithub.online")
  apply(process-file "git" nil (t nil) nil ("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "config" "-z" "--get-all" "magithub.online"))
  magit-process-file("git" nil (t nil) nil "--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "config" "-z" "--get-all" "magithub.online")
  apply(magit-process-file "git" nil (t nil) nil ("--no-pager" "--literal-pathspecs" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "config" "-z" "--get-all" "magithub.online"))
  magit-git-insert("config" nil "-z" "--get-all" "magithub.online")
  apply(magit-git-insert ("config" nil "-z" "--get-all" "magithub.online"))
  magit-git-items("config" nil "-z" "--get-all" "magithub.online")
  magit-get-all("magithub.online")
  apply(magit-get-all "magithub.online")
  magit-get("magithub.online")
  magithub-settings--value-or("magithub.online" t magit-get-boolean)
  magithub-online-p()
  magithub-cache(:repo-demographics (or (magithub-request (ghubp-get-repos-owner-repo '((owner (login . "myorganisation")) (name . "myrepo")))) (and (not (magithub--api-available-p)) sparse-repo)))
  magithub-repo(((owner (login . "myorganisation")) (name . "myrepo")))
  magithub-repo(((owner (login . "myorganisation")) (name . "myrepo")))
  magithub-repo(((owner (login . "myorganisation")) (name . "myrepo")))
  [clip]
  magithub-repo(((owner (login . "myorganisation")) (name . "myrepo")))
  magithub-repo(((owner (login . "myorganisation")) (name . "myrepo")))
  magithub-repo(((owner (login . "myorganisation")) (name . "myrepo")))
  magithub-repo()
  magithub-bug-reference-mode-on()
  run-hooks(change-major-mode-after-body-hook special-mode-hook magit-mode-hook magit-diff-mode-hook magit-revision-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook special-mode-hook magit-mode-hook magit-diff-mode-hook magit-revision-mode-hook))
  run-mode-hooks(magit-revision-mode-hook)
  magit-revision-mode()
  magit-mode-setup-internal(magit-revision-mode ("master~9^2" nil ("--stat" "--no-ext-diff") nil))
  magit-mode-setup(magit-revision-mode "master~9^2" nil ("--stat" "--no-ext-diff") nil)
  magit-show-commit("master~9^2" ("--stat" "--no-ext-diff") nil nil)
  funcall-interactively(magit-show-commit "master~9^2" ("--stat" "--no-ext-diff") nil nil)
  #<subr call-interactively>(magit-show-commit nil nil)
  apply(#<subr call-interactively> magit-show-commit (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> magit-show-commit nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (magit-show-commit nil nil))
  call-interactively(magit-show-commit nil nil)
  command-execute(magit-show-commit)
aspiers commented 6 years ago

I wanted to try https://stackoverflow.com/a/1322978/179332 but weirdly I couldn't reproduce it when I wanted to!

yashi commented 6 years ago

I can confirm this error. It triggers when I magit-status on a private github wiki repo.

jimmywongroo commented 6 years ago

I'm running into this error as well. It's quite annoying. Same situation as @yashi

jimmywongroo commented 6 years ago

@vermiculus Any progress on this?

vermiculus commented 6 years ago

None, sadly. I'd be happy to review a PR that can resolve this issue, but I haven't been able to reproduce it nor have I had the time necessary to devote to investigation.

vermiculus commented 6 years ago

As a workaround, I would try getting the value (the repo object) cached while you're online. That may help; I don't know.

jimmywongroo commented 6 years ago

I haven't been able to get a stacktrace, even when I've turned on toggle-debug-on-error. This is the message in *Message*:

Error during redisplay: (ucs-normalize-hfs-nfd-pre-write-conversion 1 51) signaled (error "Variable binding depth exceeds max-specpdl-size")

I can produce this consistently when trying to commit with Magit. I haven't been able to reprod this by magit-status

michaelsbradleyjr commented 6 years ago

I am experiencing this too, for a few days now — it's made even basic magit usage painful. I ended up removing magithub and reinstalling magit, and now magit itself is working (wonderfully!) as usual.

vermiculus commented 6 years ago

A stacktrace or reproduction steps would be really helpful.

humitos commented 6 years ago

@vermiculus Is magithub working properly for you on a private GitHub repository? I'm curious.

vermiculus commented 6 years ago

Yep; I have a personal repo that I keep as a sort-of TODO list using the issue tracker and it's working fine.

nandryshak commented 5 years ago

@vermiculus I'm also experiencing this bug. Could it be because the private repos are under an organization? One with a different owner name than the username one we're logged in with? I suspect your personal repo is at a url like https://github.com/vermiculus/todo-list, making the owner vermiculus, the same as your username. Whereas a private organization's owner would be different.

edit: a similar bug also occurs when I evaluate (magithub-repo "nandryshak/does-not-exist.git")

nandryshak commented 5 years ago

I fixed it (at least for myself). My organization changed the repository name since I had cloned it. The old remote urls still worked for pushing/pulling, but when magithub parsed and used the old repo name during github api calls, the api didn't recognize it anymore. All I had to do was git remote set-url origin $NEWURL.

@vermiculus: So it seems like this bug is occurring when magithub (really ghubp) cannot find a repo by the name it's parsing from the remote url. Perhaps better error handling would be good here (instead of infinite recursion!).

casch-at commented 5 years ago

I have the same problem with wiki projects.

Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size")
  concat("" "magithub" ".online")
  apply(concat ("" "magithub" ".online"))
  replace-regexp-in-string("\\`[^.]+" downcase "magithub.online" t t)
  magit-config-get-from-cached-list("magithub.online")
  magit-get-all("magithub.online")
  apply(magit-get-all "magithub.online")
  magit-get("magithub.online")
  magithub-settings--value-or("magithub.online" t magit-get-boolean)
  magithub-online-p()
  magithub-cache(:repo-demographics (or (magithub-request (ghubp-get-repos-owner-repo (quote ((owner (login . "Andersbakken")) (name . "rtags.wiki"))))) (and (not (magithub--api-available-p)) sparse-repo)))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  .......
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki")))
  magithub-repo-from-remote("origin")
  magithub-pull-request-branch->pr--ghub("master")
  magithub-ci-status--get-default-ref()
  magithub-insert-ci-status-header()
  magithub-maybe-insert-ci-status-header()
  apply(magithub-maybe-insert-ci-status-header nil)
  magit-run-section-hook(magit-status-headers-hook)
  magit-insert-headers(magit-status-headers-hook)
  magit-insert-status-headers()
  apply(magit-insert-status-headers nil)
  magit-run-section-hook(magit-status-sections-hook)
  magit-status-refresh-buffer()
  apply(magit-status-refresh-buffer nil)
  magit-refresh-buffer()
  magit-mode-setup-internal(magit-status-mode nil)
  magit-mode-setup(magit-status-mode)
  magit-status-internal("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/")
  magit-status(nil ((45832 . 12) (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "show" "--no-patch" "--format=%s" #("origin/master^{commit}" 0 13 (face magit-branch-remote)) "--") . #("[What is RTags] Fix links and a couple of typos" 0 15 (face magit-keyword))) (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "rev-parse" "--verify" #("origin/master" 0 13 (face magit-branch-remote))) . "0888baff06cdcb8583fd78c5d737b918dddcb906") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "show" "--no-patch" "--format=%h %s" "master^{commit}" "--") . "0888baf [What is RTags] Fix links and a couple of typos") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "symbolic-ref" "--short" "HEAD") . "master") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "rev-parse" "--verify" "HEAD") . "0888baff06cdcb8583fd78c5d737b918dddcb906") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" . config) . #<hash-table equal 42/65 0x2afccd5>) (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" . magit-toplevel) . "/home/cschwarzgruber/Developing/third_party/rtags.wiki/") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "rev-parse" "--show-toplevel") . "/home/cschwarzgruber/Developing/third_party/rtags.wiki") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" . magit-toplevel) . "/home/cschwarzgruber/Developing/third_party/rtags.wiki/") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" "rev-parse" "--is-bare-repository") . "false\n") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" "rev-parse" "--git-dir") . ".") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" "rev-parse" "--show-toplevel"))))
  funcall-interactively(magit-status nil ((45832 . 12) (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "show" "--no-patch" "--format=%s" #("origin/master^{commit}" 0 13 (face magit-branch-remote)) "--") . #("[What is RTags] Fix links and a couple of typos" 0 15 (face magit-keyword))) (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "rev-parse" "--verify" #("origin/master" 0 13 (face magit-branch-remote))) . "0888baff06cdcb8583fd78c5d737b918dddcb906") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "show" "--no-patch" "--format=%h %s" "master^{commit}" "--") . "0888baf [What is RTags] Fix links and a couple of typos") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "symbolic-ref" "--short" "HEAD") . "master") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "rev-parse" "--verify" "HEAD") . "0888baff06cdcb8583fd78c5d737b918dddcb906") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" . config) . #<hash-table equal 42/65 0x2afccd5>) (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" . magit-toplevel) . "/home/cschwarzgruber/Developing/third_party/rtags.wiki/") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/" "rev-parse" "--show-toplevel") . "/home/cschwarzgruber/Developing/third_party/rtags.wiki") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" . magit-toplevel) . "/home/cschwarzgruber/Developing/third_party/rtags.wiki/") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" "rev-parse" "--is-bare-repository") . "false\n") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" "rev-parse" "--git-dir") . ".") (("/home/cschwarzgruber/Developing/third_party/rtags.wiki/.git/" "rev-parse" "--show-toplevel"))))
  call-interactively(magit-status nil nil)
  command-execute(magit-status)

I removed 11431 lines of the form magithub-repo(((owner (login . "Andersbakken")) (name . "rtags.wiki"))) from the Backtrace.

Hope that helps somehow.

EDIT: I just realized it is possible to disable magithub for a single project via H C (inside magit status buffer) or by just adding enabled = false to the [magithub] section in .git/config manually.

humitos commented 5 years ago

My organization changed the repository name since I had cloned it. The old remote urls still worked for pushing/pulling, but when magithub parsed and used the old repo name during github api calls, the api didn't recognize it anymore. All I had to do was git remote set-url origin $NEWURL.

Thanks a lot @nandryshak! This was exactly my case also.

The organization readthedocs moved all the repos under rtfd organization. So, I changed the remote URLs of all these repositories as you mentioned here and all of them started working again with magithub: I can create check the CI status and retrieve the normal information (Issues and Pull Request) from the Magit status buffer that was failing before.

Perhaps better error handling would be good here (instead of infinite recursion!).

This would have helped me a lot to auto-solve this issue by myself. @vermiculus maybe implementing this is not that hard (I have no idea, but I suppose) and will help many users.

In other words, I think there is not a bug in magithub with private repositories but with non-existing URLs.

Love you all people! :heart:

humitos commented 5 years ago

I'm closing this issue because it's not an issue ;) Thanks for magithub!