liftoff / GateOne

Gate One is an HTML5-powered terminal emulator and SSH client
http://liftoffsoftware.com/Products/GateOne
Other
6.28k stars 924 forks source link

QuickStart? #52

Closed may closed 12 years ago

may commented 12 years ago

Is there a quickstart somewhere?

I have installed, but I have no idea what the minimum command is to get things started; my install errors out -- unable to find /var/log/gateone/webserver.log.

liftoff commented 12 years ago

This should not happen... The code is setup to auto-create /var/log/gateone and webserver.log should be auto-created when you start gateone.py the first time.

What version of Python is this? Also, can you paste the entire output of the error so I can see where it happened?

liftoff commented 12 years ago

I just realized: If you're not running Gate One as root it won't be able to create /var/log/gateone/. Were you running as root?

Note to self: I should add a more user-friendly error for such situations.

liftoff commented 12 years ago

LOL! I just looked at the code and I do have a really nice, user-friendly error for this:

logging.error(_("\x1b[1;31mERROR:\x1b[0m Could not create %s for "
    "log_file_prefix: %s" % (log_dir, options.log_file_prefix)))
logging.error(_("You probably want to change this option, run Gate "
    "One as root, or create that directory and give the proper "
    "user ownership of it."))

Is that the error message you got? If so, it clearly states that you must be root if you want your log_file_prefix to point to /var/log/gateone/webserver.log.

may commented 12 years ago

I believe I was running as root; I will check tonight. On Oct 28, 2011 8:27 AM, "Dan McDougall" < reply@reply.github.com> wrote:

LOL! I just looked at the code and I do have a really nice, user-friendly error for this:

logging.error(_("\x1b[1;31mERROR:\x1b[0m Could not create %s for " "log_file_prefix: %s" % (log_dir, options.log_fileprefix))) logging.error(("You probably want to change this option, run Gate " "One as root, or create that directory and give the proper " "user ownership of it."))

Is that the error message you got? If so, it clearly states that you must be root if you want your log_file_prefix to point to /var/log/gateone/webserver.log.

Reply to this email directly or view it on GitHub: https://github.com/liftoff/GateOne/issues/52#issuecomment-2555983

may commented 12 years ago

$ sudo /opt/gateone/gateone.py Traceback (most recent call last): File "/opt/gateone/gateone.py", line 1598, in main() File "/opt/gateone/gateone.py", line 1507, in main tornado.options.parse_command_line() File "/usr/local/lib/python2.6/dist-packages/tornado/options.py", line 147, in parse_command_line enable_pretty_logging() File "/usr/local/lib/python2.6/dist-packages/tornado/options.py", line 331, in enable_pretty_logging backupCount=options.log_file_num_backups) File "/usr/lib/python2.6/logging/handlers.py", line 112, in init BaseRotatingHandler.init(self, filename, mode, encoding, delay) File "/usr/lib/python2.6/logging/handlers.py", line 64, in init logging.FileHandler.init(self, filename, mode, encoding, delay) File "/usr/lib/python2.6/logging/init.py", line 827, in init StreamHandler.init(self, self._open()) File "/usr/lib/python2.6/logging/init.py", line 846, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 2] No such file or directory: '/var/log/gateone/webserver.log'

And: $ python --version Python 2.6.6

(Debian 6).

Thanks!

victorhooi commented 12 years ago

Hi,

I can report I get the same issue, also running as root:

Traceback (most recent call last):
  File "./gateone.py", line 1807, in <module>
    main()
  File "./gateone.py", line 1693, in main
    tornado.options.parse_command_line()
  File "/usr/local/lib/python2.7/dist-packages/tornado/options.py", line 147, in parse_command_line
    enable_pretty_logging()
  File "/usr/local/lib/python2.7/dist-packages/tornado/options.py", line 331, in enable_pretty_logging
    backupCount=options.log_file_num_backups)
  File "/usr/lib/python2.7/logging/handlers.py", line 118, in **init**
    BaseRotatingHandler.**init**(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/handlers.py", line 65, in **init**
    logging.FileHandler.**init**(self, filename, mode, encoding, delay)
  File "/usr/lib/python2.7/logging/**init**.py", line 893, in **init**
    StreamHandler.**init**(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 912, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '/var/log/gateone/webserver.log'

However, if I create the /var/log/gateone directory, it works fine (well, I hit other issues with Read errors and SSL errors, but that's a separate thing) - so maybe the code just needs to be tweaked to create the directory if it doesn't exist?

Cheers, Victor

liftoff commented 12 years ago

Well, the code that's causing this issue is in the Tornado framework itself. I'll see if I can work around it by auto-creating the directory on behalf of the user.

may commented 12 years ago

Thanks Dan, I'd love to give this a try.

liftoff commented 12 years ago

In the latest code Gate One stores the webserver.log inside its own directory. This should avoid the "must run as root" problem. Also, I recently added lots of error messages that clearly indicate when something is wrong with Gate One's ability to write to files. Whether it be logs, session info, or other user stuff.

With that said, I'm going to close out this issue.