skangas / mentor

mentor is a GNU Emacs frontend for the rTorrent bittorrent client.
GNU General Public License v3.0
79 stars 8 forks source link

Error with remote rtorrent #18

Closed n0n closed 2 years ago

n0n commented 4 years ago

Hello, I just installed mentor to my emacs (26.2) and customize the variable mentor-rtorrent-external-rpc with http link, like that

(use-package mentor
  :ensure t
  :init
  (setq mentor-rtorrent-external-rpc "http://192.168.1.49:8008/RPC2"))

When I try to enter mentor mode I get error in Messages:

Contacting host: 192.168.1.49:8008
Error during redisplay: (eval (concat (propertize " " (quote display) (quote ((space :align-to 1)))) (substring mentor--header-line (min (length mentor--header-line) (window-hscroll))))) signaled (wrong-type-argument arrayp nil) [4 times]
cd: No such directory found via CDPATH environment variable

in minibuffer get last string about CDPATH.

In remote rtorrent xmlrpc logs I get the last query with method name execute.capture with response

Status: 200 OK
Content-Type: text/xml
Content-Length: 157

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param><value><string>/home/n0n
</string></value></param>
</params>
</methodResponse>

in emacs I have clear mentor buffer. How can I fix it? Thanks!

n0n commented 4 years ago

I set debug-on-error on emacs and get this

Debugger entered--Lisp error: (error "No such directory found via CDPATH environment variable")
  signal(error ("No such directory found via CDPATH environment variable"))
  error("No such directory found via CDPATH environment variable")
  cd("/home/n0n/")
  mentor()
  funcall-interactively(mentor)
  call-interactively(mentor record nil)
skangas commented 4 years ago

Sorry for the long response time here. I'm not actually using the remote functionality myself, so I'd need some help in debugging this.

Does "/home/n0n/" exist on your local machine, or does it only exist remotely?

nicolapcweek94 commented 2 years ago

I'm experiencing the same issue with Emacs 28 snapshot on Windows 10, pointing to a remote linux install of rTorrent. Can I help troubleshoot this in any way? Remote folders do not exist on my local machine, including the one I'm getting in the stacktrace, which points to the directory of rtorrent inside the container running in the remote system:

  signal(error ("No such directory found via CDPATH environment var..."))
  error("No such directory found via CDPATH environment var...")
  cd("/run/s6/services/rtorrent/")
  mentor()
  funcall-interactively(mentor)
  call-interactively(mentor record nil)
  command-execute(mentor record)
  counsel-M-x-action("mentor")
  #f(compiled-function (x) #<bytecode 0x6041d0febc92cb0>)("mentor")
  ivy-call()
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0xf2acbce95325b66>)("M-x " [## whitespace-global-modes vietnamese-vscii-mac cps--make-catch-wrapper gnus-dbus-register-sleep-signal view-emacs-problems dired-mark-pop-up org-table-get-field cps--add-binding extended-spec traverse delta-tags message-interactive smime-mode-hook gnus-backup-startup-file company-etags-find-table ietf-drums-quote-token data-encoding inactive gnus-newsgroup-headers 0 url-cache-prepare org-gcal--event-entry-create bibtex-Unpublished Paste\ Previously\ Killed\ Entry xref-bogus-location-list-p counsel--split-command-args emacs-lisp-compilation-mode-abbrev-table counsel-fzf-function nano-modeline-mode--inactivate wash-face-p org-remove-uninherited-tags :mac ivy--get-window org-irc-visit About ov-end straight--output message-citation-line-format gnus-header-subject json-advance linum-mode-map whitespace-mode-on-hook first-time term-process-pager function-called-at-point counsel-find-file-delete speedbar-easymenu-definition-base doc-view-document->bitmap ! ...] :predicate #f(compiled-function (sym) #<bytecode -0x1f48fe62cec41e92>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x :sort t)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0xf2acbce95325b66>) ("M-x " [## whitespace-global-modes vietnamese-vscii-mac cps--make-catch-wrapper gnus-dbus-register-sleep-signal view-emacs-problems dired-mark-pop-up org-table-get-field cps--add-binding extended-spec traverse delta-tags message-interactive smime-mode-hook gnus-backup-startup-file company-etags-find-table ietf-drums-quote-token data-encoding inactive gnus-newsgroup-headers 0 url-cache-prepare org-gcal--event-entry-create bibtex-Unpublished Paste\ Previously\ Killed\ Entry xref-bogus-location-list-p counsel--split-command-args emacs-lisp-compilation-mode-abbrev-table counsel-fzf-function nano-modeline-mode--inactivate wash-face-p org-remove-uninherited-tags :mac ivy--get-window org-irc-visit About ov-end straight--output message-citation-line-format gnus-header-subject json-advance linum-mode-map whitespace-mode-on-hook first-time term-process-pager function-called-at-point counsel-find-file-delete speedbar-easymenu-definition-base doc-view-document->bitmap ! ...] :predicate #f(compiled-function (sym) #<bytecode -0x1f48fe62cec41e92>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x :sort t))
  ivy-read("M-x " [## whitespace-global-modes vietnamese-vscii-mac cps--make-catch-wrapper gnus-dbus-register-sleep-signal view-emacs-problems dired-mark-pop-up org-table-get-field cps--add-binding extended-spec traverse delta-tags message-interactive smime-mode-hook gnus-backup-startup-file company-etags-find-table ietf-drums-quote-token data-encoding inactive gnus-newsgroup-headers 0 url-cache-prepare org-gcal--event-entry-create bibtex-Unpublished Paste\ Previously\ Killed\ Entry xref-bogus-location-list-p counsel--split-command-args emacs-lisp-compilation-mode-abbrev-table counsel-fzf-function nano-modeline-mode--inactivate wash-face-p org-remove-uninherited-tags :mac ivy--get-window org-irc-visit About ov-end straight--output message-citation-line-format gnus-header-subject json-advance linum-mode-map whitespace-mode-on-hook first-time term-process-pager function-called-at-point counsel-find-file-delete speedbar-easymenu-definition-base doc-view-document->bitmap ! ...] :predicate #f(compiled-function (sym) #<bytecode -0x1f48fe62cec41e92>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)
skangas commented 2 years ago

I have pushed a fix that I believe should fix this error. Could you please test it on your end and see that it works? If not, we can reopen the bug and continue investigating.

Thanks in advance!

nicolapcweek94 commented 2 years ago

Sorry for taking so long to test this, but I can confirm it works! Thank you very much!

skangas commented 2 years ago

Thanks for helping test this, I appreciate it!