buda-base / lds-pdi

http://purl.bdrc.io BDRC Linked Data Server
Apache License 2.0
2 stars 0 forks source link

ontology webhook failing? #187

Closed xristy closed 4 years ago

xristy commented 4 years ago

the buda2:~/bin/db-load migration script includes at the end:

curl -H "Content-Type: application/json" -X POST "http://purl.bdrc.io/callbacks/github/owl-schema"

which is now failing like:

{"timestamp":"2020-06-19T16:34:05.047+0000","status":400,"error":"Bad Request","message":"Required request body is missing: public org.springframework.http.ResponseEntity<java.lang.String> io.bdrc.ldspdi.rest.controllers.PublicDataController.updateOntology(java.lang.String) throws io.bdrc.ldspdi.exceptions.RestException,java.io.IOException","path":"/callbacks/github/owl-schema"}

It last succeeded on 18 June

MarcAgate commented 4 years ago

Yes we are now parsing the github payload to get the actual commitId. The only way to update is to effectively commit and push to the repo.

xristy commented 4 years ago

So there is no longer any way to signal from the migrate script to refresh the ontology.

The buda2:~/bin/db-load currently ends with:

echo -e "\n\n====> TELL LDSPDI to reload ontology"
curl -H "Content-Type: application/json" -X POST "http://purl.bdrc.io/callbacks/github/owl-schema"
echo -e "\n====> CLEARING LDSPDI CACHES"
curl -X POST "http://purl.bdrc.io/clearcache"
echo -e "\n====> DONE"

Applicable, in particular, for the case in which the dataset is rebuilt.

Now what is the proper procedure in this case?

MarcAgate commented 4 years ago

How often the dataset is rebuilt? I think ldspdi is not running (or at least fails) while a new dataset is rebuilt, so restarting ldspdi should be enough to rebuild everything. We could write one more endpoint for this, but does this (quite rare) use case really justify it ? I remember restarting ldspdi a couple of times for rebuilding ontologySchema, so I don't think you've always been using this curl command. I even believe it's quite recent.

xristy commented 4 years ago

The dataset isn't rebuilt from scratch very often.

I really don't know the status of ldspdi when the dataset is rebuilt, but it seems reasonable that it might be down or failed.

So, no, I suppose a special endpoint is not very sensible especially if ldspdi is down or has failed since I suppose there'd be nothing to listen on the endpoint.

The curl has been in buda2:~/bin/db-load since last year but w/o the -H "Content-Type: application/json" since early on it was not needed. I only learned recently from you that the header was needed.

Geez, looks like I brought up a pretty stupid distraction. Sorry about that.