Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Finder isn't finding anything #12

Open
Aragur opened this issue Jan 8, 2017 · 60 comments
Open

File Finder isn't finding anything #12

Aragur opened this issue Jan 8, 2017 · 60 comments

Comments

@Aragur
Copy link

Aragur commented Jan 8, 2017

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)

@bayleedev
Copy link
Member

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.

@Aragur
Copy link
Author

Aragur commented Jan 8, 2017

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

@bayleedev
Copy link
Member

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?

@cecoates
Copy link
Contributor

cecoates commented Jan 8, 2017

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
Copy link
Contributor

cecoates commented Jan 9, 2017

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

@ghost
Copy link

ghost commented Jan 9, 2017

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?

@JeroenBoersma
Copy link
Contributor

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

@cecoates
Copy link
Contributor

cecoates commented Jan 11, 2017

@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
Copy link
Contributor

cecoates commented Jan 11, 2017

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

@JeroenBoersma
Copy link
Contributor

@cecoates #12 (comment)

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)

@Aragur
Copy link
Author

Aragur commented Jan 17, 2017

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

@incredibleweirdo
Copy link

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

@xjrcode
Copy link

xjrcode commented Feb 5, 2017

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"
          ]
        }
      }
    }

@twang2218
Copy link
Member

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.

@xjrcode
Copy link

xjrcode commented Feb 5, 2017

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

@bayleedev
Copy link
Member

@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!

@evowizz
Copy link

evowizz commented Feb 16, 2017

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

@setegonz
Copy link

setegonz commented Feb 16, 2017

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.

@scheduardo
Copy link

The same thing here... Only apps!

Windows 10
Default plugin installation.

@twang2218
Copy link
Member

@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.

@scheduardo
Copy link

Sure @twang2218 .

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

@twang2218
Copy link
Member

@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.

@scheduardo
Copy link

@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)

@twang2218
Copy link
Member

@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 {}

@scheduardo
Copy link

scheduardo commented Feb 17, 2017

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!

@twang2218
Copy link
Member

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.

@evowizz
Copy link

evowizz commented Feb 17, 2017

@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?

@twang2218
Copy link
Member

@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.

@evowizz
Copy link

evowizz commented Feb 17, 2017

@twang2218 I tried on both user cmd and admin cmd, and all I get is... nothing :/

img

@twang2218
Copy link
Member

It's not necessary using admin cmd, and better not, because it will generate data\application.json file, and using admin cmd might cause the file permission changed to admin only, which will cause problem for later running zazu. If you already run as admin, please delete data\application.json file in the admin cmd if it's generated, and run it again as current user to generate the file with correct permission.

If it's not returning, then it's running, that's good sign, it is scanning the disk to collect the apps information, that will take some times, usually several minutes. If it's returned without any problem, then you should have data\applications.json already.

@evowizz
Copy link

evowizz commented Feb 17, 2017

@twang2218 Nope, it's still unfinished, and I still don't have data\application.json :/

@twang2218
Copy link
Member

🤔 That's wired, just give it some time to see whether it's extremly slow or just stucked, and make sure the command run as current user. I will work on error logging issue, hopefully there will be more information in the output to give more clue of what's going on.

@scheduardo
Copy link

I changed some permissions and the CPU use by Zazu got crazy. I needed to close it.

And about that command: node fileFinder.js planejamento {}

I have another output:

<--- Last few GCs --->

193195 ms: Mark-sweep 1365.0 (1435.0) -> 1365.0 (1435.0) MB, 1335.4 / 1.0 ms [allocation failure] [GC in old space requested].
194544 ms: Mark-sweep 1365.0 (1435.0) -> 1365.0 (1435.0) MB, 1349.5 / 1.0 ms [allocation failure] [GC in old space requested].
195885 ms: Mark-sweep 1365.0 (1435.0) -> 1365.0 (1410.0) MB, 1340.2 / 0.9 ms [last resort gc].
197292 ms: Mark-sweep 1365.0 (1410.0) -> 1365.0 (1410.0) MB, 1406.3 / 1.0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 000001FF353CFB61
2: normalize [path.js:~310] [pc=000001C82BBD7562] (this=0000002AE64E7901 <an Object with map 000001E5E4112D21>,path=000002577530BE21 <String[195]: C:\Users\eduar\AppData\Local\Dados de Aplicativos\Dados de Aplicativos\Dados de Aplicativos\Dados de Aplicativos\Packages\Microsoft.SkypeApp_kzf8qxf38zg5c\AC\INetCache\BHTU4MS7\public34S923Y4.jpg>)
3: join [path.js:~460] [pc=000001C82BBCDD4...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

@scheduardo
Copy link

It's impossible to use it.
screen recording 2017-02-17 at 04 59 38 pm

@evowizz
Copy link

evowizz commented Feb 17, 2017

@twang2218 So, after a long time:

<--- Last few GCs --->

[6008:000002A9D0CB4A80]  1497807 ms: Mark-sweep 1429.2 (1505.0) -> 1429.2 (1505.0) MB, 2791.7 / 2.2 ms  allocation failure GC in old space requested
[6008:000002A9D0CB4A80]  1500286 ms: Mark-sweep 1429.2 (1505.0) -> 1429.2 (1474.0) MB, 2431.4 / 2.2 ms  last resort gc
[6008:000002A9D0CB4A80]  1502976 ms: Mark-sweep 1429.2 (1474.0) -> 1429.2 (1474.0) MB, 2688.4 / 2.3 ms  last resort gc


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 000000AE8A6C0D59 <JS Object>
    1: exec [native regexp.js:~113] [pc=000003AE593C8EE1](this=00000169FB50CF71 <JS RegExp>,C=000003B6CBC32FE9 <String[139]: C:\Users\XXX\Desktop\LocationOfAPrivateFile>)
    2: 000000AE8A676529 <Symbol: Symbol.match>(aka [Symbol.match]) [native regexp.js:~416] [pc=000003AE593CFF90](this=00000169FB...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

@scheduardo
Copy link

Hey @twang2218 ... news?

I'm still using zazu without file finder... No conditions!

@thande
Copy link

thande commented Feb 23, 2017

So I was having similar issues, OS X 10.11.6, installed zazu via brew

$ node appCache.js '{}'
module.js:440
throw err;
^

Error: Cannot find module 'uuid'
at Function.Module._resolveFilename (module.js:438:15)
at Function.Module._load (module.js:386:25)
at Module.require (module.js:466:17)
at require (internal/module.js:20:19)
at Object. (/Users/sdelight/.zazu/plugins/tinytacoteam/zazu-file-finder/node_modules/iconutil/index.js:2:12)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)

I installed a few modules via npm in the file-plugin directory and it looks like i's working now but I'd be interested in a better way of solving it to ensure the plugins install the necessary required NPM modules

@danielbayerlein
Copy link

Same here with macOS 10.12.3. node appCache.js '{}' returns nothing.

@danielbayerlein
Copy link

Any idea what I can try? 😕

@bayleedev
Copy link
Member

@danielbayerlein The mdfind (for macOS) adapter was merged in last week, I bet updating your plugins would fix the issue.

@danielbayerlein
Copy link

@blainesch The plugins are up-to-date 😟 I also removed the .~/zazu folder.

@chrishelgert
Copy link

i have the same problem 😞

@danielbayerlein
Copy link

Log:

{"error":{"errno":-2,"code":"ENOENT","syscall":"open","path":"/Users/danbay/.zazu/plugins/tinytacoteam/zazu-file-finder/data/applications.json"},"plugin":"tinytacoteam/zazu-file-finder","block":"AppCache","level":"error","message":"Script failed","timestamp":"2017-03-07T10:25:07.746Z"}

@danielbayerlein
Copy link

@blainesch Any idea what I can try?

  • OS: macOS v10.12.4
  • Zazu: v0.5.2
  • Plugins: Up-to-date
  • node appCache.js '{}' returns nothing
  • .zazurc.json
    {
      "hotkey": "alt+space",
      "theme": "danielbayerlein/zazu-simple-theme",
      "displayOn": "detect",
      "disableAnalytics": true,
      "plugins": [
        "tinytacoteam/zazu-calculator",
        "tinytacoteam/zazu-file-finder",
        "tinytacoteam/zazu-system",
        "tinytacoteam/zazu-package-manager",
        "danielbayerlein/zazu-github",
        "danielbayerlein/zazu-npms",
        "danielbayerlein/zazu-rubygems",
        "danielbayerlein/zazu-homebrew",
        "danielbayerlein/zazu-devdocs",
        "danielbayerlein/zazu-uptime",
        "halvves/zazu-colors",
        {
          "name": "tinytacoteam/zazu-fallback",
          "variables": {
            "rootSearches": [
              "google"
            ]
          }
        }
      ]
    }

@bayleedev
Copy link
Member

node appCache.js '{}' shouldn't return anything anymore. Are you saying you can't find apps or files on mac? It's using mdfind now, which should be very consistent on mac's... can you try running mdfind kind:app OR kind:pref ?

@danielbayerlein
Copy link

@blainesch The commands find and open works very well. But I can not find any application. mdfind kind:app OR kind:pref returns nothing.

@bayleedev
Copy link
Member

@danielbayerlein I'm unsure how to debug mdfind, from what I can tell it's only configurable from the command line interface. Maybe I'm missing something?

@chrishelgert
Copy link

@blainesch
if i understand https://stackoverflow.com/questions/30271328/how-do-i-get-mdfind-to-include-folder-matches-in-addition-to-files right, there are two distinct languages.

@danielbayerlein and me have a german osx maybe there is the problem

-->
mdfind 'kind:folder' - no results 😢
mdfind 'kMDItemContentType:public.folder' - a lot of folders

@bayleedev
Copy link
Member

Oh! Languages! We should switch kind:folder to use those Content types you mentioned. Do you happen to know how to find apps and preference panes with the ContentType instead of kind?

https://github.com/tinytacoteam/zazu-file-finder/blob/master/adapters/osx-mdfind/index.js#L139-L162

@bayleedev
Copy link
Member

@chrishelgert I just pushed a branch. This branch works locally but can you test to see if it works for you too?

https://github.com/tinytacoteam/zazu-file-finder/tree/feature/i18n

@bayleedev
Copy link
Member

Also @danielbayerlein

@danielbayerlein
Copy link

@blainesch It works! /cc @chrishelgert

@bayleedev
Copy link
Member

Nice! I'll make a pr [:

@danielbayerlein
Copy link

PR #35 solves this issue. 👍

@Koolstr
Copy link

Koolstr commented May 26, 2017

I am having this issue, even after the PR. Any recommendations on what to try, to get it to work?

@danielbayerlein
Copy link

@Koolstr Are you up-to-date? Which OS and which language do you use?

@Koolstr
Copy link

Koolstr commented May 26, 2017

@danielbayerlein Yes, I'm running the latest version, of both Zazu, this plugin, and Windows 10. I'm not sure what you're referring to by language, but if I understand correctly, then English lol.

@Aima09
Copy link

Aima09 commented Oct 25, 2019

Same noting with file finder plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests