Re: [Zope-dev] Re: [Zope] Zope-2.1.0b2 fails on access to management screen
At 17:52 19-11-99 , Jim Cain wrote:
I tried the above changes, but I still got the same error.
Then I tried removing things altogether, one at a time. Finally I discovered that by removing the first %d on line 225 and self.addr[1] on line 226, while leaving everything else alone, it works fine.
One curious thing though: When I run it this way, the line it writes in the log file begins with ^D. Where is that character coming from?
Eh? This suggests that self.addr[1] is now broken, which means that it was previously (older Zope version) wasn't working either.. And I don't get the ^D either. Do you know how to use the Perl Debugger? I think a few debugging steps are in order here. Insert the lines import pdb pdb.set_trace() somewhere before the offending lines (for example, at 222), start Zope in debugging mode (so it won't detach from the console). Then, when you go to your site and your pdb statements are executed, you can follow exactly what goes wrong where, and why. Let us know! -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
Do you know how to use the Perl Debugger?
Three possibilities: 1. There is something about this thread that I am missing. 2. The above question contains a typo. 3. The above question contains a blasphemy. ;-) Eric W. Sink, Software Craftsman SourceGear Corporation eric@sourcegear.com
At 00:22 20-11-99 , Eric W. Sink wrote:
Do you know how to use the Perl Debugger?
Aaaargggg....
Three possibilities:
1. There is something about this thread that I am missing.
2. The above question contains a typo.
It is a typo. Please believe me... =) Thank you for pointing out.
3. The above question contains a blasphemy.
I meant to say Python Debugger, honestly. I am a former Perl user, true, but I am a true believer now. =) My excuse is that I am somewhat tired, and very preoccupied right now. Big things afoot. =) -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
--On Saturday, November 20, 1999 00:02 +0100 Martijn Pieters <mj@antraciet.nl> wrote:
At 17:52 19-11-99 , Jim Cain wrote:
I tried the above changes, but I still got the same error.
Then I tried removing things altogether, one at a time. Finally I discovered that by removing the first %d on line 225 and self.addr[1] on line 226, while leaving everything else alone, it works fine.
One curious thing though: When I run it this way, the line it writes in the log file begins with ^D. Where is that character coming from?
Eh? This suggests that self.addr[1] is now broken, which means that it was previously (older Zope version) wasn't working either.. And I don't get the ^D either.
Do you know how to use the Perl Debugger? I think a few debugging steps are in order here. Insert the lines
import pdb pdb.set_trace()
somewhere before the offending lines (for example, at 222), start Zope in debugging mode (so it won't detach from the console). Then, when you go to your site and your pdb statements are executed, you can follow exactly what goes wrong where, and why.
Let us know!
Okay, I put in the set_trace, and this is what I found: (Pdb) l 220 else: 221 method="GET" 222 if self.addr: 223 import pdb 224 pdb.set_trace() 225 -> self.server.logger.log ( 226 self.addr[0], 227 '%d - - [%s] "%s %s" %d %d' % ( 228 self.addr[1], 229 time.strftime ( 230 '%d/%b/%Y:%H:%M:%S ', (Pdb) whatis self.addr <type 'string'> (Pdb) p self.addr '\004\010\204\364\377\277\226y' (Pdb) p self.addr[0] '\004' (Pdb) p self.addr[1] '\010' Well at least we know where the ^D is coming from, but what is self.addr supposed to contain, a string representation of the IP address of the client? Jim
Jim Cain wrote:
Then I tried removing things altogether, one at a time. Finally I discovered that by removing the first %d on line 225 and self.addr[1] on line 226, while leaving everything else alone, it works fine.
One curious thing though: When I run it this way, the line it writes in the log file begins with ^D. Where is that character coming from?
Then I wrote something that amounts to
import pdb pdb.set_trace()
somewhere before the offending lines (for example, at 222), start Zope in debugging mode (so it won't detach from the console).
Let us know!
And Jim then wrote
Okay, I put in the set_trace, and this is what I found:
(Pdb) l 220 else: 221 method="GET" 222 if self.addr: 223 import pdb 224 pdb.set_trace() 225 -> self.server.logger.log ( 226 self.addr[0], 227 '%d - - [%s] "%s %s" %d %d' % ( 228 self.addr[1], 229 time.strftime ( 230 '%d/%b/%Y:%H:%M:%S ', (Pdb) whatis self.addr <type 'string'> (Pdb) p self.addr '\004\010\204\364\377\277\226y' (Pdb) p self.addr[0] '\004' (Pdb) p self.addr[1] '\010'
Well at least we know where the ^D is coming from, but what is self.addr supposed to contain, a string representation of the IP address of the client?
Hmm.. And this means, what I can make out, that you now have a AF_UNIX type socket and address, and that address is a string, but the code expects a AF_INET type socket and address, whose address is a (host, port) pair. Which leaves us with the question, how did you end up with a AF_UNIX type socket instead of a AF_INET type? And why doesn't the code in PCGIServer.py account for the possibility? You probably switched from Inet sockets to Unix sockets in the meantime, right? Does ZServer start up with a message like 'PCGI Server started at ... Inet socket port: ...' or does it say 'Unix Socket: ...'? As PCGIServer works with both types of sockets, this logging thing is a bug. Report it at the Collector: http://classic.zope.org:8080/Collector/ -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
participants (3)
-
Eric W. Sink -
Jim Cain -
Martijn Pieters