I noticed my server had lots of zombie-processes where the parent was the container running magicmirror in serveronly-mode. By enabling only one module at a time I managed to locate the problematic module which is the updatenotification.
The cause of this seems to be partly my fault due to cloning my own modules with ssh instead of https (using url = [email protected]:xxx/xxx.git) and I guess this fails in the container since it doesn't have access to my username/password/ssh-keys.
But it's probably also something missing in the code that doesn't close the connection after the update-check, since I've seen a few git-http zombies too.
Would also be great to have a blacklist for modules not to update-check or at least a flag to only update check for the main project.
I agree. Feel free to send a PR. I'll leave this open so one of us can investigate this later.
Should it be in the configuration for the updatenotification-module or as part of each module?
{
module: "updatenotification",
config: {
moduleBlacklist: ["clock"] //empty array is default
}
}
vs
{
module: "clock",
updateCheck: false //default is true
}
I prefer the first one. Thanks!
And maybe call it ignoreModules: []?
Made a PR for the ignoreModule functionality, guess I should make a PR for the documentation in the other repo now that its separate?.
This is the line that creates the zombie processes, the callback function is never called at all (I guess a timeout needs to be specified in some way, but can't really find it):
https://github.com/MichMich/MagicMirror/blob/d7295948fdb322c3bb267c08fb634719aa3f9fa5/modules/default/updatenotification/node_helper.js#L70
Found 2 other smaller problems when trying to debug this:
refreshInterval configuration isn't in the documentationHave done a bit more research about this.
As stated above the fetch()-method is never completed with error nor success.
It seems to be stuck waiting for keyboard-input from the user for this:
The authenticity of host '<host> (<ip>)' can't be established.
RSA key fingerprint is <fingerprint>.
Are you sure you want to continue connecting (yes/no)?
And when its run the next time it creates another process with the same issue. I tried to accept the host manually and then it goes to the error-handler for fetch() since it can't fetch it without my ssh-keys.
Adding this seems to make it not hang even without accepting the host:
sg.git.env("GIT_SSH_COMMAND", "ssh -o BatchMode=yes");
Not really sure if that is a proper solution or if remotes that isn't http/https just should not be checked.
remotes that isn't http/https just should not be checked.
I would prefer this solution.
My setup seems similar to yours (docker container, module with git@... as remote) but I have no such zombie-processes, but errors in the container logs (which is o.k. for me):
````
[2020-06-05 23:00:16.174] [LOG] Starting node helper for: mmm-remote-docker
[2020-06-05 23:00:16.175] [LOG] Connecting socket for: newsfeed
[2020-06-05 23:00:16.175] [LOG] Starting module: newsfeed
[2020-06-05 23:00:16.176] [LOG] Sockets connected & modules started ...
[2020-06-05 23:00:16.176] [LOG]
Ready to go! Please point your browser to: http://0.0.0.0:8080
[2020-06-05 23:00:16.823] [ERROR] Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
````
this problem is still present. I've never cloned a module using ssh - only http.
Same setup with docker server-only...
I noticed today, that the zombie processes occurr when the magicmirror has no internet
Maybe we should check to see if internet is working correctly before we fetch the repos? A PR on this is welcome!
Seems more like a workaround than a fix, what if the call for internet connectivity works but the update check call fails?
Proper timeout-handling and closing the process after the call is done is probably the correct way. Which I can't find in the documentation for simple-git, but there must be some way to do it?
Maybe update the simple-git dependency, there has been many new releases since the one specified in package.json?
A while back I reviewed all of the changes from the current version that MM uses and the current simple-git version and I didn't see any breaking changes. I also pulled in the latest on my local (2.20.1) and didn't see any issues.
Most helpful comment
Seems more like a workaround than a fix, what if the call for internet connectivity works but the update check call fails?
Proper timeout-handling and closing the process after the call is done is probably the correct way. Which I can't find in the documentation for simple-git, but there must be some way to do it?
Maybe update the simple-git dependency, there has been many new releases since the one specified in package.json?