littlebee / git-time-machine

Atom package that allows you to travel back in commit history
MIT License
1.12k stars 36 forks source link

Uncaught Error: Unable to watch path #99

Open omijh opened 7 years ago

omijh commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.14.4 x64 Electron: 1.3.13 OS: Ubuntu 14.04.5 Thrown From: git-time-machine package 1.5.6

Stack Trace

Uncaught Error: Unable to watch path

At /usr/share/atom/resources/app.asar/node_modules/pathwatcher/lib/main.js:77

Error: Unable to watch path
    at Error (native)
    at HandleWatcher.start (/app.asar/node_modules/pathwatcher/lib/main.js:77:29)
    at /app.asar/node_modules/pathwatcher/lib/main.js:30:12)
    at /app.asar/node_modules/pathwatcher/lib/main.js:131:30)
    at Object.exports.watch (/app.asar/node_modules/pathwatcher/lib/main.js:190:12)
    at File.module.exports.File.subscribeToNativeChangeEvents (/app.asar/node_modules/pathwatcher/lib/file.js:598:109)
    at File.module.exports.File.writeSync (/app.asar/node_modules/pathwatcher/lib/file.js:384:14)
    at Object._createTempFiles (/packages/git-time-machine/node_modules/split-diff/lib/split-diff.coffee:388:21)
    at Object.updateDiff (/packages/git-time-machine/node_modules/split-diff/lib/split-diff.coffee:211:20)
    at Function.module.exports.GitRevisionView._splitDiff (/packages/git-time-machine/lib/git-revision-view.coffee:159:15)
    at /packages/git-time-machine/lib/git-revision-view.coffee:115:8
    at /packages/git-time-machine/node_modules/underscore/underscore.js:666:47

Commands

     -8:50.1.0 package-generator:generate-package (input.hidden-input)
  2x -8:44.7.0 fuzzy-finder:toggle-file-finder (input.hidden-input)
     -7:59.4.0 core:confirm (input.hidden-input)
  7x -7:49.1.0 core:backspace (input.hidden-input)
     -7:47.4.0 core:confirm (input.hidden-input)
     -7:44.6.0 core:backspace (input.hidden-input)
     -7:43 core:confirm (input.hidden-input)
  4x -7:41.7.0 core:backspace (input.hidden-input)
     -7:40.5.0 core:confirm (input.hidden-input)
     -7:20 core:backspace (input.hidden-input)
     -7:06.0 core:confirm (input.hidden-input)
     -2:44.8.0 git-time-machine:toggle (input.hidden-input)
     -2:27.7.0 editor:consolidate-selections (input.hidden-input)
     -2:27.7.0 core:cancel (input.hidden-input)
  4x -2:25.8.0 git-time-machine:toggle (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)

Non-Core Packages

git-time-machine 1.5.6 
monokai 0.22.0 
littlebee commented 7 years ago

see also, https://github.com/atom/atom/issues/5121

In this case it's happening when split-diff is trying to create the first of two temp files.

  _createTempFiles: (editors) ->
    editor1Path = ''
    editor2Path = ''
    tempFolderPath = atom.getConfigDirPath() + '/split-diff'

    editor1Path = tempFolderPath + '/split-diff 1'
    editor1TempFile = new File(editor1Path)
    editor1TempFile.writeSync(editors.editor1.getText())

    editor2Path = tempFolderPath + '/split-diff 2'
    editor2TempFile = new File(editor2Path)
    editor2TempFile.writeSync(editors.editor2.getText())

Can you check your atom.getConfigDirPath() for permissions that may be preventing atoms built-in "File" class from setting up a watcher?

The only way I know to see where getConfigDirPath() is, is to run the command atom.getConfigDirPath() in the debugger console. On OSX for me it returns, "/Users/bwilkerson/.atom"