From madnificent at gmail.com Wed Mar 4 21:53:56 2009 From: madnificent at gmail.com (Aad Versteden) Date: Wed, 4 Mar 2009 22:53:56 +0100 Subject: [cl-openid-devel] getaddrinfo fails upon calling 'cl-openid:initiate-authentication In-Reply-To: References: Message-ID: Hello, I've been trying to get cl-openid running today, yet I'm failing miserably. ?For some reason (it might not be specific to cl-openid, yet I could reproduce it on two computers on the same network) the call to 'cl-openid:initiate-authentication seems to fail with the error "Name service error in "getaddrinfo": -2 (Name or service not known)". ?On ubuntu, that status code becomes -5. This happens when running the rlying-part.lisp example (with an updated call to 'init-relying-party) in the current darcs repository. I have used darcs dist and ran asdf-install on that tarball to fetch the other needed libraries. ?Some changes were needed in the code, to make it compatible with the current tarball of hunchentoot. I have tried to run some c-code to see if getaddrinfo worked on some trivial cases and that seems to work. ?Hover, getaddrinfo seems to fail on calls with an http prefix. Any help is appreciated! madnificent From avodonosov at yandex.ru Thu Mar 5 10:02:32 2009 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Thu, 05 Mar 2009 13:02:32 +0300 Subject: [cl-openid-devel] getaddrinfo fails upon calling 'cl-openid:initiate-authentication In-Reply-To: References: Message-ID: <547131236247352@webmail61.yandex.ru> Hello Aad, First of all, I must admit that as far as I know nobody has tried cl-openid in real project, so it may be bit unpolished. As for you problem. What Lisp do you use? Could you provide a backtrace of the error? Best regards, - Anton 05.03.09, 00:53, "Aad Versteden" : > Hello, > I've been trying to get cl-openid running today, yet I'm failing > miserably. ?For some reason (it might not be specific to cl-openid, > yet I could reproduce it on two computers on the same network) the > call to 'cl-openid:initiate-authentication seems to fail with the > error "Name service error in "getaddrinfo": -2 (Name or service not > known)". ?On ubuntu, that status code becomes -5. > This happens when running the rlying-part.lisp example (with an > updated call to 'init-relying-party) in the current darcs repository. > I have used darcs dist and ran asdf-install on that tarball to fetch > the other needed libraries. ?Some changes were needed in the code, to > make it compatible with the current tarball of hunchentoot. > I have tried to run some c-code to see if getaddrinfo worked on some > trivial cases and that seems to work. ?Hover, getaddrinfo seems to > fail on calls with an http prefix. > Any help is appreciated! > madnificent > _______________________________________________ > cl-openid-devel mailing list > cl-openid-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/cl-openid-devel From maciej at pasternacki.net Thu Mar 5 10:16:58 2009 From: maciej at pasternacki.net (Maciej Pasternacki) Date: Thu, 5 Mar 2009 11:16:58 +0100 Subject: [cl-openid-devel] Fwd: getaddrinfo fails upon calling 'cl-openid:initiate-authentication References: <6B464C14-0923-44E5-AED9-FAE0E1D3B2D2@pasternacki.net> Message-ID: <78D605BD-72A7-4BCB-96EA-6E40B60BCBCE@pasternacki.net> I just realized that I replied to private mail instead of the list, so I'm forwarding my message to list for the archives. Sorry, Maciek. Begin forwarded message: > From: Maciej Pasternacki > Date: 5 marca 2009 00:51:11 GMT+01:00 > To: Aad Versteden > Subject: Re: [cl-openid-devel] getaddrinfo fails upon calling 'cl- > openid:initiate-authentication > > Hello, > > On 2009-03-04, at 22:53, Aad Versteden wrote: > >> I've been trying to get cl-openid running today, yet I'm failing >> miserably. For some reason (it might not be specific to cl-openid, >> yet I could reproduce it on two computers on the same network) the >> call to 'cl-openid:initiate-authentication seems to fail with the >> error "Name service error in "getaddrinfo": -2 (Name or service not >> known)". On ubuntu, that status code becomes -5. > > Can you, please, paste here the whole error backtrace and, if it's > possible, the OpenID that gives this error? It looks like an error > that would be caused by an invalid ID. > > Which OS and Lisp implementation do you use? > > Does using Subversion snapshot of usocket, or darcs snapshot of cffi > help? For development I use cl-librarian setup (described in > README), which gets usocket, trivial-utf-8, bordeaux-threads, arnesi > and fiveam from version control. It's possible that asdf-install > has old version of usocket or cffi, it can com from either of those > libraries (I can't really tell without a backtrace). > >> This happens when running the rlying-part.lisp example (with an >> updated call to 'init-relying-party) in the current darcs repository. >> >> I have used darcs dist and ran asdf-install on that tarball to fetch >> the other needed libraries. Some changes were needed in the code, to >> make it compatible with the current tarball of hunchentoot. > > Maybe it's library compatibility problem, I didn't check these for a > while. I'll look into it, but it's possible that I can find some > time only after the weekend. > >> I have tried to run some c-code to see if getaddrinfo worked on some >> trivial cases and that seems to work. Hover, getaddrinfo seems to >> fail on calls with an http prefix. > > > I have no idea, how can http prefix be handed to getaddrinfo. The > backtrace would be helpful. > > I created a fresh environment, checked out all the libraries with cl- > librarian as described in the manual, and tested INITIATE- > AUTHENTICATION by hand. I'm unable to reproduce your error (Clozure > CL on MacOS X 10.5 on Intel). Here's what I ran; can you check how > this code runs for you? > > CL-USER> (defvar *relying-party* (make-instance 'cl-openid:relying- > party > :root-uri (puri:uri "http://localhost/rp > ") > :realm (puri:uri "http://localhost/ > "))) > # > CL-USER> (cl-openid:initiate-authentication *relying-party* "http://www.pasternacki.net/ > ") > # > > CL-USER> > > Regards, > Maciek > > -- > Maciej Pasternacki -><- http://www.pasternacki.net/ -><- http://www.3ofcoins.net/ > -- Maciej Pasternacki -><- http://www.pasternacki.net/ -><- http://www.3ofcoins.net/ From madnificent at gmail.com Sat Mar 7 00:34:49 2009 From: madnificent at gmail.com (Aad Versteden) Date: Sat, 7 Mar 2009 01:34:49 +0100 Subject: [cl-openid-devel] Fwd: getaddrinfo fails upon calling 'cl-openid:initiate-authentication In-Reply-To: <78D605BD-72A7-4BCB-96EA-6E40B60BCBCE@pasternacki.net> References: <6B464C14-0923-44E5-AED9-FAE0E1D3B2D2@pasternacki.net> <78D605BD-72A7-4BCB-96EA-6E40B60BCBCE@pasternacki.net> Message-ID: Hello, The 'bug' I had was probably related to an invalid OpenID (apparently my OpenID provider changed it in the last week or so). I tried to get the library running as quickly as I could, so I installed it again with cl-librarian. This made the whole system work. Because I had seen another strange error come up during testing, I have added the backtrace of an (other) error that got thrown whilst trying to execute your example (see bottom). The error occurs upon calling (cl-openid:initiate-authentication *relying-party* "http://www.pasternacki.net/"). It is only thrown when using the darcs dist method to install the library. The system currently works and I have built a wrapper for cl-openid for cl-ayworks named, cm-openid (github for more info). I still need to catch the errors that might get thrown when the identification fails, is there a comprehensible list of errors available somewhere. If not, I'll go the dirty way, and catch all errors. Thanks for the fast replies and splendid help, Aad Versteden ------ BACKTRACE ------ The function CL-OPENID::EXPT-MOD is undefined. [Condition of type UNDEFINED-FUNCTION] Restarts: 0: [ABORT] Return to SLIME's top level. 1: [TERMINATE-THREAD] Terminate this thread (#) Backtrace: 0: ("bogus stack frame") 1: (CL-OPENID::ASSOCIATE #)[:EXTERNAL] 2: ((FLET SB-THREAD::WITH-MUTEX-THUNK)) 3: ((FLET #:WITHOUT-INTERRUPTS-BODY-[CALL-WITH-MUTEX]477)) 4: (SB-THREAD::CALL-WITH-MUTEX # #S(SB-THREAD:MUTEX :NAME NIL :%OWNER # :STATE 1) # T) 5: (CL-OPENID::ASSOCIATION # # NIL) 6: (CL-OPENID:INITIATE-AUTHENTICATION # "http://www.pasternacki.net/")[:EXTERNAL] 7: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CL-OPENID:INITIATE-AUTHENTICATION *RELYING-PARTY* "http://www.pasternacki.net/") #) 8: (SWANK::EVAL-REGION "(cl-openid:initiate-authentication *relying-party* \"http://www.pasternacki.net/\") ") 9: ((LAMBDA NIL)) 10: (SWANK::TRACK-PACKAGE #) 11: ((LAMBDA (SWANK-BACKEND::FN)) #) 12: (SWANK::CALL-WITH-BUFFER-SYNTAX #) 13: (SWANK::REPL-EVAL "(cl-openid:initiate-authentication *relying-party* \"http://www.pasternacki.net/\") ") 14: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:LISTENER-EVAL "(cl-openid:initiate-authentication *relying-party* \"http://www.pasternacki.net/\") ") #) 15: ((LAMBDA NIL)) 16: ((FLET #:FORM-FUN1575)) 17: ((FLET #:FORM-FUN1575)) 18: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) # #) 19: ((LAMBDA NIL)) 20: ((FLET #:FORM-FUN1575)) 21: ((FLET #:FORM-FUN1575)) 22: ((LAMBDA (SWANK-BACKEND::HOOK SWANK-BACKEND::FUN)) # #) 23: (SWANK::CALL-WITH-REDIRECTED-IO # #) 24: (SWANK::CALL-WITH-CONNECTION # #) 25: (SWANK::HANDLE-REQUEST #) 26: (SWANK::REPL-LOOP #) 27: (SWANK::REPL-LOOP #)[:EXTERNAL] 28: (SWANK::CALL-WITH-BINDINGS NIL #) 29: ((FLET SB-THREAD::WITH-MUTEX-THUNK)) 30: ((FLET #:WITHOUT-INTERRUPTS-BODY-[CALL-WITH-MUTEX]477)) 31: (SB-THREAD::CALL-WITH-MUTEX # #S(SB-THREAD:MUTEX :NAME "thread result lock" :%OWNER # :STATE 1) # T) 32: ((LAMBDA NIL)) 33: ("foreign function: #x41F1B2") 34: ("foreign function: #x41643A") From maciej at pasternacki.net Sat Mar 7 01:26:51 2009 From: maciej at pasternacki.net (Maciej Pasternacki) Date: Sat, 7 Mar 2009 02:26:51 +0100 Subject: [cl-openid-devel] Fwd: getaddrinfo fails upon calling 'cl-openid:initiate-authentication In-Reply-To: References: <6B464C14-0923-44E5-AED9-FAE0E1D3B2D2@pasternacki.net> <78D605BD-72A7-4BCB-96EA-6E40B60BCBCE@pasternacki.net> Message-ID: <351C5297-7CD4-4E8F-9B08-FCAA6FFA4EE7@pasternacki.net> Hello, On 2009-03-07, at 01:34, Aad Versteden wrote: > Because I had seen another strange error come up during testing, I > have added the backtrace of an (other) error that got thrown whilst > trying to execute your example (see bottom). The error occurs upon > calling (cl-openid:initiate-authentication *relying-party* > "http://www.pasternacki.net/"). It is only thrown when using the > darcs dist method to install the library. It fails on CL-OpenID trying to call undefined function, which should be imported from ironclad. Maybe you have an old version of ironclad in your asdf-install directory? Try to remove and reinstall it. By the way, that's one of the asdf-install's problems that I try to solve with cl-librarian: asdf-install doesn't provide any isolation by default, and librarian's shelves are separate, isolated library sets so that one project's environment doesn't interfere with and isn't affected by any other projects. > The system currently works and I have built a wrapper for cl-openid > for cl-ayworks named, cm-openid (github for more info). I still need > to catch the errors that might get thrown when the identification > fails, is there a comprehensible list of errors available somewhere. > If not, I'll go the dirty way, and catch all errors. There is no list of errors that may get thrown. Failed authentication process throws CL-OPENID:OPENID-ASSERTION-ERROR, but libraries can throw their own conditions on e.g. invalid ID (nonexistent host name), network errors or others. I decided not to catch them on my own, because I would just rethrow other condition then, which would just make situation more obscure, and some conditions would be able to slip through -- it's not Java, libraries themselves don't specify all conditions they may throw, and libraries use other libraries, and implementations themselves throw errors too, and with multiple implementations... and so on. It seems to be best to catch OPENID- ASSERTION-ERROR to display failed login info, and all the other errors to display/log backtrace and show user a 5xx error. Regards, Maciej. -- Maciej Pasternacki -><- http://www.pasternacki.net/ -><- http://www.3ofcoins.net/