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

NameError: global name 'logs' is not defined #81

Closed
deranjer opened this issue Dec 22, 2011 · 4 comments
Closed

NameError: global name 'logs' is not defined #81

deranjer opened this issue Dec 22, 2011 · 4 comments

Comments

@deranjer
Copy link

Just downloaded the latest version 3392481, installed it, and went to test it:

python gateone.py

Loaded Logging plugin
Traceback (most recent call last):
File "gateone.py", line 1977, in
main()
File "gateone.py", line 1819, in main
web_log_path = os.path.join(GATEONE_DIR, logs)
NameError: global name 'logs' is not defined

Python version 2.6.6 (also tried with 3.1, different error).

Anyone else getting this error?

@AstraLuma
Copy link

I saw this last night, too. I fixed it by making it a string literal.

@liftoff
Copy link
Owner

liftoff commented Dec 22, 2011

Yeah, I noticed this myself last night. I don't know how I missed it. It should be:

web_log_path = os.path.join(GATEONE_DIR, 'logs')

The fix for this will be in the next commit. Fortunately a very simple fix in the mean time.

@deranjer
Copy link
Author

Thanks for the quick response guys... as you can tell, I am not a programmer. I did open it up and look at it but wasn't able to figure out what was the issue :D
That fixes this issue... now when opening it in my browser (chrome) get the following error:

A communications disruption can mean only one thing...

From my log file:

[W 111222 14:39:25 gateone:1887] dtach command not found. dtach support has been disabled.
[I 111222 14:39:25 gateone:1549] No authentication method configured. All users will be %anonymous
[I 111222 14:39:25 gateone:1590] Loaded plugins: bookmarks, help, logging, logging_plugin, playback, ssh
[I 111222 14:39:25 gateone:1967] Listening on https://*:8087/
[I 111222 14:39:32 web:1359] 200 GET / (192.168.1.1) 16.91ms
[I 111222 14:39:32 web:1359] 304 GET /static/gateone.css (192.168.1.1) 0.86ms
[I 111222 14:39:32 web:1359] 304 GET /static/gateone.js (192.168.1.1) 0.68ms
[I 111222 14:39:32 web:1359] 200 GET /favicon.ico (192.168.1.1) 0.95ms
[I 111222 14:39:32 web:1359] 304 GET /style?theme=black&container=gateone&prefix=go_ (192.168.1.1) 25.23ms
[I 111222 14:39:32 web:1359] 304 GET /style?colors=default&container=gateone&prefix=go_ (192.168.1.1) 20.47ms
[I 111222 14:39:32 web:1359] 304 GET /combined_js (192.168.1.1) 2.89ms
[I 111222 14:39:32 web:1359] 200 GET /auth?check=True (192.168.1.1) 0.94ms
[I 111222 14:39:40 gateone:1971] Caught KeyboardInterrupt. Killing sessions...

@liftoff
Copy link
Owner

liftoff commented Jan 4, 2012

I just fixed this in the latest commit so I'm going to close this out.

@deranjer: This sounds like the backwards-incompatible change Chrome 16 made to its WebSockets implementation. If you haven't done so yet please install the latest dev code of Tornado from Github (https://github.com/facebook/tornado). It should fix it.

@liftoff liftoff closed this as completed Jan 4, 2012
pauldorn pushed a commit to pauldorn/GateOne that referenced this issue Sep 22, 2015
gateone.py:  Fixed the typo in the new default web server logs location.  This should resolve liftoff#81
gateone.py:  A few more changes here and there to use os.path.join() instead of assuming the separator is "/".
gateone.py:  The container and prefix are now stored as instance variables of TerminalWebSocket (so they could be used by the Logging plugin).
termio.py:  The log format now includes the number of rows/cols in the metadata.
termio.py:  Made some minor adjustments to the blocked_io_handler (and related checks/functions) to make that whole watchdog-style mechanism more efficient.  Seems to kick in a lot faster now when someone runs a command like "yes".
gateone.js:  Minor change to loadWebWorkerAction() to prevent an exception that can occur when closing terminals (related to the now-gone terminal's title).
gateone.js:  Added a new function to GateOne.Utils:  getOffset().  Does what you'd think.
gateone.js:  The container and prefix are now sent along with the authentication JSON message.
gateone.js:  GateOne.Terminal has been placed inside its own sandbox in order to avoid a circular reference with the GateOne object when executing terminal refreshes.  NOTE: According to the debugger it seems to have worked (no more circular GateOne object references).  Also according to the debugger it seems to have made absolutely no difference in memory consumption.
gateone.js:  Changed how terminal updates are processed slightly in order to avoid creating circular references that could prevent proper JavaScript garbage collection.  In theory, these changes are for the better but I didn't notice much of a change in terms of memory utilization.  Also, Chrome 16 has a memory leak of some sort (with Gate One) that I couldn't seem to work around (which is what I was trying to do with these changes).  Fortunately this problem appears to be fixed in Chrome 17 and you can always reclaim memory by simply reloading Gate One in your browser window.
gateone.js:  Added the ability to disable the bell sound (a visual indication will still appear).  This should resolve liftoff#80
logviewer.py:  Moved some of the functions from logging_plugin.py into logviewer.py since it makes more sense to have them there.
terminal.py:  Minor adjustment to the title sequence and special optional escape sequence regular expressions so they won't get confused and have you stuck in a mode where the terminal emulator thinks you're endlessly entering a title or a special optional escape sequence.
utils.py:  ^J and ^M have been commented out of REPLACEMENT_DICT because they were causing issues when playing back logs (which sort of defeated the purpose of that dict in the first place).
Bookmarks Plugin:  Minor change to bookmarks.js to prevent a possible (transient) exception when the iconQueue isn't present while loading.  Also cleaned up a few variables that weren't being used.
Playback Plugin:  Playback of session recordings is now working (again).  I also fixed the logic that will re-size the terminal to fit within the current window.
Logging Plugin:  BIG CHANGE/NEW:  Viewing and playback of server-side logs is now working.  Try out the new log viewer!  Also a cool note:  The logging plugin implements a pretty novel method for performing asynchronous non-blocking off-loading of CPU-intensive tasks using the multiprocessing module *with* callbacks that can operate on non-picklable variables and instancemethods!  I have been trying to figure out how to do that for a very long time now and I may have stumbled across a completely new programming pattern (for Python anyway).
CSS Themes:  Made some adjustments so that the input elements in the settings panel don't get cut off (slightly) on the right.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants