unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
@ 2021-04-27 16:58 Thierry Volpiatto
  2021-04-27 19:19 ` Michael Albinus
  0 siblings, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-27 16:58 UTC (permalink / raw)
  To: 48067


When adding a file-notify watcher to a remote directory in helm-find-files, I
have an error "cannot determine gio monitor":

Debugger entered--Lisp error: (file-error "Cannot determine gio monitor")
  signal(file-error ("Cannot determine gio monitor"))
  tramp-sh-gio-monitor-process-filter(#<process gio> "\n(gio monitor:15942): GLib-GIO-\33[1;33mWARNING\33[0m ...")
  [...]

This doesn't happen in emacs-27.2.
It happens in emacs-28 compiled with native-comp or not.

which gio returns /usr/bin/gio.

Any ideas?

Thanks.


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10)
 of 2021-04-27 built on IPadS340
Repository revision: 6fb80c9ad80bfc0db18285d6e23c3ee08e2aa657
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Linux Mint 19.3

Configured using:
 'configure CFLAGS=-O8 --with-mailutils --with-cairo
 --with-native-compilation'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Elisp

Minor modes in effect:
  bug-reference-prog-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-ligature-mode: t
  ligature-mode: t
  psession-mode: t
  psession-savehist-mode: t
  global-git-gutter-mode: t
  git-gutter-mode: t
  display-time-mode: t
  winner-mode: t
  show-paren-mode: t
  helm-epa-mode: t
  helm-descbinds-mode: t
  override-global-mode: t
  helm-adaptive-mode: t
  helm-mode: t
  shell-dirtrack-mode: t
  helm-popup-tip-mode: t
  async-bytecomp-package-mode: t
  dired-async-mode: t
  minibuffer-depth-indicate-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/thierry/.emacs.d/straight/build/transient/transient hides /usr/local/share/emacs/28.0.50/lisp/transient

Features:
(shadow epa-mail face-remap helm-ring emacsbug help-fns cl-print debug
epa-file cus-start helm-command w3m-form w3m-symbol w3m timezone
w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-favicon w3m-image tab-line
w3m-proc w3m-util qp sort gnus-cite mm-archive smiley mail-extr
helm-firefox helm-addressbook helm-x-files helm-for-files helm-bookmark
smerge-mode view org-agenda org-refile org-element avl-tree generator
ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect gnus-search eieio-opt speedbar ezimage dframe ol-docview
ol-bibtex bibtex ol-bbdb ol-w3m addressbook-bookmark mu4e-config
org-mu4e mu4e-patch mu4e-contrib eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util bookmark mu4e mu4e-org
mu4e-main mu4e-view mu4e-view-gnus gnus-art mm-uu mml2015 mm-view
mml-smime smime dig gnus-sum gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int
gnus-range gnus-win gnus nnheader mu4e-view-common mu4e-headers
mu4e-compose mu4e-context mu4e-draft mu4e-actions ido rfc2368 smtpmail
sendmail mu4e-mark mu4e-proc mu4e-utils doc-view image-mode exif
mu4e-lists mu4e-message shr kinsoku svg dom flow-fill hl-line mu4e-vars
message rmc puny rfc822 mml mml-sec gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
mail-prsvr mailabbrev mail-utils gmm-utils mailheader mu4e-meta
tramp-archive tramp-gvfs tramp-cache zeroconf dbus flymake-proc flymake
sh-script smie executable jka-compr vc-rcs cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs conf-mode
bug-reference naquadah-theme solar cal-dst holidays hol-loaddefs
tv-utils undo-tree diff undo-tree-autoloads ligature ligature-autoloads
boxquote rect rainbow-mode-autoloads psession frameset wgrep-helm wgrep
grep compile text-property-search wgrep-autoloads log-view pcvs-util
pcmpl-git pcmpl-git-autoloads toc-org-autoloads cl-indent ffap
markdown-toc-autoloads markdown-mode-autoloads autocrypt ietf-drums
config-w3m w3m-autoloads git-gutter git-gutter-autoloads mule-util appt
diary-lib diary-loaddefs gud anaconda-mode xref project pythonic f dash
s anaconda-mode-autoloads pythonic-autoloads f-autoloads s-autoloads
emamux-autoloads magit-autoloads git-commit-autoloads
with-editor-autoloads transient-autoloads dash-autoloads
pcomplete-extension pcmpl-unix pcmpl-gnu iterator iedit-autoloads
ledger-mode-autoloads wdired dired-extension org-config ob-gnuplot
org-crypt net-utils time all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons all-the-icons-autoloads winner w3m-wget wget
wget-sysdep autotest-mode autoconf-mode paren woman man ediff ediff-merg
ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util
init-helm helm-fd epa derived epg epg-config helm-epa helm-misc
helm-imenu imenu helm-elisp-package package url-handlers helm-find
helm-org org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval
org-table ol org-keys org-compat org-macs org-loaddefs cal-menu calendar
cal-loaddefs helm-external helm-net browse-url xml url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util url-parse url-vars mailcap isearch-light helm-descbinds
helm-ls-git vc-git diff-mode vc vc-dispatcher helm-ipython helm-elisp
helm-eval edebug backtrace find-func helm-info python tramp-sh
use-package-bind-key bind-key popup helm-adaptive diminish helm-mode
helm-files filenotify tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat shell pcomplete comint ansi-color ring parse-time
iso8601 time-date ls-lisp auth-source password-cache json map
helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp
format-spec helm-utils helm-help helm-types use-package-diminish
cus-edit pp wid-edit helm-extensions-autoloads helm-config
helm-autoloads helm async-bytecomp helm-global-bindings helm-easymenu
helm-source eieio eieio-core eieio-loaddefs helm-multi-match helm-lib
dired-async advice dired-aux dired dired-loaddefs async emms-autoloads
finder-inf use-package-core popup-autoloads diminish-autoloads mb-depth
server edmacro kmacro avoid cus-load use-package-autoloads
bind-key-autoloads straight-autoloads comp comp-cstr warnings rx
cl-extra straight info autoload radix-tree seq easy-mmode pcase cl-seq
subr-x byte-opt checkdoc lisp-mnt thingatpt help-mode cl-macs gv
bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process nativecomp
emacs)

Memory information:
((conses 16 849478 250397)
 (symbols 48 45932 13)
 (strings 32 196999 46909)
 (string-bytes 1 6772063)
 (vectors 16 92466)
 (vector-slots 8 2285295 303392)
 (floats 8 2023 3104)
 (intervals 56 20423 4877)
 (buffers 992 125))
<#secure method=pgpmime mode=sign>

-- 
Thierry





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-27 16:58 bug#48067: 28.0.50; Tramp error: cannot determine gio monitor Thierry Volpiatto
@ 2021-04-27 19:19 ` Michael Albinus
  2021-04-27 21:38   ` Thierry Volpiatto
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-27 19:19 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

> When adding a file-notify watcher to a remote directory in helm-find-files, I
> have an error "cannot determine gio monitor":
>
> Debugger entered--Lisp error: (file-error "Cannot determine gio monitor")
>   signal(file-error ("Cannot determine gio monitor"))
>   tramp-sh-gio-monitor-process-filter(#<process gio> "\n(gio monitor:15942): GLib-GIO-\33[1;33mWARNING\33[0m ...")
>   [...]
>
> This doesn't happen in emacs-27.2.
> It happens in emacs-28 compiled with native-comp or not.
>
> which gio returns /usr/bin/gio.
>
> Any ideas?

Tramp searches for the gio monitor on the remote host. Does it exist there?

> Thanks.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-27 19:19 ` Michael Albinus
@ 2021-04-27 21:38   ` Thierry Volpiatto
  2021-04-28  5:59     ` Thierry Volpiatto
  0 siblings, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-27 21:38 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]


Hi Michael,

Michael Albinus <michael.albinus@gmx.de> writes:

> [[PGP Encrypted Part:OK]]
> Thierry Volpiatto <thievol@posteo.net> writes:
>
> Hi Thierry,
>
>> When adding a file-notify watcher to a remote directory in helm-find-files, I
>> have an error "cannot determine gio monitor":
>>
>> Debugger entered--Lisp error: (file-error "Cannot determine gio monitor")
>>   signal(file-error ("Cannot determine gio monitor"))
>>   tramp-sh-gio-monitor-process-filter(#<process gio> "\n(gio monitor:15942): GLib-GIO-\33[1;33mWARNING\33[0m ...")
>>   [...]
>>
>> This doesn't happen in emacs-27.2.
>> It happens in emacs-28 compiled with native-comp or not.
>>
>> which gio returns /usr/bin/gio.
>>
>> Any ideas?
>
> Tramp searches for the gio monitor on the remote host. Does it exist there?

Yes, and anyway this happen as well with sudo method on same machine.

>> Thanks.
>
> Best regards, Michael.
>
>
> [[End of PGP Encrypted Part]]


-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-27 21:38   ` Thierry Volpiatto
@ 2021-04-28  5:59     ` Thierry Volpiatto
  2021-04-28  7:38       ` Michael Albinus
  0 siblings, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-28  5:59 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 1331 bytes --]


Thierry Volpiatto <thievol@posteo.net> writes:

> Hi Michael,
>
> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> [[PGP Encrypted Part:OK]]
>> Thierry Volpiatto <thievol@posteo.net> writes:
>>
>> Hi Thierry,
>>
>>> When adding a file-notify watcher to a remote directory in helm-find-files, I
>>> have an error "cannot determine gio monitor":
>>>
>>> Debugger entered--Lisp error: (file-error "Cannot determine gio monitor")
>>>   signal(file-error ("Cannot determine gio monitor"))
>>>   tramp-sh-gio-monitor-process-filter(#<process gio> "\n(gio monitor:15942): GLib-GIO-\33[1;33mWARNING\33[0m ...")
>>>   [...]
>>>
>>> This doesn't happen in emacs-27.2.
>>> It happens in emacs-28 compiled with native-comp or not.
>>>
>>> which gio returns /usr/bin/gio.
>>>
>>> Any ideas?
>>
>> Tramp searches for the gio monitor on the remote host. Does it exist there?
>
> Yes, and anyway this happen as well with sudo method on same machine.

More exactly, it seems gio command is correctly extracted in
`tramp-sh-handle-file-notify-add-watch` with
(tramp-get-remote-gio-monitor v) but later in the process filter
(tramp-connection-property-p proc "gio-file-monitor") returns nil.

Thanks.

>>> Thanks.
>>
>> Best regards, Michael.
>>
>>
>> [[End of PGP Encrypted Part]]


-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28  5:59     ` Thierry Volpiatto
@ 2021-04-28  7:38       ` Michael Albinus
  2021-04-28 10:56         ` Thierry Volpiatto
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-28  7:38 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 396 bytes --]

Thierry Volpiatto <thievol@posteo.net> writes:

>> Hi Michael,

Hi Thierry,

> More exactly, it seems gio command is correctly extracted in
> `tramp-sh-handle-file-notify-add-watch` with
> (tramp-get-remote-gio-monitor v) but later in the process filter
> (tramp-connection-property-p proc "gio-file-monitor") returns nil.

Does the appended patch fixes this?

> Thanks.

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1755 bytes --]

*** /tmp/ediffdHBFUW	2021-04-28 09:36:25.118483724 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el	2021-04-28 09:36:03.920592244 +0200
***************
*** 3731,3737 ****
        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
          (cond
!          ;; We have seen this on cygwin gio and on emba.  Let's make some assumptions.
           ((string-match
             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
            (cond
--- 3731,3738 ----
        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
          (cond
!          ;; We have seen this on cygwin gio and on emba.  Let's make
!          ;; some assumptions.
           ((string-match
             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
            (cond
***************
*** 3741,3747 ****
             ((eq system-type 'cygwin)
              (tramp-set-connection-property
               proc "gio-file-monitor" 'GPollFileMonitor))
!            (t (tramp-error proc 'file-error "Cannot determine gio monitor"))))
           ;; TODO: What happens, if several monitor names are reported?
           ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:
--- 3742,3749 ----
             ((eq system-type 'cygwin)
              (tramp-set-connection-property
               proc "gio-file-monitor" 'GPollFileMonitor))
!            (t (tramp-set-connection-property
!                proc "gio-file-monitor" tramp-cache-undefined))))
           ;; TODO: What happens, if several monitor names are reported?
           ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28  7:38       ` Michael Albinus
@ 2021-04-28 10:56         ` Thierry Volpiatto
  2021-04-28 11:16           ` Michael Albinus
  0 siblings, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-28 10:56 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> Thierry Volpiatto <thievol@posteo.net> writes:
>
>>> Hi Michael,
>
> Hi Thierry,
>
>> More exactly, it seems gio command is correctly extracted in
>> `tramp-sh-handle-file-notify-add-watch` with
>> (tramp-get-remote-gio-monitor v) but later in the process filter
>> (tramp-connection-property-p proc "gio-file-monitor") returns nil.
>
> Does the appended patch fixes this?

Partially. No more error but the watcher have no effect like on
emacs-27.
helm-find-files is caching the directories it visits and for each
directory is adding a watcher, for example on emacs-27:

M-x helm-find-files => navigate to /sudo::/home/me/tmp/ directory:

foo.txt
bar.txt
baz.txt

Now from a shell:

touch ~/tmp/test.txt

M-x helm-find-files => navigate to /sudo::/home/me/tmp/ directory:

foo.txt
bar.txt
baz.txt
test.txt

test.txt is not added with emacs-28, that's mean the watcher didn't
notify helm to remove tmp directory from cache.

Thanks.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28 10:56         ` Thierry Volpiatto
@ 2021-04-28 11:16           ` Michael Albinus
       [not found]             ` <87czuefu94.fsf@posteo.net>
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-28 11:16 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

>> Does the appended patch fixes this?
>
> Partially. No more error but the watcher have no effect like on
> emacs-27.
> helm-find-files is caching the directories it visits and for each
> directory is adding a watcher, for example on emacs-27:
>
> M-x helm-find-files => navigate to /sudo::/home/me/tmp/ directory:
>
> foo.txt
> bar.txt
> baz.txt
>
> Now from a shell:
>
> touch ~/tmp/test.txt
>
> M-x helm-find-files => navigate to /sudo::/home/me/tmp/ directory:
>
> foo.txt
> bar.txt
> baz.txt
> test.txt
>
> test.txt is not added with emacs-28, that's mean the watcher didn't
> notify helm to remove tmp directory from cache.

I need Tramp traces with tramp-verbose set to 10. Please start a fresh
session via "emacs -Q".

You can send the traces direct to me, w/o debbugs.gnu.org in Cc, in
order not to trash the debbugs database and ML.

> Thanks.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
       [not found]             ` <87czuefu94.fsf@posteo.net>
@ 2021-04-28 13:57               ` Michael Albinus
       [not found]                 ` <87zgxi1nci.fsf@posteo.net>
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-28 13:57 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

Thierry Volpiatto <thievol@posteo.net> writes:

> Hello Michael,

Hi Thierry,

> What I did: M-x helm-find-files => /sudo::/home/thierry/tmp/
> Looks the watchers are recorded with a warning though.

That's OK. The warning tells us that it is an older gio version, which
doesn't want to speak about its implementation details. Not a big deal,
Tramp handles this.

> Then I delete test.txt from external terminal.
> It seems the watcher catched the event but the notification is with the
> local name of directory instead of the remote name.
> I.e. /home/thierry/tmp/ instead of /sudo::/home/thierry/tmp/
> not sure if it is normal.

That's OK. gio doesn't know Tramp and its syntax :-)

> 14:39:28.298343 tramp-sh-gio-monitor-process-filter (6) # #<process gio>
>
> (gio monitor:27194): GLib-GIO-%1b[1;33mWARNING%1b[0m **:
> %1b[34m14:39:28.217%1b[0m: Can't find module 'help' specified in GIO_USE_FILE_MONITOR

And here's the problem. The warning includes escape sequences, which are
not known to tramp-sh-gio-monitor-process-filter. So I've reworked the
patch as attached, could you pls test?

> Thanks.

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2831 bytes --]

*** /tmp/ediffoD9hFR	2021-04-28 15:56:06.972513700 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el	2021-04-28 15:49:29.271184411 +0200
***************
*** 3730,3760 ****

        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
!         (cond
!          ;; We have seen this on cygwin gio and on emba.  Let's make some assumptions.
!          ((string-match
!            "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
!           (cond
!            ((getenv "EMACS_EMBA_CI")
!             (tramp-set-connection-property
!              proc "gio-file-monitor" 'GInotifyFileMonitor))
!            ((eq system-type 'cygwin)
!             (tramp-set-connection-property
!              proc "gio-file-monitor" 'GPollFileMonitor))
!            (t (tramp-error proc 'file-error "Cannot determine gio monitor"))))
!          ;; TODO: What happens, if several monitor names are reported?
!          ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:
  \\s-*\\([[:alpha:]]+\\) - 20" string)
-           (tramp-set-connection-property
-            proc "gio-file-monitor"
             (intern
!             (format "G%sFileMonitor" (capitalize (match-string 1 string))))))
!          (t (throw 'doesnt-work nil)))
!         (setq string (replace-match "" nil nil string)))

        ;; Delete empty lines.
!       (setq string (tramp-compat-string-replace "\n\n" "\n" string))

        (while (string-match
  	      (eval-when-compile
--- 3730,3758 ----

        ;; Determine monitor name.
        (unless (tramp-connection-property-p proc "gio-file-monitor")
!         (tramp-set-connection-property
!          proc "gio-file-monitor"
!          (cond
!           ;; We have seen this on cygwin gio and on emba.  Let's make
!           ;; some assumptions.
!           ((string-match
!             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
!            (cond
!             ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
!             ((eq system-type 'cygwin) 'GPollFileMonitor)
!             (t tramp-cache-undefined)))
!           ;; TODO: What happens, if several monitor names are reported?
!           ((string-match "\
  Supported arguments for GIO_USE_FILE_MONITOR environment variable:
  \\s-*\\([[:alpha:]]+\\) - 20" string)
             (intern
! 	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
!           (t (throw 'doesnt-work nil))))
! 	(setq string (substring string (match-end 0))))

        ;; Delete empty lines.
!       (setq string (tramp-compat-string-replace "\n\n" "\n" string)
! 	    string (replace-regexp-in-string "^\n" "" string))

        (while (string-match
  	      (eval-when-compile

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
       [not found]                   ` <87zgxixx8j.fsf@posteo.net>
@ 2021-04-28 16:25                     ` Michael Albinus
       [not found]                       ` <87tunqxrii.fsf@posteo.net>
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-28 16:25 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

> If it can help here the relevant part of the tramp log from emacs-27:
>
> 17:01:06.548820 tramp-get-file-property (8) # /home/thierry/tmp file-exists-p t
> 17:01:09.974262 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p t
> 17:01:14.119915 tramp-sh-gio-monitor-process-filter (6) # #<process gio>
> /home/thierry/tmp: /home/thierry/tmp/test.txt: created
> /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
> /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed

As you see, there're also local file names.

> 17:01:14.121499 tramp-accept-process-output (10) # gio 0 run nil
> 17:01:14.121681 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio>
> 17:01:14.121981 tramp-file-notify-process-sentinel (5) # Sentinel
> called: `#<process gio>' `processus arrêté
> '
> 17:01:14.122501 tramp-accept-process-output (10) # gio 0 signal nil
> 17:01:14.122652 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio>
> 17:01:14.122948 tramp-sh-gio-monitor-process-filter (10) # Rest string:
>
> 17:01:18.684045 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p undef
>
> As you can see the *rm-watch is called.

Yes. But we don't see why. And I also don't know how this is related to
your problem.

OK, a test. I use the handler from the elisp manual:

--8<---------------cut here---------------start------------->8---
(defun my-notify-callback (event)
  (message "Event %S" event))
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
1. Use Emacs 27

[albinus@gandalf ~]$ ~/src/emacs-27/src/emacs

M-: tramp-version
=> "2.4.5.27.2"

M-: (file-notify-add-watch "/ssh:freebsd12:/tmp" '(change attribute-change) 'my-notify-callback)
=> #<process gio>

albinus@freebsd12:~ % touch /tmp/test.txt
=> Event (#<process gio> created "/ssh:freebsd12:/tmp/test.txt")

albinus@freebsd12:~ % rm /tmp/test.txt
=> Event (#<process gio> deleted "/ssh:freebsd12:/tmp/test.txt")
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
2. Use Emacs 28

[albinus@gandalf ~]$ ~/src/emacs/src/emacs

M-: tramp-version
=> "2.5.1-pre"

M-: (file-notify-add-watch "/ssh:freebsd12:/tmp" '(change attribute-change) 'my-notify-callback)
=> #<process gio>

albinus@freebsd12:~ % touch /tmp/test.txt
=> Event (#<process gio> created "/ssh:freebsd12:/tmp/test.txt")

albinus@freebsd12:~ % rm /tmp/test.txt
=> Event (#<process gio> deleted "/ssh:freebsd12:/tmp/test.txt")
--8<---------------cut here---------------end--------------->8---

Exactly the same events.

> Thanks.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
       [not found]                       ` <87tunqxrii.fsf@posteo.net>
@ 2021-04-28 17:39                         ` Michael Albinus
  2021-04-28 18:28                           ` Thierry Volpiatto
  2021-04-28 18:47                           ` Thierry Volpiatto
  0 siblings, 2 replies; 26+ messages in thread
From: Michael Albinus @ 2021-04-28 17:39 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,
>>> 17:01:06.548820 tramp-get-file-property (8) # /home/thierry/tmp file-exists-p t
>>> 17:01:09.974262 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p t
>>> 17:01:14.119915 tramp-sh-gio-monitor-process-filter (6) # #<process gio>
>>> /home/thierry/tmp: /home/thierry/tmp/test.txt: created
>>> /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
>>> /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed
>>
>> As you see, there're also local file names.
>
> Yes, I saw this it is why I don't understand how it could work on 27 and
> not on 28.

What exactly does not work on Emacs 28? Events do not arrive? Events
have wrong values?

>>> 17:01:14.121499 tramp-accept-process-output (10) # gio 0 run nil
>>> 17:01:14.121681 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio>
>>> 17:01:14.121981 tramp-file-notify-process-sentinel (5) # Sentinel
>>> called: `#<process gio>' `processus arrêté
>>> '
>>> 17:01:14.122501 tramp-accept-process-output (10) # gio 0 signal nil
>>> 17:01:14.122652 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio>
>>> 17:01:14.122948 tramp-sh-gio-monitor-process-filter (10) # Rest string:
>>>
>>> 17:01:18.684045 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p undef
>>>
>>> As you can see the *rm-watch is called.
>>
>> Yes. But we don't see why.
>
> This is what I would like to know ;-)
>
>> And I also don't know how this is related to your problem.
>
> I am not sure it is related to my problem, I just suspect it is.

Maybe you can set file-notify-debug to t? You will see how events go
around.

>> OK, a test. I use the handler from the elisp manual:
>
> Yes, I already tried similar tests.

So I've lost you. What works, and what not?

> Anyway, perhaps you can push your changes? They are an improvement over
> what is actually in master.

Done.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28 17:39                         ` Michael Albinus
@ 2021-04-28 18:28                           ` Thierry Volpiatto
  2021-04-28 18:47                           ` Thierry Volpiatto
  1 sibling, 0 replies; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-28 18:28 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 2301 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> [[PGP Encrypted Part:OK]]
> Thierry Volpiatto <thievol@posteo.net> writes:
>
> Hi Thierry,
>>>> 17:01:06.548820 tramp-get-file-property (8) # /home/thierry/tmp file-exists-p t
>>>> 17:01:09.974262 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p t
>>>> 17:01:14.119915 tramp-sh-gio-monitor-process-filter (6) # #<process gio>
>>>> /home/thierry/tmp: /home/thierry/tmp/test.txt: created
>>>> /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
>>>> /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed
>>>
>>> As you see, there're also local file names.
>>
>> Yes, I saw this it is why I don't understand how it could work on 27 and
>> not on 28.
>
> What exactly does not work on Emacs 28?

helm-find-files cache is not updated when something change in a remote
directory.


> Events do not arrive?

Yes.

> Events have wrong values?


>>>> 17:01:14.121499 tramp-accept-process-output (10) # gio 0 run nil
>>>> 17:01:14.121681 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio>
>>>> 17:01:14.121981 tramp-file-notify-process-sentinel (5) # Sentinel
>>>> called: `#<process gio>' `processus arrêté
>>>> '
>>>> 17:01:14.122501 tramp-accept-process-output (10) # gio 0 signal nil
>>>> 17:01:14.122652 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio>
>>>> 17:01:14.122948 tramp-sh-gio-monitor-process-filter (10) # Rest string:
>>>>
>>>> 17:01:18.684045 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p undef
>>>>
>>>> As you can see the *rm-watch is called.
>>>
>>> Yes. But we don't see why.
>>
>> This is what I would like to know ;-)
>>
>>> And I also don't know how this is related to your problem.
>>
>> I am not sure it is related to my problem, I just suspect it is.
>
> Maybe you can set file-notify-debug to t? You will see how events go
> around.
>
>>> OK, a test. I use the handler from the elisp manual:
>>
>> Yes, I already tried similar tests.
>
> So I've lost you. What works, and what not?
>
>> Anyway, perhaps you can push your changes? They are an improvement over
>> what is actually in master.
>
> Done.
>
> Best regards, Michael.
>
>
> [[End of PGP Encrypted Part]]


-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28 17:39                         ` Michael Albinus
  2021-04-28 18:28                           ` Thierry Volpiatto
@ 2021-04-28 18:47                           ` Thierry Volpiatto
  2021-04-28 18:56                             ` Michael Albinus
  1 sibling, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-28 18:47 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> Maybe you can set file-notify-debug to t? You will see how events go
> around.

Thanks for this, it helps.

This happen on emacs-27:

;; file-notify-handle-event (file-notify (#<process gio<4>> (changes-done-hint) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
;; file-notify-handle-event (file-notify (#<process gio<4>> (attribute-changed) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)

On emacs-28 nothing happen when modifying externally same directory
(tmp).


-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28 18:47                           ` Thierry Volpiatto
@ 2021-04-28 18:56                             ` Michael Albinus
  2021-04-29  5:33                               ` Thierry Volpiatto
  2021-04-29  6:09                               ` Thierry Volpiatto
  0 siblings, 2 replies; 26+ messages in thread
From: Michael Albinus @ 2021-04-28 18:56 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

> This happen on emacs-27:
>
> ;; file-notify-handle-event (file-notify (#<process gio<4>> (changes-done-hint) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
> ;; file-notify-handle-event (file-notify (#<process gio<4>> (attribute-changed) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>
> On emacs-28 nothing happen when modifying externally same directory
> (tmp).

Strange. Have you tried "M-x tramp-cleanup-all-connections"? Prior to
connecting the remote machine.

Otherwise, I have no idea (it works for me as I have shown). Is there a
chance I could debug, connecting your remote machine?

Otherwise, I would need to write special instrumentations in
tramp-sh-gio-monitor-process-filter just for you.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28 18:56                             ` Michael Albinus
@ 2021-04-29  5:33                               ` Thierry Volpiatto
  2021-04-29  7:17                                 ` Michael Albinus
  2021-04-29  6:09                               ` Thierry Volpiatto
  1 sibling, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29  5:33 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 3963 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> [[PGP Encrypted Part:OK]]
> Thierry Volpiatto <thievol@posteo.net> writes:
>
>> This happen on emacs-27:
>>
>> ;; file-notify-handle-event (file-notify (#<process gio<4>> (changes-done-hint) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>> ;; file-notify-handle-event (file-notify (#<process gio<4>> (attribute-changed) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>>
>> On emacs-28 nothing happen when modifying externally same directory
>> (tmp).
>
> Strange. Have you tried "M-x tramp-cleanup-all-connections"? Prior to
> connecting the remote machine.

I always start a new emacs session for debugging.

> Otherwise, I have no idea (it works for me as I have shown).

No, it is not the same example, please bear with me, try with same
conditions and with tramp-debug and file-notify-debug set:

1) Install helm

2) open a terminal outside emacs

3) run in emacs helm-find-files and navigate to /sudo::/home/you/tmp/

4) go to the terminal opened in 2) and touch ~/tmp/test.txt

5) go back to emacs and see nothing happened

Now do the same from emacs-27 and see in 5) that an *rm-watch happened.

Here the relevant logs for emacs-28 and emacs-27:

;; Emacs 28
001 07:12:50.967691 tramp-sh-gio-monitor-process-filter (6) # #<process gio<4>>
002 (gio monitor:29342): GLib-GIO-1;33mWARNING0m **: 34m07:12:50.946[0m: Can't find module 'help' specified in GIO_USE_FILE_MONITOR
003 07:12:50.967794 tramp-get-connection-property (7) # gio-file-monitor undef; cache used: nil
004 07:12:50.967879 tramp-set-connection-property (7) # gio-file-monitor undef
005 07:12:54.974248 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p t; inhibit: 10; cache used: t; cached at: 07:12:50
006 07:13:00.401319 tramp-sh-gio-monitor-process-filter (6) # #<process gio<4>>
007 /home/thierry/tmp: /home/thierry/tmp/test.txt: created
008 /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
009 /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed
010 07:13:00.401503 tramp-get-connection-property (7) # gio-file-monitor undef; cache used: nil
011 07:13:00.401656 tramp-sh-gio-monitor-process-filter (10) # Rest string:
012 /home/thierry/tmp: /home/thierry/tmp/test.txt: created
013 /home/thierry/tmp: /home/thierry/tmp/test.txt: changes-done-hint
014 /home/thierry/tmp: /home/thierry/tmp/test.txt: attribute-changed
015 07:13:10.485947 tramp-get-file-property (8) # /home/thierry/tmp file-directory-p undef; inhibit: 10; cache used: nil; cached at: 07:12:50


;; Emacs 27
001 07:21:11.964043 tramp-sh-gio-monitor-process-filter (6) # #<process gio<4>>
002 /home/thierry/tmp: /home/thierry/tmp/test.txt: created
003 /home/thierry/tmp: /home/thierry/tmp/test.txt: changes done
004 /home/thierry/tmp: /home/thierry/tmp/test.txt: attributes changed
005 07:21:11.980001 tramp-accept-process-output (10) # gio<4> 0 run nil
006 07:21:11.980151 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio<4>>
007 07:21:11.980343 tramp-file-notify-process-sentinel (5) # Sentinel called: `#<process gio<4>>' `processus arrêté'
008 07:21:11.980657 tramp-accept-process-output (10) # gio<4> 0 signal nil
009 07:21:11.980747 tramp-handle-file-notify-rm-watch (6) # Kill #<process gio<4>>
010 07:21:11.988139 tramp-sh-gio-monitor-process-filter (10) # Rest string:

You can see that in line 009 in emacs-27 log an *rm-watch happen whereas
in emacs28 it doesn't happen.

> Is there a chance I could debug, connecting your remote machine?

Yes sure, I have just to create an account with an installed emacs28 for
you, but please try first on your side with same recipe.

> Otherwise, I would need to write special instrumentations in
> tramp-sh-gio-monitor-process-filter just for you.
>
> Best regards, Michael.
>
>
> [[End of PGP Encrypted Part]]


-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-28 18:56                             ` Michael Albinus
  2021-04-29  5:33                               ` Thierry Volpiatto
@ 2021-04-29  6:09                               ` Thierry Volpiatto
  2021-04-29  6:46                                 ` Thierry Volpiatto
  1 sibling, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29  6:09 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 3391 bytes --]


Update:

After commenting a block of code in
`tramp-sh-gio-monitor-process-filter` it is now working properly, events
are created, here the diff:

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 4a3072ee346..3f5ec76864b 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3732,23 +3732,24 @@ Fall back to normal file name handler if no Tramp handler exists."
       (unless (tramp-connection-property-p proc "gio-file-monitor")
         (tramp-set-connection-property
          proc "gio-file-monitor"
-         (cond
-          ;; We have seen this on cygwin gio and on emba.  Let's make
-          ;; some assumptions.
-          ((string-match
-            "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
-           (cond
-            ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
-            ((eq system-type 'cygwin) 'GPollFileMonitor)
-            (t tramp-cache-undefined)))
-          ;; TODO: What happens, if several monitor names are reported?
-          ((string-match "\
-Supported arguments for GIO_USE_FILE_MONITOR environment variable:
-\\s-*\\([[:alpha:]]+\\) - 20" string)
-           (intern
-	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
-          (t (throw 'doesnt-work nil))))
-	(setq string (substring string (match-end 0))))
+         tramp-cache-undefined))
+;;          (cond
+;;           ;; We have seen this on cygwin gio and on emba.  Let's make
+;;           ;; some assumptions.
+;;           ((string-match
+;;             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
+;;            (cond
+;;             ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
+;;             ((eq system-type 'cygwin) 'GPollFileMonitor)
+;;             (t tramp-cache-undefined)))
+;;           ;; TODO: What happens, if several monitor names are reported?
+;;           ((string-match "\
+;; Supported arguments for GIO_USE_FILE_MONITOR environment variable:
+;; \\s-*\\([[:alpha:]]+\\) - 20" string)
+;;            (intern
+;; 	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
+;;           (t (throw 'doesnt-work nil))))
+;; 	(setq string (substring string (match-end 0))))
 
       ;; Delete empty lines.
       (setq string (tramp-compat-string-replace "\n\n" "\n" string)

Michael Albinus <michael.albinus@gmx.de> writes:

> [[PGP Encrypted Part:OK]]
> Thierry Volpiatto <thievol@posteo.net> writes:
>
>> This happen on emacs-27:
>>
>> ;; file-notify-handle-event (file-notify (#<process gio<4>> (changes-done-hint) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>> ;; file-notify-handle-event (file-notify (#<process gio<4>> (attribute-changed) "/sudo:root@IPadS340:/home/thierry/tmp/test.txt" nil) file-notify-callback)
>>
>> On emacs-28 nothing happen when modifying externally same directory
>> (tmp).
>
> Strange. Have you tried "M-x tramp-cleanup-all-connections"? Prior to
> connecting the remote machine.
>
> Otherwise, I have no idea (it works for me as I have shown). Is there a
> chance I could debug, connecting your remote machine?
>
> Otherwise, I would need to write special instrumentations in
> tramp-sh-gio-monitor-process-filter just for you.
>
> Best regards, Michael.
>
>
> [[End of PGP Encrypted Part]]


-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29  6:09                               ` Thierry Volpiatto
@ 2021-04-29  6:46                                 ` Thierry Volpiatto
  2021-04-29  8:11                                   ` Michael Albinus
  0 siblings, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29  6:46 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]


Update2:
More exactly the error occur when setting 'string':

diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 4a3072ee346..8885bd55846 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3748,7 +3748,8 @@ Supported arguments for GIO_USE_FILE_MONITOR environment variable:
            (intern
 	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
           (t (throw 'doesnt-work nil))))
-	(setq string (substring string (match-end 0))))
+	;(setq string (substring string (match-end 0)))
+        )
 
       ;; Delete empty lines.
       (setq string (tramp-compat-string-replace "\n\n" "\n" string)

With this commented line events occur as expected.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29  5:33                               ` Thierry Volpiatto
@ 2021-04-29  7:17                                 ` Michael Albinus
  2021-04-29  7:48                                   ` Thierry Volpiatto
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-29  7:17 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

>> Is there a chance I could debug, connecting your remote machine?
>
> Yes sure, I have just to create an account with an installed emacs28 for
> you, but please try first on your side with same recipe.

Thanks. In case we go this way, you don't need to install a local
Emacs. It would be sufficient for me to have ssh access to a restricted
account on that machine.

For the time being I will see, whether your other messages give me
enough input to improve. Thanks for their analysis anyway!

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29  7:17                                 ` Michael Albinus
@ 2021-04-29  7:48                                   ` Thierry Volpiatto
  0 siblings, 0 replies; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29  7:48 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> Thierry Volpiatto <thievol@posteo.net> writes:
>
> Hi Thierry,
>
>>> Is there a chance I could debug, connecting your remote machine?
>>
>> Yes sure, I have just to create an account with an installed emacs28 for
>> you, but please try first on your side with same recipe.
>
> Thanks. In case we go this way, you don't need to install a local
> Emacs.

Ok, if needed you will be able to run helm from system install with just
helm -nw from command line without the need of installing anything else.

> It would be sufficient for me to have ssh access to a restricted
> account on that machine.

Ok, let me know when you need it, I will send you an encrypted message
privately with instructions to connect.

> For the time being I will see, whether your other messages give me
> enough input to improve. Thanks for their analysis anyway!

Thanks!

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29  6:46                                 ` Thierry Volpiatto
@ 2021-04-29  8:11                                   ` Michael Albinus
  2021-04-29  8:42                                     ` Thierry Volpiatto
       [not found]                                     ` <87r1it5u0q.fsf@posteo.net>
  0 siblings, 2 replies; 26+ messages in thread
From: Michael Albinus @ 2021-04-29  8:11 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

Thierry Volpiatto <thievol@posteo.net> writes:

> Update2:
> More exactly the error occur when setting 'string':
>
> diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
> index 4a3072ee346..8885bd55846 100644
> --- a/lisp/net/tramp-sh.el
> +++ b/lisp/net/tramp-sh.el
> @@ -3748,7 +3748,8 @@ Supported arguments for GIO_USE_FILE_MONITOR environment variable:
>             (intern
>  	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
>            (t (throw 'doesnt-work nil))))
> -	(setq string (substring string (match-end 0))))
> +	;(setq string (substring string (match-end 0)))
> +        )
>
>        ;; Delete empty lines.
>        (setq string (tramp-compat-string-replace "\n\n" "\n" string)
>
> With this commented line events occur as expected.

So the problem is the match-end call. Here's a patch which might fix
this. In case it doesn't work, pls give me ssh access to your machine. I
would send you my public ssh key for access.

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1988 bytes --]

diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 4a3072ee..4506e8a2 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -3732,23 +3732,24 @@ Fall back to normal file name handler if no Tramp handler exists."
       (unless (tramp-connection-property-p proc "gio-file-monitor")
         (tramp-set-connection-property
          proc "gio-file-monitor"
-         (cond
-          ;; We have seen this on cygwin gio and on emba.  Let's make
-          ;; some assumptions.
-          ((string-match
-            "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
-           (cond
-            ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
-            ((eq system-type 'cygwin) 'GPollFileMonitor)
-            (t tramp-cache-undefined)))
-          ;; TODO: What happens, if several monitor names are reported?
-          ((string-match "\
+	 (prog1
+             (cond
+              ;; We have seen this on cygwin gio and on emba.  Let's make
+              ;; some assumptions.
+              ((string-match "\
+[^z-a]*Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
+               (cond
+		((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
+		((eq system-type 'cygwin) 'GPollFileMonitor)
+		(t nil)))
+              ;; TODO: What happens, if several monitor names are reported?
+              ((string-match "\
 Supported arguments for GIO_USE_FILE_MONITOR environment variable:
 \\s-*\\([[:alpha:]]+\\) - 20" string)
-           (intern
-	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
-          (t (throw 'doesnt-work nil))))
-	(setq string (substring string (match-end 0))))
+               (intern
+		(format "G%sFileMonitor" (capitalize (match-string 1 string)))))
+              (t (throw 'doesnt-work nil)))
+	   (setq string (substring string (match-end 0))))))

       ;; Delete empty lines.
       (setq string (tramp-compat-string-replace "\n\n" "\n" string)

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29  8:11                                   ` Michael Albinus
@ 2021-04-29  8:42                                     ` Thierry Volpiatto
       [not found]                                     ` <87r1it5u0q.fsf@posteo.net>
  1 sibling, 0 replies; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29  8:42 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> Thierry Volpiatto <thievol@posteo.net> writes:
>
>> Update2:
>> More exactly the error occur when setting 'string':
>>
>> diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
>> index 4a3072ee346..8885bd55846 100644
>> --- a/lisp/net/tramp-sh.el
>> +++ b/lisp/net/tramp-sh.el
>> @@ -3748,7 +3748,8 @@ Supported arguments for GIO_USE_FILE_MONITOR environment variable:
>>             (intern
>>  	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
>>            (t (throw 'doesnt-work nil))))
>> -	(setq string (substring string (match-end 0))))
>> +	;(setq string (substring string (match-end 0)))
>> +        )
>>
>>        ;; Delete empty lines.
>>        (setq string (tramp-compat-string-replace "\n\n" "\n" string)
>>
>> With this commented line events occur as expected.
>
> So the problem is the match-end call. Here's a patch which might fix
> this.

No, it doesn't fix it, as long as string is set with 
(setq string (substring string (match-end 0))) it doesn't work,
*rm-watch is never called.

> In case it doesn't work, pls give me ssh access to your machine.

Ok will prepare it.

> I would send you my public ssh key for access.

No thanks, PAM login will be enabled.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
       [not found]                                       ` <87pmydz9my.fsf@gmx.de>
@ 2021-04-29 10:55                                         ` Michael Albinus
  2021-04-29 11:26                                           ` Thierry Volpiatto
  0 siblings, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-29 10:55 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]

Hi Thierry,

> It works, and I can reproduce the problem. Now debugging.

With the appended patch, it works for me on your machine. Could you pls check?

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1669 bytes --]

diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 4a3072ee..321fd7a5 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -3708,7 +3708,8 @@ Fall back to normal file name handler if no Tramp handler exists."
 	(remote-prefix
 	 (with-current-buffer (process-buffer proc)
 	   (file-remote-p default-directory)))
-	(rest-string (process-get proc 'rest-string)))
+	(rest-string (process-get proc 'rest-string))
+	pos)
     (when rest-string
       (tramp-message proc 10 "Previous string:\n%s" rest-string))
     (tramp-message proc 6 "%S\n%s" proc string)
@@ -3737,18 +3738,20 @@ Fall back to normal file name handler if no Tramp handler exists."
           ;; some assumptions.
           ((string-match
             "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string)
+	   (setq pos (match-end 0))
            (cond
             ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor)
             ((eq system-type 'cygwin) 'GPollFileMonitor)
-            (t tramp-cache-undefined)))
+            (t nil)))
           ;; TODO: What happens, if several monitor names are reported?
           ((string-match "\
 Supported arguments for GIO_USE_FILE_MONITOR environment variable:
 \\s-*\\([[:alpha:]]+\\) - 20" string)
+	   (setq pos (match-end 0))
            (intern
 	    (format "G%sFileMonitor" (capitalize (match-string 1 string)))))
-          (t (throw 'doesnt-work nil))))
-	(setq string (substring string (match-end 0))))
+          (t (setq pos (point-max)) nil)))
+	(setq string (substring string pos)))

       ;; Delete empty lines.
       (setq string (tramp-compat-string-replace "\n\n" "\n" string)

^ permalink raw reply related	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29 10:55                                         ` Michael Albinus
@ 2021-04-29 11:26                                           ` Thierry Volpiatto
  2021-04-29 11:30                                             ` Thierry Volpiatto
  2021-04-29 13:07                                             ` Michael Albinus
  0 siblings, 2 replies; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29 11:26 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067

[-- Attachment #1: Type: text/plain, Size: 273 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> Hi Thierry,
>
>> It works, and I can reproduce the problem. Now debugging.
>
> With the appended patch, it works for me on your machine. Could you pls check?

I confirm it works, great! Thanks!

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29 11:26                                           ` Thierry Volpiatto
@ 2021-04-29 11:30                                             ` Thierry Volpiatto
  2021-04-29 13:09                                               ` Michael Albinus
  2021-04-29 13:07                                             ` Michael Albinus
  1 sibling, 1 reply; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29 11:30 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067


[-- Attachment #1.1: Type: text/plain, Size: 464 bytes --]


Thierry Volpiatto <thievol@posteo.net> writes:

> Michael Albinus <michael.albinus@gmx.de> writes:
>
>> Hi Thierry,
>>
>>> It works, and I can reproduce the problem. Now debugging.
>>
>> With the appended patch, it works for me on your machine. Could you pls check?
>
> I confirm it works, great! Thanks!

While we are at it perhaps you can use ansi-color-apply in tramp log
unless it cause performance problems (seems it doesn't)?

-- 
Thierry

[-- Attachment #1.2: Capture d’écran_2021-04-29_09-40-13.png --]
[-- Type: image/png, Size: 46470 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29 11:26                                           ` Thierry Volpiatto
  2021-04-29 11:30                                             ` Thierry Volpiatto
@ 2021-04-29 13:07                                             ` Michael Albinus
  2021-04-29 13:20                                               ` Thierry Volpiatto
  1 sibling, 1 reply; 26+ messages in thread
From: Michael Albinus @ 2021-04-29 13:07 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067-done

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

>>> It works, and I can reproduce the problem. Now debugging.
>>
>> With the appended patch, it works for me on your machine. Could you pls check?
>
> I confirm it works, great! Thanks!

Thanks for the feedback, and for your kind hosting of my tests.

I've pushed to latest changes to master, slightly modified. Closing the bug.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29 11:30                                             ` Thierry Volpiatto
@ 2021-04-29 13:09                                               ` Michael Albinus
  0 siblings, 0 replies; 26+ messages in thread
From: Michael Albinus @ 2021-04-29 13:09 UTC (permalink / raw)
  To: Thierry Volpiatto; +Cc: 48067

Thierry Volpiatto <thievol@posteo.net> writes:

Hi Thierry,

> While we are at it perhaps you can use ansi-color-apply in tramp log
> unless it cause performance problems (seems it doesn't)?

No, that's not to idea of Tramp's debug buffer. It is important to see
every single char, also ANSI escape sequences, for debugging. Often, the
problems are hidden there.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 26+ messages in thread

* bug#48067: 28.0.50; Tramp error: cannot determine gio monitor
  2021-04-29 13:07                                             ` Michael Albinus
@ 2021-04-29 13:20                                               ` Thierry Volpiatto
  0 siblings, 0 replies; 26+ messages in thread
From: Thierry Volpiatto @ 2021-04-29 13:20 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 48067-done

[-- Attachment #1: Type: text/plain, Size: 508 bytes --]


Michael Albinus <michael.albinus@gmx.de> writes:

> Thierry Volpiatto <thievol@posteo.net> writes:
>
> Hi Thierry,
>
>>>> It works, and I can reproduce the problem. Now debugging.
>>>
>>> With the appended patch, it works for me on your machine. Could you pls check?
>>
>> I confirm it works, great! Thanks!
>
> Thanks for the feedback, and for your kind hosting of my tests.
>
> I've pushed to latest changes to master, slightly modified. Closing the bug.

Great! Thanks.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-04-29 13:20 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-27 16:58 bug#48067: 28.0.50; Tramp error: cannot determine gio monitor Thierry Volpiatto
2021-04-27 19:19 ` Michael Albinus
2021-04-27 21:38   ` Thierry Volpiatto
2021-04-28  5:59     ` Thierry Volpiatto
2021-04-28  7:38       ` Michael Albinus
2021-04-28 10:56         ` Thierry Volpiatto
2021-04-28 11:16           ` Michael Albinus
     [not found]             ` <87czuefu94.fsf@posteo.net>
2021-04-28 13:57               ` Michael Albinus
     [not found]                 ` <87zgxi1nci.fsf@posteo.net>
     [not found]                   ` <87zgxixx8j.fsf@posteo.net>
2021-04-28 16:25                     ` Michael Albinus
     [not found]                       ` <87tunqxrii.fsf@posteo.net>
2021-04-28 17:39                         ` Michael Albinus
2021-04-28 18:28                           ` Thierry Volpiatto
2021-04-28 18:47                           ` Thierry Volpiatto
2021-04-28 18:56                             ` Michael Albinus
2021-04-29  5:33                               ` Thierry Volpiatto
2021-04-29  7:17                                 ` Michael Albinus
2021-04-29  7:48                                   ` Thierry Volpiatto
2021-04-29  6:09                               ` Thierry Volpiatto
2021-04-29  6:46                                 ` Thierry Volpiatto
2021-04-29  8:11                                   ` Michael Albinus
2021-04-29  8:42                                     ` Thierry Volpiatto
     [not found]                                     ` <87r1it5u0q.fsf@posteo.net>
     [not found]                                       ` <87pmydz9my.fsf@gmx.de>
2021-04-29 10:55                                         ` Michael Albinus
2021-04-29 11:26                                           ` Thierry Volpiatto
2021-04-29 11:30                                             ` Thierry Volpiatto
2021-04-29 13:09                                               ` Michael Albinus
2021-04-29 13:07                                             ` Michael Albinus
2021-04-29 13:20                                               ` Thierry Volpiatto

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).