beeldengeluid / beng-lod-server

LOD server for B&G catalogue
MIT License
1 stars 1 forks source link

lod-importer receives http 500 for season item #307

Closed wmelder closed 1 year ago

wmelder commented 1 year ago

lod-importer log shows:

'2022-11-14 15:14:42,691|ERROR|42396|beng_lod_util|get_data_from_uri|42|HTTP error occurred: 500 Server Error: INTERNAL SERVER ERROR for url: https://data.beeldengeluid.nl/id/season/2101811100250094431'

curl shows resource is forbidden:

curl -v -L -H "Accept: application/ld+json" http://data.beeldengeluid.nl/id/season/2101810140249631831

the flex data store /storage api does provide an item:

http://prd-app-bng-01.beeldengeluid.nl:8101/storage/season/2101812250251768531

Via de OAI-PMH provider is het record op te halen:

https://flex-oai.beeldengeluid.nl/oai?verb=GetRecord&metadataPrefix=fe&identifier=oai:SEASON:2101810140249631831

But, first time I needed to log in with studio credentials.

wmelder commented 1 year ago

so, the lod_view is using the triple store. Apparently, the resource is not yet imported and therefor an http error was raised. So, this is intended behaviour for a resource that is not in the triple store.

The curl request returns a forbidden 403 rsponse, because the lod-server requires authentication... This way, resources that are not allowed to be published aren't. Given valid credentials this should work:

curl -v -L -H "Accept: application/ld+json" -u "user:password" http://data.beeldengeluid.nl/id/season/2101810140249631831

But, in fact, using proper credentials, it doesn't work. => Asked Martijn if the config is right for the current lod server. => Confimred that the credentials are loaded. Apparently, the error is 500, not 403. But not clear why and how this occurs.

wmelder commented 1 year ago

er moet meer logging in de lod-server, anders kunnen we niet zien waarom dingen fout gaan.

wmelder commented 1 year ago

nieuwe logging ingebouwd en draait op localhost... dit is het request:

curl -L -H "Accept: application/ld+json" --user user:passwd http://127.0.0.1:5000/id/season/2101812250251768531

En dan krijg je onderstaande logs:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='flexstore.beng.nl', port=1234): Max retries exceeded with url: /storage/season/2101812250251768531 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe8c349bb20>: Failed to establish a new connection: [Errno 110] Connection timed out'))
2022-11-15 13:45:19,744|ERROR|5966|StorageLODHandler|get_storage_record|56|Exception
Traceback (most recent call last):
  File "/home/wmelder/git/beng-lod-server/src/apis/resource/StorageLODHandler.py", line 42, in get_storage_record
    data = self._storage_2_lod(url, return_format, use_file_logger)
  File "/home/wmelder/git/beng-lod-server/src/apis/resource/StorageLODHandler.py", line 115, in _storage_2_lod
    assert isinstance(json_data, dict), "No valid results from the flex store."
AssertionError: No valid results from the flex store.
2022-11-15 13:45:19,745|DEBUG|5966|resource_api|_get_lod_resource|161|Something wrong with response from the flex data store: 500
127.0.0.1 - - [15/Nov/2022 13:45:19] "GET /id/season/2101812250251768531 HTTP/1.1" 500 -
2022-11-15 13:45:19,748|INFO|5966|_internal|_log|224|127.0.0.1 - - [15/Nov/2022 13:45:19] "GET /id/season/2101812250251768531 HTTP/1.1" 500 -
wmelder commented 1 year ago