AtomGraph / LinkedDataHub

The low-code Knowledge Graph application platform. Apache license.
https://atomgraph.github.io/LinkedDataHub/
Apache License 2.0
485 stars 122 forks source link

Reaching 500 Internal Server Error with application startup after previous success #101

Closed sahith00 closed 3 years ago

sahith00 commented 3 years ago

I had previously requested help for starting up LinkedDataHub, and I managed to successfully run and interact with the application. However, I'm now reaching a HTTP Status 500 - Internal Server Error whenever I run the app. Error messages are pointing to various java files, but I'm not sure where and how to access these and find the cause of the error. Please let me know what I can do to fix the issue, thanks!

Error message:

HTTP Status 500 – Internal Server Error

namedgraph commented 3 years ago

Hi Sahith, sorry to hear that. Can you try executing docker image list and pasting any atomgraph/linkeddatahub-related lines? Most importantly the Image ID.

namedgraph commented 3 years ago

This shows that using the latest tag in docker-compose.yml is bad practice... Because we can't easily track image versions that users have installed. We actually tag each new image build with a source commit hash, but don't actually use those tags :/ I might need to make some changes to that tomorrow.

sahith00 commented 3 years ago

Hey, thanks for reaching out! I actually updated my fork with the original code, and 500 error is no longer showing up, so the bad practice causing the 500 error may have been fixed in previous commits to the code. Instead, I'm now reaching a 400 error. I didn't spend much time debugging this, so the fix may be pretty simple, sorry for asking you before taking a stab at it myself!

Here's the error message:

Screen Shot 2021-04-27 at 3 32 45 PM

Here's the result from running docker image list with the new code:

Screen Shot 2021-04-27 at 3 33 27 PM

Thank you for your help!

namedgraph commented 3 years ago

Since you've updated the code, first you also need to update the Docker images by doing:

docker-compose pull

Re. the WebID profile cannot be loaded -- have you reset the database at some point? By doing anything like:

sudo rm -rf data uploads && docker-compose down -v

In that case your SSL certificates are not loaded to the triplestore. Try this for startup:

docker-compose --force-recreate up

And if it still doesn't work then please copy and paste the Docker container log here. You can get it by doing:

docker-compose logs linkeddatahub
sahith00 commented 3 years ago

I updated the Docker images, and I ran docker-compose up, which recreated the linkeddatahub_linkeddatahub_1 container. I wasn't sure what you meant by "loaded in the triplestore", but I have reset the database in the past, so I wanted to try the force recreate command at first, but I wasn't able to run docker-compose --force-recreate up, possibly because the command doesn't exist. My SSL certificates are all still in my LinkedDataHub directory, though.

Screen Shot 2021-04-28 at 9 41 28 PM

After this, it still wasn't working, so I decided to get the Docker container logs. However, the container logs for me were extremely long (ended up being around 2600 lines). I created a Github Gist for it, so you should be able to find the logs by looking up sahith00/docker_container_logs.txt in the Github Gist search (I wasn't able to link it here, sorry).

I'm not sure where to go from here, or whether I should try restarting the setup process, so please let me know what next steps you think I should take.

Thanks!

namedgraph commented 3 years ago

Hi Sahith. The logs show:

### Uploading the metadata of the owner agent...

Meaning that a WebID agent based on your SSL certificate should be created.

My suspicion is that you are authenticating in the browser with an older/different version of the SSL certificate than you currently have in in the ssl/owner/keystore.p12. Could that be the case?

Which browser are you using? You need to close the browser in order to get a prompt that allows you to choose a new certificate. If that doesn't happen, you might need to purge your choice that the browser remembers. For example for Firefox, click Delete... for any localhost certs: image

namedgraph commented 3 years ago

@sahith00 have you resolve the issue?

sahith00 commented 3 years ago

Hi, thanks for reaching out! I deleted the existing certificate and re-imported the new certificate as you said, and I'm able to run the app again! Really appreciate all your help!

In the future, would I need to re-import the certificate whenever I update the source code from the main repo?

Thanks!

namedgraph commented 3 years ago

It shouldn't be necessary.

When you wipe your data folder however, the description for the certificate is gone. So you have to reload the datasets (which docker-compose up --force-recreate should do, but also happens after a new image is pulled) or otherwise you'll get the WebID profile cannot be loaded error.

Another situation where this can happen if you have changed the certificate in ssl/owner/keystore.p12 and loaded the datasets, but haven't changed the certificate in your browser.