protegeproject / webprotege

The webprotege code base
Other
627 stars 251 forks source link

issues running webprotege using docker image #692

Open nikokaoja opened 4 years ago

nikokaoja commented 4 years ago

Hi there,

I followed the instructions of running webprotege from a docker image, which is basically to create docker-compose.yml and exectute docker-compose up in terminal.

However, there are a few issues.

  1. Following errors are displayed while lunching the docker image:
webprotege_1  | 2020-06-21 07:15:45.501  INFO   Initializing WebProtege 
webprotege_1  | 2020-06-21 07:15:46.295  INFO   Loading webprotege.properties from the class path 
webprotege_1  | 2020-06-21 07:15:46.301  INFO   Overriding webprotege.mongodb.host with system property value: wpmongo 
webprotege_1  | 2020-06-21 07:15:46.316  INFO   No username has been supplied for the MongoDB client connection.  Authentication will not be used. 
webprotege_1  | 2020-06-21 07:15:46.324  INFO   Created MongoClient database connection without credentials for authentication 
webprotege_1  | 2020-06-21 07:15:46.856  INFO   Created MongoClient database connection 

and

webprotege_1  | 2020-06-21 07:16:08.452  WARN   System notification email address is not specified 
webprotege_1  | 2020-06-21 07:16:08.457  WARN   Application host is not specified 
webprotege_1  | 2020-06-21 07:16:08.458  WARN   Cannot construct well-formed application URL. (java.net.URISyntaxException: Expected hostname at index 8: https://:443) 
webprotege_1  | 2020-06-21 07:16:08.459  WARN   Cannot construct well-formed project URLs. (java.net.URISyntaxException: Expected hostname at index 8: https://:443#projects/3283960b-6a73-47c2-83b0-4943bb13d95d/edit/Classes) 
webprotege_1  | 2020-06-21 07:16:08.460  WARN   Cannot construct well-formed OWL Entity URLs. (java.net.URISyntaxException: Expected hostname at index 8: https://:443#projects/c7a3bc56-73aa-4cf4-abc0-aba3a63aa7d7/edit/Classes?selection=Class(owl:Thing)) 
  1. When I lunch http://localhost:5000/ in browser, an error is displayed WebProtégé is not configured properly
  2. Going to http://localhost:5000/webprotege#application/settings returns 404
  3. Listing the content of webprotege folder, folder logsdir_IS_UNDEFINED is present

Basically, are there any additional steps for configuring webprotege prior or once the docker image starts, such as how to create user accounts, etc?

For example, I am not sure when, how and where to run java -jar webprotege-cli.jar create-admin-account? When I use docker CLI to navigate through folders, I noticed that webprotege-cli.jar is locate in / folder. And if I try to run java -jar webprotege-cli.jar create-admin-account in / , while the docker image is active, after providing email address, user name and password I get the following message:

docker exec -it 2ac59512a7f36c0b0d6a2092a57921779f662ec2cd94c59e099f9102ad00f63b /bin/sh; exit
# cd /
# ls
bin   docker-java-home  lib    mnt   root  srv  usr
boot  etc       lib64  opt   run   sys  var
dev   home      media  proc  sbin  tmp  webprotege-cli.jar
# pwd
/
# java -jar webprotege-cli.jar create-admin-account
Please enter a user name for the administrator:
admin   
Please enter an email address for the administrator:
email@address.com
Please enter a password for the administrator account:

Please confirm the password:

Exception in thread "main" com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. Client view of cluster state is {type=UNKNOWN, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}]
    at com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:377)
    at com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:104)
    at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:75)
    at com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.<init>(ClusterBinding.java:71)
    at com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68)
    at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:411)
    at com.mongodb.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:168)
    at com.mongodb.operation.MixedBulkWriteOperation.execute(MixedBulkWriteOperation.java:74)
    at com.mongodb.Mongo.execute(Mongo.java:845)
    at com.mongodb.Mongo$2.execute(Mongo.java:828)
    at com.mongodb.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:550)
    at com.mongodb.MongoCollectionImpl.replaceOne(MongoCollectionImpl.java:369)
    at edu.stanford.bmir.protege.web.server.user.UserRecordRepository.save(UserRecordRepository.java:68)
    at edu.stanford.bmir.protege.web.server.cmdline.SetupTools.createAdministratorAccount(SetupTools.java:86)
    at edu.stanford.bmir.protege.web.server.cmdline.SetupTools.createAdministratorAccount(SetupTools.java:71)
    at edu.stanford.bmir.protege.web.server.cmdline.SetupTools.main(SetupTools.java:126)
    at edu.stanford.bmir.protege.web.server.cmdline.CreateAdminAccountCmd.run(CreateAdminAccountCmd.java:17)
    at edu.stanford.bmir.protege.web.server.cmdline.WebProtegeCli.run(WebProtegeCli.java:60)
    at edu.stanford.bmir.protege.web.server.cmdline.WebProtegeCli.main(WebProtegeCli.java:71)
# 
nikokaoja commented 4 years ago

@matthewhorridge it seems that there are additional steps once the docker image is running which are provided here: https://github.com/protegeproject/webprotege/wiki/WebProt%C3%A9g%C3%A9-Deployment-via-Docker

I think it would be great to actually add the link to the above instructions in your README.MD under Running from Docker section. This could save newbies, like myself, a lot of time :).

katsi commented 4 years ago

@niva83 +1 That part I had to dig out from somewhere else, so having it in README or at least a link to it would be great.

nikokaoja commented 4 years ago

@katsi indeed, I've spent about 3+ hours trying to figure out why docker does not work as it should be. As you said, I was digging through the Git repo and by chance found the above description which helped me to make the docker ver of webprotege to work. Some people are not as pesistent in trying to dig out information, so indeed, either fusing the info from the link to README or at least puttin a link for Additional steps to make docker to work would be of great help for anyone new to webprotege and docker.

katsi commented 4 years ago

Has anyone here deployed webprotege with kubernetes? I am currently trying to do that and I have trouble connecting the frontend with mongo

nikokaoja commented 4 years ago

@katsi I haven't, still working with dockers.

katsi commented 4 years ago

go it working, so if anyone needs help with that, am happy to share!

nikokaoja commented 4 years ago

@katsi I think it would be helpful, I hope someone from the repo maintainers will catch up with the information we are sharing here.

mmanela commented 4 years ago

@katsi Can you share? I am hitting an issue where the web front-end cant find mongodb even though I can connect from the same container use mongoshell

katsi commented 4 years ago

I am happy to share. Wondering what format would make sense? Should we have an informal webinar on the topic?

Katariina

On Thu 25. Jun 2020 at 22.30, Matthew Manela notifications@github.com wrote:

@katsi https://github.com/katsi Can you share? I am hitting an issue where the web front-end cant find mongodb even though I can connect from the same container use mongoshell

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/protegeproject/webprotege/issues/692#issuecomment-649801490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGTSXANEVM7KTZYXGGBM6DRYOXWLANCNFSM4ODXTZKQ .

nikokaoja commented 4 years ago

@katsi webinar would be great. Maybe to record it and share over Youtube?

katsi commented 4 years ago

@mmanela how do you notice that the webprotege front-end cannot find the MongoDB? I am wondering, if afterall I am hitting the same problem. After configuring the admin account, I still get the notification that Webprotege is not configured properly AND the frontend misses some components that would otherwise be there if I would start it with docker-compose.

But what do work are my admin credentials.

mmanela commented 4 years ago

I was actually able to run the jar command to create the admin account (which was able to connect to the mongodb). But when I went to the website it gave me the mongodb connection error mentioned above.

I was eventually able to resolve it by restarting the pods.

katsi commented 4 years ago

Two of my colleagues, one using Windows and the other Linux, reported a problem where the webprotege.mongodb.host=wpmongo was not stored when the contaienrs were launched. One solution here was to set the env with running the jar command, so like this: env "webprotege.mongodb.host=wpmongo" java -jar /webprotege-cli.jar create-admin-account

katsi commented 4 years ago

@niva83 What software could I use for that? Zoom, Google Meet, ..? Any recommendations? Never held a webinar before!

nikokaoja commented 4 years ago

@katsi I've been using all above. Probably Google Meet is the easiest to setup if you already have Google account.

nikokaoja commented 4 years ago

@johardi I noticed that you have updated readme.md with a better description on how to get webprotege to run from docker image. What is unclear is where and how to setup two files, namely webprotege.properties and mail.properties via docker image?

This question was originally posted as an issue #682 .

As it is now, if the instructions are followed for running webprotege as a docker image, the problem is that we are unable to reset password or get email notification since mail.properties are not set.

mikeandescavage commented 4 years ago

@katsi Do you have any cycles to briefly go over how you got webprotege running in a kubernetes cluster? How did you get around the initial admin account creation?

katsi commented 4 years ago

I did not even attempt to automate the initial admin account creation, but that to me is not a problem, because it only needs to be done once.

mmanela commented 4 years ago

I documented my steps here: https://matthewmanela.com/blog/deploying-webprotege-on-azure-kubernetes-service-aks/

katsi commented 4 years ago

Thanks for the write up! I am using our company's own CDP and Kubernetes system, so sharing it is not as helpful. Your example is overall the same that we did!

mikeandescavage commented 4 years ago

Thanks for the responses. Great writeup @mmanela and that helped greatly! Would love to contribute to allow automation for passing of the initial account creation from keyvault. Perhaps I can lend a hand there.