Authentication problems between Groovy & CouchDB? -


Groovy is fairly new and I'm trying to write some test cases that the rest of the outside for Groovy Is the interface. To set up our test stability I need to clean Cochindi database and a simple script has been written to do this, but for some reason I am getting back the unauthorized message from Cochindi. Reduced the code and still can not see how easy the example script is. The admin user in CouchDB example is setup, but it is the only deviation from default setup. Username / password checked several times Annoyingly groovy counterclaims from the logs and connects 'curl -x ..' works from the cmd line.

 @ glitch (group = 'org.codehaus.groovy.modules.http- builder', module = 'http-builder', version = '0.5.0') Import groovyx.net.http. RESTClient RESTClient couchDBRestApi = New RESTClient ('http: // localhost: 5984 /') sofa DBRTAP.oth.basic 'Scott', 'tiger' ['mydb']. Encourage each {name -> def resp = couchDBRestApi.delete (path: name) resp.status == 200} 

Looking at the logs I am concerned about a couple of particular entries Empty list at the end of 'Empty' DefaultRequestDirector - Authentication error: Unable to answer any of these challenges: {} '? And 'Dubai RestClant - Response Code: 401; Found Handler: org.codehaus.groovy.runtime.MethodClosure@e2e4d7 '?

reads the full log:

 2010-06-14 15: 19: 27,520 Debu Restalant - Delete 2010-06-14 15: 19: 27,522 Wire -> "Delete / IEDB HTTP / 1/1] [EOL] "2010-06-14 15: 19: 27,523 DeWire wire ->" Accept:  /  [EOL] "2010-06-14 15: 1 9: 27,523 debug wire -> "Host: Localhost: 5984 [EOL]" 2010-06-14 15:19:19 27,524 Debian wire -> "Connection: Elive [EOL]" 2010-06-14 15:19: 27,525 debug wire -> "User-agent: Apache-HTTPPLent / 4.0 (Java 1.5) [EOL]" 2010-06-14 15:19:19 27525 debug wire -> "Accepting-encoding: jizip, diff Net [EoL] "2010-06-14 15:19: 27,526 debut wire ->" [EOL] "2010-06-14 15:19:19 27,526 Debuts Header -> Delete / INDB HTTP / 1.1 2010-06-14 15: 19: 27,527 Debug Header -> Accept:  /  2010-06-14 15:19:19 27,527 Admin Headers -> Host: Localhost: 5984 2010-06-14 15:19 : 27,528 debug headers -> Connection: Elive 2010-06-14 15:19: 27,528 Admin Header -> User-Agent: Apache-HTTP Client / 4.0 (Java 1.5) 2010-06-14 15:19:19 27,529 Debug Headers -> Accept-encoding: jizip, deflate 201 0-06-14 15: 1 9: 27,543 debug wire and take Tinent; - "HTTP / 1.1401 unauthorized [EOL]" 2010-06-14 15:19:19 27,543 debug wire & lt; - "Server: Cochidibi / 0.11.0 (Errang OTP / R13b) [EOL]" 2010-06-14 15: 19: 27,544 Wire Wire Lieutenant; - "Date: Mon, 14 June 2010 14:19:27 GMT [EOL]" 2010-06-14 15:19: 27,544 wire wires & lt; - "Content-type: text / plain; charset = UTF-8 [EOL]" 2010-06-14 15: 19: 27,544 wire strings & lt; - "Content-Length: 64 [EoL]" 2010-06-14 15: 19: 27,545 Wire Wire Lieutenant; - "Cash-control: Co-reclaiming [EOL]" 2010-06-14 15: 19: 27,545 debue wire & lt; - "[EOL]" 2010-06- 14 15:19:19 27,545 debuts header & lt; - HTTP / 1.1 401 Unauthorized 2010-06-14 15: 19: 27,545 Debug Header & lt; - Server: Cochidibi / 0.11.0 (Errang OTP / R13b) 2010-06-14 15:19:19 27,546 Debuts Header and lieutenant; - Date: Mon, 14 June 2010 14:19:27 GMT 2010-06-14 15:19:19 27,546 Debug headers & lt; - content-type: text / plain; Charset = UTF-8 2010-06-14 15:19:19 27,546 debug headers & lt; - Content-Length: 64 2010-06-14 15: 19: 27,547 Debug Headers & lt; - Cash-Controll Ol: Revised 2010-06-14 15:19:19 27,548 Warning DefaultRequestDirector - Authentication Error: Unable to answer any of these challenges: {} 2010-06-14 15:19:19 27,548 DEBUG RESTClient - Answer Code: 401; Found Handler: org.codehaus.groovy.runtime.MethodClosure@e2e4d7 2010-06-14 15: 19: 27,549 DEBUG RESTClient - Parsing response in this form: text / plain 2010-06-14 15: 1 9: 27,549 Rebens Result - Parsed data, for example: class java.io.InputStreamReader 2010-06-14 15: 19: 27,550 DEBUG wire & lt; - "{" Error ":" Unauthorized "," Reason ":" You are not a server administrator. "} [\ N]"   

Any thoughts? You idiot Or bug on anybody (which? Couchdb or groovy?)

ps no proxy / firewall / NTLM or some fancy - all local hosts on Windows 7 (development env)

Username for PPS URL: Trying to host @ password @ quickly - that did not seem to work - the same error message.

  • Richard

OK, this CouchDB 0.11 Has found to be related to the change that closes the basic 401 certification header. Now I just need to turn on Pre-Authentication for RESTClient / HttpBuilder, like curls. Ref:


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -