[DAEMON-233] appcd-fswatcher: EACESS error when starting appcd-plugin-android
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Resolved |
| Resolution | Fixed |
| Resolution Date | 2018-03-09T22:34:06.000+0000 |
| Affected Version/s | Appc Daemon 1.1.0 |
| Fix Version/s | Appc Daemon 1.1.0 |
| Components | appcd-fswatcher |
| Labels | n/a |
| Reporter | Ewan Harris |
| Assignee | Chris Barber |
| Created | 2018-02-12T21:30:27.000+0000 |
| Updated | 2018-03-09T22:34:06.000+0000 |
Description
Description
When callingappcd exec /android/latest/info on master of appc-daemon, the plugin fails to start with, Failed to activate plugin (code 6), I've tracked this back through the rabbit hole and there seems to be a few things that are at play here.
I trimmed the plugin down to only do NDK detection to hopefully make the logs a little easier to read (although I had to bump the buffer to 2.5k from 1k)
* Walking through the changes in appcd-detect seem to show [this commit](https://github.com/appcelerator/appc-daemon/commit/829d533762fbd03e52b0e9da88276992b5da6a30#diff-1174f97bf7dc72538ff82fe34bbc5c65) as being the commit that made this start failing
* androidlib lists [/opt](https://github.com/appcelerator/androidlib/blob/82cfefac30aa5bb92fc5b7865a1ccbcf27c4eacd/src/ndk.js#L17) as a place to scan for the NDKs, this doesn't seem to exist on my system so when we do a real on this path [https://github.com/appcelerator/appc-daemon/blob/93841cf2c52a82151f061a1f1ea38317efbb8ecf/packages/appcd-detect/src/detect-engine.js#L228] it becomes /
* From the logs in the attached appcd dump it then seems that the detect engine then starts to watch all subdirectories of / (timestamp is around 2018-02-12T17:13:39.535Z)
* Some of the directories underneath the root throw an EACCESS on fs.watch, I've logged this in the logs around timestamp 2018-02-12T17:13:39.554Z, which cause the plugin to start
I believe we should be handling EACCESS errors in the fswatcher
Attachments
| File | Date | Size |
|---|---|---|
| appcd-dump.json | 2018-02-12T21:26:48.000+0000 | 2129097 |
PR: https://github.com/appcelerator/appc-daemon/pull/289
[~cbarber] This PR deals with the access permissions I was seeing but https://github.com/appcelerator/appc-daemon/commit/829d533762fbd03e52b0e9da88276992b5da6a30#diff-1174f97bf7dc72538ff82fe34bbc5c65 is still causing something funky. Calling the android info endpoint takes a while and watches a ton of stuff, see the below output of appcd exec /appcd/status/fs after calling android info.
{ "nodes": 51, "fswatchers": 47, "watchers": 27 }On OSX calling appcd exec /android/latest/info takes around 44 seconds for me on 1.1.0, vs 2 seconds on 1.0.1{ "fswatchers": 3607, "nodes": 5491, "watchers": 290To test, run
gulp coveragefrom thepackages/appcd-fswatcherdirectory on all platforms. Then on Linux and macOS, runsudo gulp coverage.