469,628 Members | 1,163 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,628 developers. It's quick & easy.

Gadfly server startup error

Hello,

I just tried the recent gadfly (from SF), using Python
2.4.2 (hand built, since my Suse 8.2 had only 2.2.2).

The direct operation of gadfly works.

After calling gfserver, I get (in addition to a complete
users manual dumped on the screen) the following error
message:

|Traceback (most recent call last):
| File "/usr/local/bin/gfserver", line 4, in ?
| main()
| File "/usr/local/python-2.4.2/lib/python2.4/site-packages/gadfly/scripts/gfserver.py", line 89, in main
| S = Server(int(port), db, dr, pw, startup)
|NameError: global name 'Server' is not defined
which is factually correct (the script only imports sys,
but then tries to instantiate the class "Server" which is
nowhere defined).

Is this a bug somewhere, or is just my installation broken?

Ralf
Sep 12 '06 #1
6 1541
Ralf Muschall wrote:
Hello,

I just tried the recent gadfly (from SF), using Python
2.4.2 (hand built, since my Suse 8.2 had only 2.2.2).

The direct operation of gadfly works.

After calling gfserver, I get (in addition to a complete
users manual dumped on the screen) the following error
message:

|Traceback (most recent call last):
| File "/usr/local/bin/gfserver", line 4, in ?
| main()
| File "/usr/local/python-2.4.2/lib/python2.4/site-packages/gadfly/scripts/gfserver.py", line 89, in main
| S = Server(int(port), db, dr, pw, startup)
|NameError: global name 'Server' is not defined
which is factually correct (the script only imports sys,
but then tries to instantiate the class "Server" which is
nowhere defined).

Is this a bug somewhere, or is just my installation broken?
You're already doing better than I am. On Cygwin 2.5rc2 and Windows
2.4.2 I can't even get it to runs its tests properly:
C:\Steve\gadflyZip>python run_tests
Traceback (most recent call last):
File "run_tests", line 9, in ?
go()
File "C:\Steve\gadflyZip\test\__init__.py", line 35, in go
l.append(test_mods[name].suite())
AttributeError: 'module' object has no attribute 'suite'

Running gvserver I get pretty mucht he same thing you do:

Traceback (most recent call last):
File "gadflyZip\gadfly\scripts\gfserver.py", line 101, in ?
main()
File "gadflyZip\gadfly\scripts\gfserver.py", line 89, in main
S = Server(int(port), db, dr, pw, startup)
NameError: global name 'Server' is not defined

Time to report a bug, methinks? Makes SQLite look good ...

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 13 '06 #2
Steve Holden wrote:
You're already doing better than I am. On Cygwin 2.5rc2 and Windows
2.4.2 I can't even get it to runs its tests properly:
I don't remember whether I looked into that at all.

....
NameError: global name 'Server' is not defined
....
Time to report a bug, methinks? Makes SQLite look good ...
Carl Waldbieser reported this bug (and a few others, including
fixes) in April 04 (entry 94049[35]). It seems the project
fell asleep four years ago (but in "News" on SF is a more recent
message from the author pointing to xsdb).

Ralf
Sep 13 '06 #3
Ralf Muschall wrote:
Steve Holden wrote:

>>You're already doing better than I am. On Cygwin 2.5rc2 and Windows
2.4.2 I can't even get it to runs its tests properly:


I don't remember whether I looked into that at all.

....
>>NameError: global name 'Server' is not defined


....
>>Time to report a bug, methinks? Makes SQLite look good ...


Carl Waldbieser reported this bug (and a few others, including
fixes) in April 04 (entry 94049[35]). It seems the project
fell asleep four years ago (but in "News" on SF is a more recent
message from the author pointing to xsdb).
Yes, the whole Gadfly SF web seems to be a bit of a mess.

That news page talks about a "new release", but nothing has actually
been released, so I presume that code is in SVN now. Frankly I'm not
encouraged to use it, though it's a pity: I discussed Gadfly somewhat in
"Python Web Programming", and it would have been nice to see it survive.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Sep 13 '06 #4
Steve Holden wrote:
Yes, the whole Gadfly SF web seems to be a bit of a mess.
Maybe it has been infected by the source code+doc ;-)

I just started the server (after applying Carl's changes)
with

gfserver 2222 foodb . ''

(the DB "foodb" had been created earlier using gfplus
locally).

If I look for it with "nmap localhost -p 2222", it enters
an endless loop (I don't know whether it would still work
after this, since I could not get it to work at all).

gfplus in client-mode wants the argument order
DB, port-No, password, host
(inferred from the source, i.e. the manual is wrong).

The argument order of commandlines and functions seems to be
a general problem - maybe I should try all 24 possibilities
(almost each place in the source does them differently).

After that, it says

|gfplus $Revision: 1.7 $ -- Interactive gadfly shell [readline]
|
|Wednesday September 13, 2006 04:53 PM
|Using:
|Policy: foodb
|Loc: localhost:2222

i.e. it includes a thing called "Policy" (unexplained, just
mentioned in the "Security" chapter of the server manual)
and fills it with the value of the database name (but comparing
scripts/gfplus.py and client.py, "database" and "policy" seem
to be synonyms (but this disagrees with server.py)).

Entering a lone semicolon+return at the client prompt causes
a timeout in the client and a message

|no such policy: foodb
|main loop on <socket._socketobject object at 0x4080838c<gadfly.database.gadfly instance at 0x40435eac>
|server: waiting for connection(s)

in the server (which is true in some sense, since I never made
a policy - I just want a blood DB).

It seems the proper way to use gadfly over the net is to say

echo 'SQL statement;' | ssh -l remoteuser 'gfplus -localoptions'

:-(

Is anybody out there who has used the server+client operation
mode successfully?

Ralf
Sep 13 '06 #5
Is anybody out there who has used the server+client operation
mode successfully?
Well, several years ago, yes.

Since then the project was taken over by some volunteers
and they did an excellent job of
restructuring and modernizing (somewhat) the
*standalone* part of gadfly, but apparently they
didn't port the *client/server* component properly.
As it stands the client server portion is broken now.
(I hadn't tried it after the port, sorry).

I think if you find an older (pre-sourceforge)
tarball it will work. I will try
to find time to fix this, unless someone else wants
to have a try. Sorry!

Also, the reference to the new release on the
site refers to a mini-release I did a year or more
ago which fixed various bugs and also added
an xsdb interface component.

-- Aaron Watters

===
There once was a man from Japan
whose limericks never would scan
when told this was so
he said "yes, I know,
but I always try to put as many words in the last line as I possibly
can."

Oct 2 '06 #6

aa***************@yahoo.com wrote:
Is anybody out there who has used the server+client operation
mode successfully?

Well, several years ago, yes.
I looked into it and it was mainly a documentation and
test issue, I think. The code seems to work.

Please go

http://gadfly.sourceforge.net/gadfly_server_test.zip

and look at the readme. I will try to fold this in to the
distribution sometime soon.

from the README in the zip:

==========
gadfly_server_test readme

This directory provides a proof of concept test run of the
gadfly server components. It requires gadfly to be installed
in the local python installation ( http://gadfly.sourceforge.net ).

Please see the doc string at the top of gfstest.py for details.

Example demo run sequence (in Windows installations the "python" prefix
is optional):

1. Set up the database.
% python gftest.py dbtest

2. Start the server
% python gfstest.py start

This starts an infinite server loop in the current console.

3. SWITCH TO ANOTHER WINDOW and run test queries.
% python gfstest.py queries

4. Shut down the server.
% python gfstest.py shutdown
=============

-- Aaron Watters

===
There once was a man who said "Well!
Will nobody answer this bell?
I have pulled day and night
'til my hair has grown white
but nobody answers this bell!"
-- Edward Lear

Oct 2 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Patrick W. Fraley | last post: by
4 posts views Thread by Brian O. Bush | last post: by
3 posts views Thread by R.Marquez | last post: by
1 post views Thread by Ian Pellew | last post: by
reply views Thread by Tommy | last post: by
3 posts views Thread by niko | last post: by
3 posts views Thread by chris | last post: by
8 posts views Thread by jean-jeanot | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.