[GH-ISSUE #159] how can i install log.io in docker? #130

Closed
opened 2026-02-26 05:31:24 +03:00 by kerem · 13 comments
Owner

Originally created by @dayuoba on GitHub (Jul 31, 2015).
Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/159

in docker container i have the root right,but when i run npm i log.io -g . it fails

Creating ~/.log.io/ for configuration files.
If this fails, run npm using a specific user: npm install -g log.io --user 'ubuntu'
fs.js:747
  return binding.mkdir(pathModule._makeLong(path),
                 ^
Error: EACCES, permission denied '/root/.log.io/'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:747:18)
    at Object.action (/usr/local/lib/node_modules/log.io/Cakefile:79:10)
    at helpers.extend.invoke (/usr/local/lib/node_modules/log.io/node_modules/coffee-script/lib/coffee-script/cake.js:44:26)
    at Object.exports.run (/usr/local/lib/node_modules/log.io/node_modules/coffee-script/lib/coffee-script/cake.js:69:21)
    at Object.<anonymous> (/usr/local/lib/node_modules/log.io/node_modules/coffee-script/bin/cake:7:38)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
npm ERR! Linux 4.0.5-boot2docker
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "log.io" "--user" "ubuntu"
npm ERR! node v0.12.2
npm ERR! npm  v2.9.1
npm ERR! code ELIFECYCLE

npm ERR! log.io@0.3.4 postinstall: `cake ensure:configuration`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the log.io@0.3.4 postinstall script 'cake ensure:configuration'.
npm ERR! This is most likely a problem with the log.io package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cake ensure:configuration
npm ERR! You can get their info via:
npm ERR!     npm owner ls log.io
npm ERR! There is likely additional logging output above.

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

npm install -g log.io --user "ubuntu" , i've tried this command either

Originally created by @dayuoba on GitHub (Jul 31, 2015). Original GitHub issue: https://github.com/NarrativeScience-old/log.io/issues/159 in docker container i have the root right,but when i run npm i log.io -g . it fails ``` Creating ~/.log.io/ for configuration files. If this fails, run npm using a specific user: npm install -g log.io --user 'ubuntu' fs.js:747 return binding.mkdir(pathModule._makeLong(path), ^ Error: EACCES, permission denied '/root/.log.io/' at Error (native) at Object.fs.mkdirSync (fs.js:747:18) at Object.action (/usr/local/lib/node_modules/log.io/Cakefile:79:10) at helpers.extend.invoke (/usr/local/lib/node_modules/log.io/node_modules/coffee-script/lib/coffee-script/cake.js:44:26) at Object.exports.run (/usr/local/lib/node_modules/log.io/node_modules/coffee-script/lib/coffee-script/cake.js:69:21) at Object.<anonymous> (/usr/local/lib/node_modules/log.io/node_modules/coffee-script/bin/cake:7:38) at Module._compile (module.js:460:26) at Object.Module._extensions..js (module.js:478:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) npm ERR! Linux 4.0.5-boot2docker npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "log.io" "--user" "ubuntu" npm ERR! node v0.12.2 npm ERR! npm v2.9.1 npm ERR! code ELIFECYCLE npm ERR! log.io@0.3.4 postinstall: `cake ensure:configuration` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the log.io@0.3.4 postinstall script 'cake ensure:configuration'. npm ERR! This is most likely a problem with the log.io package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! cake ensure:configuration npm ERR! You can get their info via: npm ERR! npm owner ls log.io npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /npm-debug.log ``` npm install -g log.io --user "ubuntu" , i've tried this command either
kerem closed this issue 2026-02-26 05:31:25 +03:00
Author
Owner

@dayuoba commented on GitHub (Jul 31, 2015):

run this command npm i log.io -g --user "root"

<!-- gh-comment-id:126646720 --> @dayuoba commented on GitHub (Jul 31, 2015): run this command `npm i log.io -g --user "root"`
Author
Owner

@clemtibs commented on GitHub (Aug 26, 2015):

The simple answer to your question is: npm install -g log.io --user "root"

A warning from someone who's put this thing inside a docker container already (sort of). It's very difficult to get it working reliably. I've been able to hack together an image that functions as both harvester and server, but it's really a giant shit-show and unreliable because:

  1. You need daemon management to run either both or one of harvester/servers as the same image
  2. You need a way to create the configuration ahead of time telling Log.io which files are to be tracked as logs
  3. The configuration is very fussy
  4. compiling in the container takes forever, and is wrought with errors
  5. newer versions of node break the compiling. So that plus the fact that this project is no longer maintained led me to give up on it altogether. Feel free to use my code above, but I've given up on it for some of the newer docker solutions that incorporate logging plugin backends.
<!-- gh-comment-id:134871949 --> @clemtibs commented on GitHub (Aug 26, 2015): The simple answer to your question is: `npm install -g log.io --user "root"` A warning from someone who's [put this thing inside a docker container already](https://github.com/radial/wheel-log.io) (sort of). It's very difficult to get it working reliably. I've been able to hack together an image that functions as both harvester and server, but it's really a giant shit-show and unreliable because: 1. You need daemon management to run either both or one of harvester/servers as the same image 2. You need a way to create the configuration ahead of time telling Log.io which files are to be tracked as logs 3. The configuration is very fussy 4. compiling in the container takes forever, and is wrought with errors 5. newer versions of node break the compiling. So that plus the fact that this project is no longer maintained led me to give up on it altogether. Feel free to use my code above, but I've given up on it for some of the newer docker solutions that incorporate logging plugin backends.
Author
Owner

@dayuoba commented on GitHub (Aug 28, 2015):

@brianclements yep,in our docker ENV only one port can be exposed so i gave up either.i wrote a log module of node my self. may @NarrativeScience give a official container image?

<!-- gh-comment-id:135595749 --> @dayuoba commented on GitHub (Aug 28, 2015): @brianclements yep,in our docker ENV only one port can be exposed so i gave up either.i wrote a log module of node my self. may @NarrativeScience give a official container image?
Author
Owner

@clemtibs commented on GitHub (Aug 28, 2015):

@dayuoba I wouldn't count on it. I really have nothing against @NarrativeScience, it's just that the repo has all the hallmarks of being abandoned; these things happen. The main committer for the past 4 years (@msmathers) has essentially zero activity for a very long time. I'd suggest people start forking or center around an existing fork if they really want to continue this project in a different scope.

<!-- gh-comment-id:135895706 --> @clemtibs commented on GitHub (Aug 28, 2015): @dayuoba I wouldn't count on it. I really have nothing against @NarrativeScience, it's just that the repo has all the hallmarks of being abandoned; these things happen. The main committer for the past 4 years (@msmathers) has essentially zero activity for a very long time. I'd suggest people start forking or center around an existing fork if they really want to continue this project in a different scope.
Author
Owner

@rarkins commented on GitHub (Aug 29, 2015):

@brianclements do you have any suggestions for alternatives?

<!-- gh-comment-id:136055288 --> @rarkins commented on GitHub (Aug 29, 2015): @brianclements do you have any suggestions for alternatives?
Author
Owner

@clemtibs commented on GitHub (Aug 30, 2015):

As for a quick and simple analog? I don't know unfortunately. My particular bias was for use with @docker. So that's where my suggestions and research are coming from. I haven't decided or experimented yet, but the most promising choices are going to be programs that work with the newly implemented docker logging drivers. Those particular plugins imply fluentd and the GELF format which can be used with Graylog and Logstash. Those solutions are a step up from the quick and simple solution that Log.io seemed to provide, but honestly, when properly captured in a docker container, they can be really simple to deploy. I am pretty sure Log.io was heavily used by windows users as well, and luckily Docker now has windows support. Again, I have yet to experiment with these in particular, but that is the direction I'm headed in anyway. It's a bit more setup but it's a robust and scalable solution centered around products that communities still maintain. Hope this helps!

<!-- gh-comment-id:136088670 --> @clemtibs commented on GitHub (Aug 30, 2015): As for a quick and simple analog? I don't know unfortunately. My particular bias was for use with @docker. So that's where my suggestions and research are coming from. I haven't decided or experimented yet, but the most promising choices are going to be programs that work with the newly implemented [docker logging drivers](https://docs.docker.com/reference/logging/overview/). Those particular plugins imply [fluentd](http://www.fluentd.org/) and the [GELF](https://www.graylog.org/resources/gelf-2/) format which can be used with [Graylog](https://www.graylog.org/overview/) and [Logstash](https://www.elastic.co/products/logstash). Those solutions are a step up from the quick and simple solution that Log.io seemed to provide, but honestly, when properly captured in a docker container, they can be really simple to deploy. I am pretty sure Log.io was heavily used by windows users as well, and luckily Docker [now has windows support](https://docs.docker.com/installation/windows/). Again, I have yet to experiment with these in particular, but that is the direction I'm headed in anyway. It's a bit more setup but it's a robust and scalable solution centered around products that communities still maintain. Hope this helps!
Author
Owner

@rarkins commented on GitHub (Aug 30, 2015):

Thanks. I'm actually looking for a browser based log streaming container that can function as an output from fluentd. I.e. as an alternative in dev environments to console and stdout

<!-- gh-comment-id:136097360 --> @rarkins commented on GitHub (Aug 30, 2015): Thanks. I'm actually looking for a browser based log streaming container that can function as an output from fluentd. I.e. as an alternative in dev environments to console and stdout
Author
Owner

@purezen commented on GitHub (Nov 9, 2015):

@rarkins I am looking for a similar solution. Would love to know of it in case you get one.
@brianclements even I was looking to use log.io with Docker. What is your fix right now?

<!-- gh-comment-id:154989373 --> @purezen commented on GitHub (Nov 9, 2015): @rarkins I am looking for a similar solution. Would love to know of it in case you get one. @brianclements even I was looking to use log.io with Docker. What is your fix right now?
Author
Owner

@clemtibs commented on GitHub (Nov 9, 2015):

@purezen my ventures in docker are as a hobbyist so I've not been forced to pick something as of yet and have not had time to dive into this aspect of it in a while. But with the newest version of docker, the entire world of logging has changed drastically anyway since I first started messing around with Log.io. I suggest you check out the logging docs to start your search.

I do plan to find an equally simple solution to this in time and make it easily available in my Radial project repos. It will be something that can easily plug into an official docker logging driver, run in a single container, and just receive streaming log data to a web interface. But I have no idea when I'll get around to it. Sorry I can't be much more help!

<!-- gh-comment-id:155176124 --> @clemtibs commented on GitHub (Nov 9, 2015): @purezen my ventures in docker are as a hobbyist so I've not been forced to pick something as of yet and have not had time to dive into this aspect of it in a while. But with the newest version of docker, the entire world of logging has changed drastically anyway since I first started messing around with Log.io. I suggest you check out the [logging docs](http://docs.docker.com/engine/reference/logging/overview/) to start your search. I do plan to find an equally simple solution to this in time and make it easily available in my [Radial](https://github.com/radial) project repos. It will be something that can easily plug into an official docker logging driver, run in a single container, and just receive streaming log data to a web interface. But I have no idea when I'll get around to it. Sorry I can't be much more help!
Author
Owner

@Chaturaphut commented on GitHub (Nov 18, 2015):

https://github.com/Chaturaphut/log.io-docker-centos

<!-- gh-comment-id:157857190 --> @Chaturaphut commented on GitHub (Nov 18, 2015): https://github.com/Chaturaphut/log.io-docker-centos
Author
Owner

@franciskim commented on GitHub (Jun 25, 2016):

Looks like you need to run it as root, as in use sudo

<!-- gh-comment-id:228527296 --> @franciskim commented on GitHub (Jun 25, 2016): Looks like you need to run it as root, as in use `sudo`
Author
Owner

@adamgoose commented on GitHub (Jul 18, 2016):

The following Dockerfile works for me:

FROM node:6.3

RUN npm install -g log.io --user root

CMD log.io-server
EXPOSE 28778 28777

Then, use the following command to run:

docker run -itd -p 28778:28778 -p 28777:28777 logio

I'm considering creating a Pull Request to use the node:onbuild image.

Of course, this simply runs the server. @brianclements mentioned that it's difficult to run the harvester inside the container due to the single-process mentality of Docker. However, it would make sense to me to simply run this as a server-only container, and instal the harvester in your other Docker containers (or any linux machine) to report the logs. We've achieved multi-process containers with Supervisor.

<!-- gh-comment-id:233271212 --> @adamgoose commented on GitHub (Jul 18, 2016): The following Dockerfile works for me: ``` Dockerfile FROM node:6.3 RUN npm install -g log.io --user root CMD log.io-server EXPOSE 28778 28777 ``` Then, use the following command to run: `docker run -itd -p 28778:28778 -p 28777:28777 logio` I'm considering creating a Pull Request to use the `node:onbuild` image. Of course, this simply runs the server. @brianclements mentioned that it's difficult to run the harvester inside the container due to the single-process mentality of Docker. However, it would make sense to me to simply run this as a server-only container, and instal the harvester in your other Docker containers (or any linux machine) to report the logs. We've achieved multi-process containers with [Supervisor](http://supervisord.org/).
Author
Owner

@msmathers commented on GitHub (Jan 12, 2020):

v0.4.3 uses the more idiomatic package.json bin script to invoke the server & harvester processes, and no longer requires root/sudo to install, so running it in docker should be pretty trivial.

<!-- gh-comment-id:573445723 --> @msmathers commented on GitHub (Jan 12, 2020): v0.4.3 uses the more idiomatic package.json `bin` script to invoke the server & harvester processes, and no longer requires root/sudo to install, so running it in docker should be pretty trivial.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/log.io-NarrativeScience-old#130
No description provided.