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

STAC validator does not run as expected

Open thomasstorm opened this issue 3 years ago • 8 comments

Hi,

I'd like to test the STAC validator on my backend, but cannot get it running on my system: miniconda Python 3.10.4 on Windows 10 64bit.

After installing the package using pip install stac-validator I tried to run the executable: stac-validator -v stac-collections.out, which led to the error:

Please upgrade from version  to version 1.0.0!

[
    {
        "version": "",
        "path": "stac-collections.out",
        "schema": [
            ""
        ],
        "valid_stac": false,
        "error_type": "KeyError",
        "error_message": "'stac_version'"
    }
]

I think there's something wrong internally, so I haven't attached stac-collections.out, but can do so if you want me to.

Running from within the python CLI leads to a similar error:

>>> from stac_validator import stac_validator
>>> url = 'https://geodb.openeo.dev.brockmann-consult.de/collections'
>>> stac = stac_validator.StacValidate(url)
>>> stac.run()
False
>>> print(stac.message)
[{'version': '', 'path': 'https://geodb.openeo.dev.brockmann-consult.de/collections', 'schema': [''], 'valid_stac': False, 'error_type': 'KeyError', 'error_message': "'stac_version'"}]

thomasstorm avatar Jul 22 '22 15:07 thomasstorm

Hi @thomasstorm Can I see your file if it's not too long? The error may be saying that you have not specified a stac version. It's not recognizing your file as an item or a collection either I think?

jonhealy1 avatar Jul 26 '22 08:07 jonhealy1

Sure, it's attached. Note that I had to rename it to .txt so I could upload it. stac-collections.txt

thomasstorm avatar Jul 26 '22 10:07 thomasstorm

Hi you have to take this part out {"collections":

Your file should start like this: {"stac_version": "0.9.0",

jonhealy1 avatar Jul 26 '22 10:07 jonhealy1

Here's an example https://github.com/stac-utils/stac-examples/blob/main/landsat8/LC81530252014153LGN00.json

This one is a collection https://github.com/radiantearth/stac-spec/blob/master/examples/collection.json

jonhealy1 avatar Jul 26 '22 10:07 jonhealy1

Hi you have to take this part out {"collections":

Your file should start like this: {"stac_version": "0.9.0",

That's interesting! I was following the directions of openEO, who state that their specification is compatible with STAC API 0.9.0. So that piece of information is wrong, I guess, and they mean they are compatible with v1.0.0 instead?

My result seems to be compatible with STAC 1.0.0: https://api.stacspec.org/v1.0.0-rc.1/collections/#tag/Collections

thomasstorm avatar Jul 26 '22 10:07 thomasstorm

What you are looking at is an api response which is different than normal STAC format.

jonhealy1 avatar Jul 27 '22 10:07 jonhealy1

Ok - sorry about that, I was not aware that there are differences. In any case, the error message is not helpful -- it insinuates that I should upgrade the stac validator, and does not really tell me what's wrong.

thomasstorm avatar Jul 28 '22 10:07 thomasstorm

It could be better yes. I guess the first thing it looks for is a stac version because it needs to look up the right schema to test against.

jonhealy1 avatar Jul 28 '22 13:07 jonhealy1

#220 is pretty much asking for what is missing here.

m-mohr avatar Aug 10 '23 10:08 m-mohr