Gadfly server startup error

R

Ralf Muschall

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
 
S

Steve Holden

Ralf said:
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
 
R

Ralf Muschall

Steve said:
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
 
S

Steve Holden

Ralf said:
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
 
R

Ralf Muschall

Steve said:
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
 
A

aaronwmail-usenet

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."
 
A

aaronwmail-usenet

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top