Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing uuid key on status endpoint (unsupported couchdb version?) #76

Open
giftig opened this issue May 25, 2018 · 3 comments
Open

Missing uuid key on status endpoint (unsupported couchdb version?) #76

giftig opened this issue May 25, 2018 · 3 comments

Comments

@giftig
Copy link

giftig commented May 25, 2018

I don't see a stated couchdb version supported for this library so I'm not sure if I'm simply using a version for which this library wasn't designed, but I just tried playing with it for the first time and got this exception:

upickle.Invalid$Data: Key Missing: uuid (data: Obj(ArrayBuffer((couchdb,Str(Welcome)), (version,Str(2.0.0)), (vendor,Obj(ArrayBuffer((name,Str(The Apache Software Foundation))))))))                                           
        at upickle.GeneratedUtil$class.mapToArray(GeneratedUtil.scala:45)                                       
        at upickle.default$.mapToArray(Api.scala:25)                                                            
        at upickle.Implicits$$anonfun$CaseR$1.applyOrElse(Implicits.scala:83)                                   
        at upickle.Implicits$$anonfun$CaseR$1.applyOrElse(Implicits.scala:82)                                   
        at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171)                                  
        at upickle.Implicits$Internal$$anon$1.apply(Implicits.scala:53)                                         
        at upickle.Implicits$Internal$$anon$1.apply(Implicits.scala:50)                                         
        at upickle.Types$Reader$$anonfun$read$1.applyOrElse(Types.scala:93)                                     
        ...

It's expecting a uuid field in the couchdb response, but the / endpoint on this version of couchdb isn't providing one. You can see the full details of the couchdb version in the stack trace there, but for easier reading:

$ curl -s localhost:5984 | python -mjson.tool
{
    "couchdb": "Welcome",
    "vendor": {
        "name": "The Apache Software Foundation"
    },
    "version": "2.0.0"
}
@giftig
Copy link
Author

giftig commented May 26, 2018

FWIW I've continued using the library against the same version of couchdb and so far found no issues, so it looks like the potentially absent uuid is a singular oversight.

@giftig
Copy link
Author

giftig commented Jan 27, 2019

@beloglazov Thanks for reminding me about this; I just saw your message from a couple of weeks ago on another issue I raised, and had a crack at addressing this one as it's the most straightforward. Unfortunately, it looks like your tests are quite tightly bound to wording in old versions of couchdb though, so while it was trivial to fix this, running the tests against the latest couchdb shows a lot of problems because of some changed error messages:

[info] User interface
[error]   x Get info about the DB instance
[error]    '-\/(upickle.Invalid$Data: Key Missing: uuid (data: {
[error]        "couchdb": "Welcome",
[error]        "version": "2.0.0",
[error]        "vendor": {
[error]            "name": "The Apache Software Foundation"
[error]        }
[error]    }))' is not \/- (CouchDbSpecification.scala:47)
[info] 
[error]   x Create and query 2 DBs
[error]    'Database does not exist.' is not equal to 'missing' [CouchDbSpec.scala:42]
[error]    'Database does not exist.' is not equal to 'missing' [CouchDbSpec.scala:42] (CouchDbSpec.scala:42)
[error] Actual:   Database does not exist.
[error] Expected: missing
[error] Failed: Total 86, Failed 27, Errors 0, Passed 59
[error] Failed tests:

I can submit a PR with my change, but since it's only useful for a version of couchdb where your tests are widely failing, I think that's a bigger problem. Largely the errors are to do with error messages changing, so I'd suggest you try to eliminate some of the dependence on precise wording (usually a good idea for any test to avoid relying on information aimed for humans to read), however it looks like some other API details may have changed, so the library probably needs an update in some areas beside this optional uuid thing:

[error]     x fail if one or more elements is missing a Rev
[error]      '-\/(upickle.Invalid$Data: Key Missing: offset (data: {
...

@giftig
Copy link
Author

giftig commented Jan 27, 2019

I've created #82 to track this separately so that it doesn't get confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant