ArchipelProject / Archipel

XMPP Based Orchestrator
http://archipelproject.org
GNU Affero General Public License v3.0
803 stars 127 forks source link

missing import in dbconnection.py? #71

Closed fk0 closed 13 years ago

fk0 commented 13 years ago

Hi,

tried again to install Archipel agent and the process went ok but after using standard starting script i.e. service archipel start I couldn't find any running python instance then I tried to run the command directly from terminal like init script does

=====================================================================
# runarchipel --config=/etc/archipel/archipel.conf

Traceback (most recent call last):
  File "/usr/local/bin/runarchipel", line 5, in 
    pkg_resources.run_script('archipel-agent==1.0.29beta', 'runarchipel')
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 489, in run_script
    set's ``.entries`` (if it wasn't already present).
  File "/usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1207, in run_script
    exec script_code in namespace, namespace
  File "/usr/local/lib/python2.6/dist-packages/archipel_agent-1.0.29beta-py2.6.egg/EGG-INFO/scripts/runarchipel", line 144, in 
    if pid == 0: main()
  File "/usr/local/lib/python2.6/dist-packages/archipel_agent-1.0.29beta-py2.6.egg/EGG-INFO/scripts/runarchipel", line 108, in main
    hyp = TNArchipelHypervisor(jid, password, config, name, database)
  File "/usr/local/lib/python2.6/dist-packages/archipel_agent-1.0.29beta-py2.6.egg/archipel/archipelHypervisor.py", line 138, in __init__
    self.permission_center          = TNArchipelPermissionCenter(permission_db_file, permission_admin_name)
  File "/usr/local/lib/python2.6/dist-packages/archipel_core-1.0.7beta-py2.6.egg/archipelcore/archipelPermissionCenter.py", line 64, in __init__
    self.connection = sqlobject.connectionForURI(connection_string)
  File "/usr/local/lib/python2.6/dist-packages/SQLObject-0.16dev_r4333-py2.6.egg/sqlobject/dbconnection.py", line 937, in connectionForURI
    conn = connCls.connectionFromURI(uri)
  File "/usr/local/lib/python2.6/dist-packages/SQLObject-0.16dev_r4333-py2.6.egg/sqlobject/sqlite/sqliteconnection.py", line 99, in connectionFromURI
    user, password, host, port, path, args = cls._parseURI(uri)
  File "/usr/local/lib/python2.6/dist-packages/SQLObject-0.16dev_r4333-py2.6.egg/sqlobject/dbconnection.py", line 147, in _parseURI
    if os.name == 'nt':
NameError: global name 'os' is not defined
=====================================================================

Asked google and found the quick and dirty solution - added "import os" statement to the dbconnection.py as the first line After that Archipel seems to start. At least now I can see it in the process list

So my questions are following:

  1. It's very boring to modify each debian init script after seeing that is didn't worked - all this stuff has completely disabled debug output. So if it's possible it would be nice to have error description if $retval is not 0.
  2. How can this issues be fixed in a right way?
  3. It is the way hard to find the link to this bug tracker on the site - is it "by design"?

Thanks!

primalmotion commented 13 years ago

it's a bug with SQLObject you can try two things:

then restart archipel agent

fk0 commented 13 years ago

ok, I fixed issue... thank you for answer what is next? I couldn't find what I need to do to view Archipel in my browser? does it listen port or it relies on already installed apache and only uses CGI?

primalmotion commented 13 years ago

sorry I read to fast.

  1. if something goes wrong with the init script, run manually runarchipel, it will output correctly the errors and tracebacks
  2. as I said this issue if a SQLObject issue and seems to be fixed
  3. hard to find the github issues for Archipel ? it's written almost everywhere, from the README to the IRC topic channel, and in the website. How have you miss it ? :)
primalmotion commented 13 years ago

I couldn't find what I need to do to view Archipel in my browser? does it listen port or it relies on already installed apache and only uses CGI?

Archipel GUI is a pure Javascript application. All runs from your browser. No needs for mysql, php, or anything else. Just place the folder into a http-served directory and access it. You also can run it from file:/// as is with Safari, or with Chrome/ium by launching it with --disable-web-security option.

primalmotion commented 13 years ago

also, note that ArchipelGUI and archipel-agent are totally not dependent. They communicate trough XMPP. here is a general schema of things https://github.com/primalmotion/Archipel/wiki/General-architecture-of-archipel.

This means you doesn't "connect" directly to archipel agent.

fk0 commented 13 years ago

well, one more pain... after all I successfully installed agent and moved to client installation ./bootstrap script (btw, wiki page needs updating - bootstrap now called ./bootstrap without extension =) ) fails:

Installing necessary packages...                                                                                                                               
Updating catalog.                                                                                                                                              
Downloading http://github.com/280north/narwhal/raw/master/catalog-2.json
Unable to download a fresh copy of catalog http://github.com/280north/narwhal/raw/master/catalog-2.json.
SyntaxError in http://github.com/280north/narwhal/raw/master/catalog-2.json.
Catalog: file:/usr/local/narwhal/.tusk/sources.json

well, googled again (I love google, really :) ) and found explanation and solution https://github.com/280north/cappuccino/issues/759 but it didn't work... env vars are set but are ignored by net.properties file after all I guessed that proxy setting should be set evidently and finally I got it to work!!! (at least now I can see the installation process with pretty formatted output :D )

P.S. I think this painful installation behind proxy way should be described in the wiki - it will save tons of hours googling and trying various options. For example in this case I had to set proxy for curl, java, wget, git and svn and sometimes use proxychains behind cntlm (we are using ISA server which leads to many inconvenient situations if you're on linux). Hope it helps to somebody.

fk0 commented 13 years ago

well, after all installation went smoothly but what's next? now I have /var/www/a dir and (I hope) properly installed client there pointed browser to this dir and see picture and "busy" icon nothing more happens however....

fk0 commented 13 years ago

ok, I think I've found what happens using the chromium's debugging capabilities I found out that it couldn't find the file Archipel/Frameworks/VNCCappuccino/Resources/websock.js which really didn't placed there but I can see web-socket-js/web_socket.js in Resources directory

primalmotion commented 13 years ago

this is not an issue. You need to pull last git repo if you want to have everything ok. Also, I suggest you to use the nightlies if you don't planed to develop on archipel (and even if you plan to do, you should start with the nightly).

If you need help, please come to the IRC channel on irc://irc.freenode.net/#archipel. You also have a web client on http://archipelproject.org/chat