zazu-file-finder icon indicating copy to clipboard operation
zazu-file-finder copied to clipboard

File Finder isn't finding anything

Open Aragur opened this issue 8 years ago • 60 comments

Hello, I have a problem with the file finder. It's enabled in the config (using default config) but it isn't finding anything I search for. I'm on Windows 10. Am I missing a configuration here? (Plugin Debugger isn't logging anything higher than info-level)

Aragur avatar Jan 08 '17 16:01 Aragur

What terms are you searching for? For instance if you are searching for an application "Chrome" it won't return results until the index has been created. If you are looking for a file such as "find resume.docx" it'll be on the fly and should search common folders recursively.

bayleedev avatar Jan 08 '17 20:01 bayleedev

Both aren't working. How can I see if indexing is done?

Aragur avatar Jan 08 '17 20:01 Aragur

The json file it creates will exist in: ~/.zazu/plugins/tinytacoteam/zazu-file-finder/data/applications.json

For find resume.docx can you give me an example of a file you are trying to find and where it's located?

bayleedev avatar Jan 08 '17 21:01 bayleedev

In my case on Linux one of the issues was permissions in my applications folder. The files weren't owned by my user account or group, so Zazu didn't index them.

Not sure that applies to Windows 10 as well. Something to check?

Sidenote: through trial and error I figured out that until I set the permission for "others" to none, Zazu wouldn't index the files. Even if you're the owner and group, if permission for others is enabled, even as read only, it doesn't work for some reason. Now it's working perfectly for me.

Before changing file and folder permissions:

http://cld.wthms.co/1hMqC

After changing file and folder permissions:

http://cld.wthms.co/ymnf

The ~/.zazu/plugins/tinytacoteam/zazu-file-finder/data/applications.json seems to be the index for applications, is there also one for the files? Just curious.

cecoates avatar Jan 08 '17 21:01 cecoates

For kicks I booted into Windows and gave Zazu a try.

Initially, I wasn't able to see any programs. However, once I took ownership of the Program Files and Program Files (x86) directories, I was able to start them just fine.

Windows isn't my primary OS, so I wasn't worried about borking it, but YMMV.

I wasn't able to edit the security settings by right-clicking on the folder and trying to edit the permissions. So I went by the advice here instead:

https://superuser.com/questions/418381/windows-7-change-folder-permissions-when-options-are-greyed-out

Explanation: https://technet.microsoft.com/en-us/library/cc753024(v=ws.11).aspx

Start a command prompt as administrator

Enter the following two commands:

takeown -f "c:\Program Files" /r /d y

and then:

takeown -f "c:\Program Files (x86)" /r /d y

That will take ownership recursively of both directories. Depending on how many files there are, it could take awhile.

I forgot to record a before video, but this is after taking ownership:

http://cld.wthms.co/m3td

cecoates avatar Jan 09 '17 08:01 cecoates

I'm experiencing the same thing on W10. When i took ownership of the program folders, this solved the indexing problems with the applications but i still can't find any files. Any tips?

ghost avatar Jan 09 '17 11:01 ghost

I think for Linux users this will fix most #13

Applications .desktop files need some work... Still not sure if it should be in this repository or stand on it's own

JeroenBoersma avatar Jan 10 '17 20:01 JeroenBoersma

@JeroenBoersma does that mean I could theoretically just install everything, including my Steam folder, to ~/bin and Zazu will pick up the executables?

And/or add /usr/local/bin to my directories.js?

cecoates avatar Jan 11 '17 00:01 cecoates

I wanted to test out the permissions on the file/open search in Windows 10.

I created three folders named Test. One in my home directory, one in C:\Test, and one in D:\Test. I took ownership of all three.

Then I added C:\Test and D:\Test to my directories.js manually.

I put a file named Bills.xlsx in all three Test directories. Then I reloaded the plugins and relaunched Zazu.

Expected Behavior

Launch Zazu. Type open/find bills. List of results come up that include the bills.xlsx. Type open/find test. List of results come up that include the Test directories.

Actual Behavior

Launch Zazu. Type open/find bills. No results. Type open/find test. No results.

Steps to reproduce the behavior

Launch Zazu. Type open/find bills or open/find test. Make a cup of tea just in case. No results, but tea is delicious.

Versions

cecoates avatar Jan 11 '17 01:01 cecoates

@cecoates https://github.com/tinytacoteam/zazu-file-finder/issues/12#issuecomment-271741862

Everything in your ~/bin would be indexed if it has the correct permissions. I think /usr/games and /usr/local/games should be added too by default.

For those .desktop file on Linux.. I think it needs some extra work, ideas are already in my head(I think I can fix this, but it'll take a couple of days)

JeroenBoersma avatar Jan 11 '17 07:01 JeroenBoersma

Sorry for the delay on this topic. I looked at: ~/.zazu/plugins/tinytacoteam/zazu-file-finder/data/ and the direcotry is completly empty (only a .gitkeep file inside).

Zazu: 3.2 OS: Windows 10 Insider Preview 15002 64 bit GIT: 2.11

Aragur avatar Jan 17 '17 19:01 Aragur

I want to add that I am seeing similar issue on Windows 7. Zazu does appear to have indexed my applications, and there is an applications.json file in ~/.zazu/plugins/tinytacoteam/zazu-file-finder/data. However, searching for files/documents does not return results.

Zazu version: 3.2 Windows 7 Enterprise 64 bit Git 2.10.1.windows.1

incredibleweirdo avatar Jan 18 '17 18:01 incredibleweirdo

Same error on Mac 10.11.6 (Capitan). Zazu doesn't find anything. The data folder is empty (only .gitkeep). I've changed the folder permissions to 777 but no file is created.

My config file looks like this:

{
      "name": "tinytacoteam/zazu-file-finder",
      "variables": {
        "append": false,
        "directories": {
          "appPath": [
            "/Applications"
          ]
        }
      }
    }

xjrcode avatar Feb 05 '17 11:02 xjrcode

Missing data\application.js might because an error happened in the appCache.js execution.

So, if you found data folder is empty(except .gitkeep), could you try run the following command under ~/.zazu/plugins/tinytacoteam/zazu-file-finder/ directory:

node appCache.js '{}'

And paste the result here please.

twang2218 avatar Feb 05 '17 13:02 twang2218

Here is the error:

./appCache.js:8
  const { cwd } = pluginContext
        ^
SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

xjrcode avatar Feb 05 '17 17:02 xjrcode

@x4vl that is caused by running it with the wrong node version, try switching to v6.5.0. This is easier with nvm, if you don't already have it. Thanks for helping debug this!

bayleedev avatar Feb 05 '17 20:02 bayleedev

Hi, uhm, the plugin isn't finding anything for me too :/ I'm on Windows 10.

evowizz avatar Feb 16 '17 16:02 evowizz

Mac 10.12.3 Sierra. I can search apps but I'm not able to search documents/file/etc. Maybe It will be good to recommend a "basic" mac installation. Thanks for the awesome product.

setegonz avatar Feb 16 '17 19:02 setegonz

The same thing here... Only apps!

Windows 10 Default plugin installation.

scheduardo avatar Feb 16 '17 19:02 scheduardo

@EvoWizz Could you check the comments above and give more information? is there a data\application.json, and if not, what's the node appCache.js '{}' output?

@setegonz @scheduardo If you can search app, but not documents/files, maybe it's another issue, could you provide the Zazu log under .zazu\log\, thanks.

twang2218 avatar Feb 17 '17 03:02 twang2218

Sure @twang2218 .

See attached. zazu.log.2017-02-17.zip

scheduardo avatar Feb 17 '17 10:02 scheduardo

@scheduardo Thank you, there isn't any errors in the log indicating why fileFinder is not working, which is a problem, I will try to fix error logging problem first.

In the meantime, could you try node fileFinder.js 'planejamento' '{}' under .zazu\plugins\tinytacoteam\zazu-file-finder\ directory and paste the output here? I think there might be some errors during the execution of this script.

twang2218 avatar Feb 17 '17 14:02 twang2218

@twang2218

undefined:1 '{}' ^

SyntaxError: Unexpected token ' in JSON at position 0 at Object.parse (native) at __dirname (C:\Users\eduar.zazu\plugins\tinytacoteam\zazu-file-finder\fileFinder.js:45:52) at Object. (C:\Users\eduar.zazu\plugins\tinytacoteam\zazu-file-finder\fileFinder.js:55:3) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:394:7)

scheduardo avatar Feb 17 '17 16:02 scheduardo

@scheduardo Oops, does Windows not support quote in command line? sorry about that, I'm not using Windows anymore ;)

Could you try the command without the quote?

node fileFinder.js planejamento {}

twang2218 avatar Feb 17 '17 16:02 twang2218

No problem 😆

(node:12824) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: EPERM: operation not permitted, scandir 'C:\Users\eduar\Ambiente de Impressão'

PS: "Ambiente de Impressão" is "Printing Environment" in portuguese!

scheduardo avatar Feb 17 '17 16:02 scheduardo

The error means listing folder contents of C:\Users\eduar\Ambiente de Impressão is not permitted.

There are 2 possible reasons, one is that there is a Anti-Virus software blocking the way, another reason is that it is missing the listing permission.

For the AV software, maybe you can turn it off and try again.

For the missing permission problem, you can right click C:\Users\eduar\Ambiente de Impressão folder, (or C:\Users\eduar folder), then click Properties, then Security tab, then click the current user (or the group), and check the permissions below, if it is missing the List folder contents, then check it and apply. Then try again.

twang2218 avatar Feb 17 '17 16:02 twang2218

@twang2218 Hi, I don't have the application.json file, and running the command node appCache.js '{}' doesn't work, the cmd tell that the command isn't recognized [...] Any idea to make the command working?

evowizz avatar Feb 17 '17 17:02 evowizz

@EvoWizz Could you paste the output here? so I can see what exactly the error is. And could you check your node version by node --version? You might have an outdated node version, I think node version should be 6+ to support ... expansion.

twang2218 avatar Feb 17 '17 17:02 twang2218

@twang2218 I've updated node and it's working now, thanks :) So here is the output of the command node appCache.js '{}':

undefined:1
'{}'
^

SyntaxError: Unexpected token ' in JSON at position 0
    at JSON.parse (<anonymous>)
    at __dirname (C:\Users\XXX\.zazu\plugins\tinytacoteam\zazu-file-finder\appCache.js:50:52)
    at Object.<anonymous> (C:\Users\XXX\.zazu\plugins\tinytacoteam\zazu-file-finder\appCache.js:59:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)

evowizz avatar Feb 17 '17 17:02 evowizz

@EvoWizz Windows seems not support quoting, so please run the command without quoting, node appCache.js {}.

twang2218 avatar Feb 17 '17 18:02 twang2218