presentation-validator icon indicating copy to clipboard operation
presentation-validator copied to clipboard

local variable 'error' referenced before assignment

Open donaldgray opened this issue 3 years ago • 1 comments

I was attempting to validate a manifest using the website and wasn't getting results back (I got a 504/503 subsequently so think I may have crashed the ECS service - apologies).

I tried running the validator locally and was presented with the following error:

Presentation Validator bug: "local variable 'error' referenced before assignment". Please create a <a href="https://github.com/IIIF/presentation-validator/issues">Validator Issue, including a link to the manifest.

I've taken a copy of the manifest here (as I'm planning to update the source) - https://github.com/donaldgray/donaldgray/blob/master/iiif/id_issue.json

I tracked the issue down to the fact that the manifest is 3.0 with 2.0 image services. However, the thumbnails have "id" rather than "@id":

"service": [
{
    "id": "https://digitalcollections-api-dlcs.arts.ac.uk/thumbs/2/1/8924cc9c-bdc4-4256-9f7b-e9471308ab5d",
    "@type": "ImageService2",
    "profile": "http://iiif.io/api/image/2/level2.json",
    "sizes": [
    { "width": 1057, "height": 1500 },
    { "width": 423, "height": 600 },
    { "width": 211, "height": 300 },
    { "width": 70, "height": 100 }
    ]
}
]

changing this to "@id": "https://digitalcollections-api-dlcs.arts.ac.uk/thumbs/2/1/8924cc9c-bdc4-4256-9f7b-e9471308ab5d", caused the validator to succeed

donaldgray avatar Oct 07 '22 16:10 donaldgray

We also ran into this testing the Presentation API 3 update some Open Source with SLU Students @markskroba @tvay11 and @DrewSadler01 are working on.

Here is one those Manifest that gave us this error (it is on a GitHub Pages site that might go away, sorry if it does. I can update the link if it is important in the future)

https://thehabes.github.io/GeoreferencePrototype/prototypes/7312.json

thehabes avatar Feb 22 '23 19:02 thehabes