Gadfly server startup error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ralf Muschall

    #1

    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
  • Steve Holden

    #2
    Re: Gadfly server startup error

    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\gadfly Zip>python run_tests
    Traceback (most recent call last):
    File "run_tests" , line 9, in ?
    go()
    File "C:\Steve\gadfl yZip\test\__ini t__.py", line 35, in go
    l.append(test_m ods[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\gadf ly\scripts\gfse rver.py", line 101, in ?
    main()
    File "gadflyZip\gadf ly\scripts\gfse rver.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

    Comment

    • Ralf Muschall

      #3
      Re: Gadfly server startup error

      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

      Comment

      • Steve Holden

        #4
        Re: Gadfly server startup error

        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

        Comment

        • Ralf Muschall

          #5
          Re: Gadfly server startup error

          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+retur n at the client prompt causes
          a timeout in the client and a message

          |no such policy: foodb
          |main loop on <socket._socket object object at 0x4080838c<gadf ly.database.gad fly 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

          Comment

          • aaronwmail-usenet@yahoo.com

            #6
            Re: Gadfly server startup error

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

            Comment

            • aaronwmail-usenet@yahoo.com

              #7
              Re: Gadfly server startup error


              aaronwmail-usenet@yahoo.co m 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



              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_t est 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

              Comment

              Working...