syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.69k stars 4.9k forks source link

Error running timer 'auto-revert-buffers': (wrong-type-argument stringp nil) #11314

Closed non-Jedi closed 6 months ago

non-Jedi commented 6 years ago

Description :octocat:

Constantly get error: Error running timer ‘auto-revert-buffers’: (wrong-type-argument stringp nil)

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart:

*Messages* buffer fills up with an alarming number of the aforementioned error.

Expected behaviour: :heart: :smile:

No errors.

System Info :computer:

Backtrace :paw_prints:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil)
  auto-revert-notify-add-watch()
  auto-revert-buffers()
  apply(auto-revert-buffers nil)
  timer-event-handler([t 23448 6609 992916 5 auto-revert-buffers nil nil 643000])
non-Jedi commented 6 years ago

Additional data seemingly related: when I open a #+BEGIN_SRC julia block in org-mode using SPC-m-', I get the following backtrace; everything seems to be working otherwise though. No error with #+BEGIN_SRC python or similar.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-exists-p(nil)
  flycheck-may-check-automatically(save)
  flycheck-buffer-automatically(save)
  flycheck-handle-save()
  run-hooks(after-save-hook)
  basic-save-buffer(t)
  save-buffer(1)
  funcall-interactively(save-buffer 1)
  call-interactively(save-buffer nil nil)
  command-execute(save-buffer)
non-Jedi commented 6 years ago

@tpapp could the recent update to julia-repl be causing this? Does julia-repl handle the case where the buffer it's being invoked in doesn't have an associated file? Theory would be that adding julia-repl-mode to julia-mode-hook is where things get mixed up.

EDIT: can confirm that disabling julia-repl-mode resolves issue. Filing bug upstream.

selimober commented 6 years ago

Can confirm the same working on a Clojure file. I'm on rev 9865e7731

peterhoeg commented 6 years ago

I am not using neither Julia nor Clojure but I'm getting the same error. I'm guessing it's coming from the git layer as we both have that in common and the magit package is the only one doing anything with auto-revert-buffers. @selimober, you are using the git layer too?

selimober commented 6 years ago

@peterhoeg both git and version-control are enabled in my config. But the funny thing I don't get this error anymore...

peterhoeg commented 6 years ago

Looks like like this is no longer happening after updating to the latest develop...

non-Jedi commented 6 years ago

@d12frosted this problem still exists with the julia layer using julia-repl in particular even if the more general problem described by others in this thread has gone away. See https://github.com/tpapp/julia-repl/issues/41

peterhoeg commented 5 years ago

When this happens, it becomes impossible to save. The workaround is the following which kills the timers:

(cancel-function-timers 'auto-revert-buffers)
non-Jedi commented 5 years ago

@peterhoeg have you updated org-mode to 9.2? That fixed it for me as per the conversation in https://github.com/tpapp/julia-repl/issues/41.

peterhoeg commented 5 years ago

@non-Jedi, yep, on 9.2. But it happens very randomly/rarely.

NightMachinery commented 4 years ago

I get this, too.

System Info :computer:

Backtrace :paw_prints:

montaropdf commented 4 years ago

I also get this problem since sometimes now. It always happen after updating my emacs packages. The problem disappear if I restart Emacs.

I face the problem on Fedora 32 and CentOS 8, all using vanilla Emacs.

My base configuration is here.

vibrys commented 4 years ago

stumbled upon the same issue: emacs.26.3 + spacemacs

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
expand-file-name(nil)
auto-revert-notify-add-watch()
#f(compiled-function () #<bytecode 0x16a1241>)()
auto-revert-buffers--buffer-list-filter(#f(compiled-function () #<bytecode 0x16a1241>))
apply(auto-revert-buffers--buffer-list-filter #f(compiled-function () #<bytecode 0x16a1241>) nil)
auto-revert-buffers()
apply(auto-revert-buffers nil)
timer-event-handler([t 24437 53894 649534 5 auto-revert-buffers nil nil 173000])

happens, just after I've compiled some c++ source file

(buffer-file-name) returns nil, when called from within auto-revert-buffers.

'(setq global-auto-revert-non-file-buffers nil)` doesn't cure

(buffer-name) run from 'auto-revert-notify-add-watch` returns *helm* string

vibrys commented 4 years ago

IMO, this has strong relation with the following:

(progn
  (require 'helm-make)
  (with-helm-default-directory
      "/path/to/dir/containing/Makefile/file/"
    (let
        ((targets
          (helm--make-cached-targets "Makefile"))
         (default-directory (file-name-directory "Makefile"))
         )
      (helm :sources
            (helm-build-sync-source "Targets" :candidates 'targets :fuzzy-match helm-make-fuzzy-matching :action 'identity)
            :history 'helm-make-target-history :input
            (when helm-make-target-history
              (car helm-make-target-history))))))

it is reproducible on vanilla spacemacs origin/develop but not on vanilla helm.

NOTE: if You comment out default-directory setting, then problem does not persist. NOTE: problem persists at first call after startup.

lsandov1 commented 3 years ago

I started hitting this problem today but I am not a spacemacs user (sorry) but I am magit user. Under the magit code, grep matchez some auto-revert-buffers calls, so magit may be the culprit, at least in my case...

mcardozo commented 3 years ago

I removed default-directory setting and worked for me

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!