cozy / cozy-controller

Cozy Module and Apps deployer
cozy.io
GNU Affero General Public License v3.0
5 stars 13 forks source link

Controller is not updated #124

Open poupotte opened 8 years ago

poupotte commented 8 years ago

A new version of the Controller has been published today (2.0.41). @bnjbvr reports that updating the stack from the home doesn't update the controller.

Here's the only error in the controller's logs:

error - lib:controller | Error: Cannot stop process that is not running.
    at cozy-controller/node_modules/forever-monitor/lib/forever-monitor/monitor.js:357:26
    at process._tickCallback (node.js:415:13)
nono commented 8 years ago

The bug is only for people on debian that have updated npm.

The workaround is to execute this command (as root):

echo 'prefix=/usr/local' > /usr/etc/npmrc

It will be fixed in the next debian package for cozy.

clochix commented 8 years ago

@nono would you mind post something on the forum, explaining this workaround, and its downsides? Thanks!

bnjbvr commented 8 years ago

How is this workaround fixing the issue? cozy-controller is still installed on my other prefixed directory. Do I need to reinstall the cozy-controller after changing the prefix?

nono commented 8 years ago

It's easier and safer to wait the next release of the debian package (in less than 2 weeks). It will fix this issue. But if you have the issue and want to fix it now, it's possible to use the workaround from above.

The npm from the officiel debian package is npm 1, with a patch to change its prefix to /usr/local. So, packages installed as global (npm install -g) went to /usr/local/lib/node_modules. When npm2 is installed, it is not patched to use the same prefix. Its prefix is /usr and it will search global packages in /usr/lib/node_modules. As nothing were installed in this path, npm ls -g says it's empty and npm update -g will fail. The workaround is there to tell to npm2 to use the same prefix than npm1 and npm2 can then find the old packages and update them.

clochix commented 8 years ago

And what about using npm install -g cozy-controller to install it in /usr/lib/node_modules, so the next npm update -g will just work ? Also, this may also concern other globally installed packages, like cozy-monitor, or other applications the user may have installed.