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

install fails on Ubuntu 18.04 #49

Open
stevebus opened this issue Nov 1, 2018 · 9 comments
Open

install fails on Ubuntu 18.04 #49

stevebus opened this issue Nov 1, 2018 · 9 comments

Comments

@stevebus
Copy link

stevebus commented Nov 1, 2018

Hi,

Both myself and my customer have tried to install iotz on Ubuntu 18.04 "fresh" VMs (him locally, and me with a default Canonical Ubuntu 18.04 VM in Azure.)

  • installed docker (18.06.1-ce)
  • added myself to the 'docker' group (so I didn't have to do 'sudo' in front of docker commands).
  • ran 'sudo npm I iotz -g'

Got the error below... Both myself and my customer have the same experience...

should this work?

stevebus@iotzUbuntu:~$ sudo npm i iotz -g
/usr/local/bin/iotz -> /usr/local/lib/node_modules/iotz/index.js

[email protected] postinstall /usr/local/lib/node_modules/iotz
iotz update

  • updating.. (this may take some time)
    Warning: failed to get default registry endpoint from daemon (Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.38/info: dial unix /var/run/docker.sock: connect: permission denied). Using system default: https://index.docker.io/v1/
    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.38/images/create?fromImage=azureiot%2Fiotz&tag=latest: dial unix /var/run/docker.sock: connect: permission denied

  • error: update has failed. See the output above.
    npm ERR! Linux 4.15.0-1025-azure
    npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "i" "iotz" "-g"
    npm ERR! node v8.10.0
    npm ERR! npm v3.5.2
    npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: iotz update
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'iotz update'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the iotz package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! iotz update
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs iotz
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls iotz
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/stevebus/npm-debug.log

@obastemur
Copy link
Owner

This is a docker installation issue on ubuntu.
https://stackoverflow.com/questions/48568172/docker-sock-permission-denied

@stevebus
Copy link
Author

stevebus commented Nov 2, 2018

so the fix in that thread appears to be adding the user to the docker group (with the usermod command) and re-logging in.. We both did that. and we both rebooted the VMs (which would restart the docker daemon), as suggested. didn't help. same problem

@obastemur
Copy link
Owner

Well, that's just a start :) Because /var/run/docker.sock apparently not owned by the current user, you are not able to execute docker with current user. Hence, you need to own that file.

sudo chown $USER  /var/run/docker.sock

@stevebus
Copy link
Author

stevebus commented Nov 2, 2018

didn't help.. same error. I can run other docker commands just fine (docker ps, docker pull, docker run -it hello-world, etc). is there something special this install is trying to do that I can try manually to work it out?

@obastemur
Copy link
Owner

Looks like the issue is due to sudo npm .... Maybe iotz auto update after installation should be manual..

@stevebus
Copy link
Author

stevebus commented Nov 8, 2018

do you want me to test anything to verify? or will you need to update the npm package? (sorry - somewhat of a. npm novice)

@obastemur
Copy link
Owner

This is happening due to over sudoing :)

You have probably installed docker via non root account? and installed iotz sudo npm i -g iotz via sudo? So, one is having trouble to execute other ;)

We may possibly remove docker update from npm post install but that's not an option for now.
I highly suggest you to not to use sudo for npm installations.

@stevebus
Copy link
Author

ok, I used the convenience script to install docker (https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script) which sudo's the install (I'm a non-root user)... subsequently the npm install of iotz fails regardless of whether I sudo or not.. I'll see if I can get docker installed without sudo and try again.. thanks for the info

@obastemur
Copy link
Owner

Probably npm install without sudo fails because of disk permission issues. Changing the permissions of /usr/lib/............node_modules folder fixes the issue

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

No branches or pull requests

2 participants