Re: PostgreSQL Exception: invalid input syntax for type timestamp

Adam Tauno Williams <[email protected]> Fri, 27 Feb 2009 22:59:27 -0500
Newsgroups gmane.comp.cms.opengroupware.user
Message-ID <1235793567.5233.37.camel@linux-m3mt>
On Fri, 2009-02-27 at 16:50 -0500, Adam Tauno Williams wrote:
> On Tue, 2009-02-17 at 23:32 +0100, Helge Hess wrote:
> > On 17.02.2009, at 22:44, Sven Arnold wrote:
> > > Hmm.., don't know if I understand what you mean by "-raise". Shouldn't
> > > there be a function name?
> > 
> > "-raise" refers to the Objective-C instance method raise. Maybe the  
> > syntax is slightly wrong for GDB, didn't try. Maybe "break [NSObject  
> > raise]" works. Something like that ;-)
> 
> The procedure is:
> 
> gdb '/usr/sbin/ogo-webui-1.1'
> (gdb) r -WOUseWatchDog NO
> Ctrl-C
> (gdb) break raise
> Breakpoint 1 at 0xb767eeda: file NSException.m, line 199.
> (gdb) c
> Continuing.
>   ... produce error ...
> (gdb) bt
> #0  -[NSException raise] (self=0x8fff56c, _cmd=0xb7b2abc0) at
> NSException.m:199
> #1  0xb7add292 in ?? () from /usr/lib/libGDLAccess.so.4.7
> #2  0xb7b6c7a7 in ?? () from /usr/lib/libLSFoundation.so.5.3
> #3  0xb712b320 in ?? ()
> from /usr/lib/opengroupware.org-1.1/commands/LSBase.cmd/LSBase
> #4  0xb7b66d32 in ?? () from /usr/lib/libLSFoundation.so.5.3
> #5  0xb7b5c370 in ?? () from /usr/lib/libLSFoundation.so.5.3
> #6  0xb7b5bc2d in LSCommandRunV () from /usr/lib/libLSFoundation.so.5.3
> #7  0xb710f821 in ?? ()
> from /usr/lib/opengroupware.org-1.1/commands/LSAccount.cmd/LSAccount
> ....
> 
> now I just need to get debugging symbols :)

(gdb) bt
#0  -[NSException raise] (self=0x900897c, _cmd=0xb7b2abc0) at
NSException.m:199
#1  0xb7add292 in ?? () from /usr/lib/libGDLAccess.so.4.7
#2  0xb7b6c7a7 in -[LSDBObjectNewCommand _executeInContext:]
(self=0x8ffc34c, _cmd=0xb71360f0, _context=0x8dc7434) at
LSDBObjectNewCommand.m:187
#3  0xb712b320 in -[LSAddSessionLogCommand _executeInContext:]
(self=0x8ffc34c, _cmd=0xb7bbb990, _context=0x8dc7434) at
LSAddSessionLogCommand.m:80
#4  0xb7b66d32 in -[LSDBObjectBaseCommand primaryRunInContext:]
(self=0x8ffc34c, _cmd=0xb7bb6730, _context=0x8dc7434) at
LSDBObjectBaseCommand.m:186
#5  0xb7b5c370 in -[LSBaseCommand runInContext:] (self=0x8ffc34c,
_cmd=0xb7bb66a0, _context=0x8dc7434) at LSBaseCommand.m:193
#6  0xb7b5bc2d in LSCommandRunV (_ctx=0x8dc7434, _factory=0x80f0f54,
_domain=0xb711afa8, _command=0xb711afb4) at LSBaseCommand.m:85
#7  0xb710f821 in -[LSLoginAccountCommand _executeInContext:]
(self=0x8fbe0d4, _cmd=0xb7bbb990, _context=0x8dc7434) at
LSLoginAccountCommand.m:257
#8  0xb7b66d32 in -[LSDBObjectBaseCommand primaryRunInContext:]
(self=0x8fbe0d4, _cmd=0xb7bb6730, _context=0x8dc7434) at
LSDBObjectBaseCommand.m:186
#9  0xb7b5c370 in -[LSBaseCommand runInContext:] (self=0x8fbe0d4,
_cmd=0xb7bb81e0, _context=0x8dc7434) at LSBaseCommand.m:193
#10 0xb7b616e8 in runCommand () at LSCommandContext.m:871
#11 0xb7b5f91e in -[LSCommandContext runCommand:vargs:] (self=0x8dc7434,
_cmd=0xb7bcf990, _command=0xb7bcf474, _va=0xbfffe108) at
LSCommandContext.m:458
#12 0xb7b92448 in -[OGoContextSession runCommand:] (self=0x8dcf254,
_cmd=0xb7bcfa08, _command=0xb7bcf474) at OGoContextSession.m:205
#13 0xb7b92b7a in -[OGoContextSession
login:password:crypted:isSessionLogEnabled:] (self=0x8dcf254,
_cmd=0xb7bcd410, _login=0x8dbea74, _pwd=0x805b0bc, 
    _crypted=0 '\000', _isSessionLogEnabled=1 '\001') at
OGoContextSession.m:288
#14 0xb7b8eaa4 in -[OGoContextManager
login:password:crypted:isSessionLogEnabled:] (self=0x82c7ac4,
_cmd=0xb7bcd400, _login=0x8dbea74, _password=0x805b0bc, 
    _crypted=0 '\000', _isSessionLogEnabled=1 '\001') at
OGoContextManager.m:691
#15 0xb7b8e860 in -[OGoContextManager login:password:] (self=0x82c7ac4,
_cmd=0x805c6c8, _login=0x8dbea74, _password=0x805b0bc) at
OGoContextManager.m:661
#16 0x08051a0c in -[WODirectAction(LoginAction)
loginActionWithLogin:password:request:] (self=0x8dab45c, _cmd=0x805b478,
login=0x8dbea74, pwd=0x805b0bc, 
    req=0x8da9144) at WODirectAction+LoginAction.m:343
#17 0x0804fccf in -[DirectAction performActionNamed:] (self=0x8dab45c,
_cmd=0xb7db4cd0, _actionName=0xb7db49a8) at DirectAction.m:160


The date formatting is failing all over the place, but not really
consistently,  witness the ogo-webui-err log output:

Continuing.
Feb 28 03:22:14 ogo-webui-1.1 [5758]: <0x0x8db7834[OGoHelpManager]>
Note: no OGo documentation installed!
Feb 28 03:22:14 ogo-webui-1.1 [5758]: <0x0x8db7834[OGoHelpManager]> SP: 
Feb 28 03:22:14 ogo-webui-1.1 [5758]: |ogo-webui-1.1|
<OpenGroupware[0x0x8102cfc]: name=ogo-webui-1.1>: created session:
<OGoSession[0x0x8dbd90c]: id=167E167E0149A8ADE6>
%b %d %H:%M:%S ogo-webui-1.1 [5758]: ccaps:
<WEClientCapabilities[0x0x8dc48f4]: type=Mozilla v5.0 os=Linux cpu=ix86
fast-tbl css2 xul js>
%b %d %H:%M:%S ogo-webui-1.1 [5758]: Note: PostgreSQL72 adaptor using
timezone 'GMT' as default

It would seem that the root of this problem has to be in
PrintfFormatScanner / NSCalendarDateScannerHandler

<snip>
+ (NSString *)descriptionForCalendarDate:(NSCalendarDate *)date
  withFormat:(NSString *)format
  timeZoneDetail:(NSTimeZoneDetail *)detail
  locale:(NSDictionary *)locale
{
    id formatScanner  = [[PrintfFormatScanner alloc] init];
    id scannerHandler = [NSCalendarDateScannerHandler alloc];
    id string;

    /* Use a dummy va_list so compilation doesn't crash under alpha */
    va_list list;

    NSAssert(date,   @"missing date ..");

    if (detail == nil)
        detail = (id)[[NSTimeZone localTimeZone] timeZoneForDate:date];
    //NSAssert(detail, @"missing timezone detail ..");

    [scannerHandler initForCalendarDate:date timeZoneDetail:detail];
    [formatScanner setFormatScannerHandler:scannerHandler];
    string = [formatScanner stringWithFormat:format arguments:list];
    RELEASE(scannerHandler); scannerHandler = nil;
    RELEASE(formatScanner);  formatScanner  = nil;
    return string;
}
</snap>

So, boy does this look like a candidate (in PrintfFormatScanner) - 

<snip>
if (args == NULL) {
  /* We got no parameters, so we cannot resolve them anyways. If the
   * string contains patterns, we should probably raise an error?
   */
  return format;
 }
</snap>

- as we are getting exactly out format spec handled back to us.  If I
toss an fprintf into there it gets pinged!

PrintfFormatScanner for no args, returning format!
%b %d %H:%M:%S ogo-webui-1.1 [16973]: Note: folder-view did not find
Epoz.

-- 
OpenGroupware.org Users
[email protected]
http://mail.opengroupware.org/mailman/listinfo/users