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

503 error using a specific user context #1162

Closed
EliottPaillard opened this issue May 16, 2024 · 1 comment
Closed

503 error using a specific user context #1162

EliottPaillard opened this issue May 16, 2024 · 1 comment

Comments

@EliottPaillard
Copy link

Hello,

Using any of the last Stellio version, when creating an entity with as @context :

[
"https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
]

Stellio returns a 503 error and I don't know why.

Please may you help me?

@bobeal
Copy link
Member

bobeal commented May 17, 2024

Hi @EliottPaillard,

Indeed, as per the JSON-LD specification, a remote JSON-LD context must be served with an appropriate content type (see point 6 in https://www.w3.org/TR/json-ld11-api/#loaddocumentcallback: Otherwise, the retrieved document's [Content-Type](https://tools.ietf.org/html/rfc2045#section-5) is neither application/json, application/ld+json, nor any other media type using a +json suffix as defined in [[RFC6839](https://www.w3.org/TR/json-ld11-api/#bib-rfc6839)]. Reject the promise passing a [loading document failed](https://www.w3.org/TR/json-ld11-api/#dom-jsonlderrorcode-loading-document-failed) error.).

As the JSON-LD processor used by Stellio is quite strict with the specification, https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld is rejected because it is served as text/plain. Other context brokers are more lenient on this...

This is why we are using a JSON-LD context served on GitHub Pages when running the test suite with Stellio (see https://github.com/stellio-hub/ngsi-ld-test-suite/commit/7fe19ac9f01bcb64e65b5cde624aba4a0a68b771 for instance).

PS: avoid using https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld as it is a very old context (before version 1.3 of the specification) and many NGSI-LD features will not work with it. For the current state of test suite, you can for instance use https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld.

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

2 participants