HIT2GAP-EU-PROJECT / bemserver

An open source Python server to deploy energy management solutions for buildings
http://bemserver.org
Other
37 stars 17 forks source link

urlopen error [Errno 99] Cannot assign requested address #3

Open arunkollan opened 5 years ago

arunkollan commented 5 years ago

Hi There, I am trying to run the REST request for services http://:8083/services/

and I get the following error

File "/bemserver/database/ontology/manager.py", line 144, in _query
bemserver      |     raise SPARQLError(exc)
bemserver      | bemserver.database.ontology.exceptions.SPARQLError: <urlopen error [Errno 99] Cannot assign requested address>

I have set

ONTOLOGY_BASE_URL = 'http://<ipaddress>:3030/bemserver/'

in my default_api_settings.py

it appears the address is not resolved properly thanks for your help.

Arun

pbourreau commented 5 years ago

I am trying to reproduce the problem but cannot do it for the moment. I can see two sources for this issue: 1- Jena/Fuseki is not running: can you check through '$ docker ps'? 2- The 'bemserver' dataset was not created. You can check that running the Fuseki UI (http://localhost:3030/), and checking the datasets created. I just modified the INSTALL file to mention that the Fuseki docker needs to be restarted after copying the bemserver.ttl file in the fuseki docker.

arunkollan commented 5 years ago

I checked i find the containers are up

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
7e17d3a706ff        bemserver:latest    "bash -c 'source bem…"   32 hours ago        Up 20 hours         0.0.0.0:8033->8033/tcp   bemserver
8b3f6f2a51d9        stain/jena-fuseki   "/docker-entrypoint.…"   33 hours ago        Up 33 hours         0.0.0.0:3030->3030/tcp   fuseki

I have created docker-compose file and a docker file to create the containers. All you need to do is update the .flaskenv file with these entries. ( not that you don't know :) ) You also need to load the RDF models via the jena web UI

Archive.zip

I tried to access

http://<ipaddress>:8033/occupants/knowledge_levels/

and works without throwing up any error

Thanks for your contribution.

pbourreau commented 5 years ago

I changed the INSTALL.md and the configuration file for the dataset (bemserver.ttl). You can try to: 1- copy the bemont.rules file in the fuseki docker image: $ docker cp PATH/TO/BEMONT/models/bemont.rules fuseki-data:/fuseki/configuration/ 2- copy the bemserver_ttl file: $ docker cp PATH/TO/bemserver/docs/deployment/data_model/bemserver_tdb.ttl fuseki-data:/fuseki/configuration/ 3- restart the docker image: $ docker restart fuseki

arunkollan commented 5 years ago

Sorry I forgot to add the bemserver_ttl and the bemont.rules file in my archive. Yes I did what you recommended and the error persists if I try out in a containarised bemserver. This error is not found if I dont install bemserver in a container. There might be some security feature which might cause this issue. I will try digging deep and will let you know. Thank you so much for your help. Much appreciated for your contribution.

pbourreau commented 5 years ago

Hi, sorry for the delay, but now we built up our docker containers, can you check that it works with these containers? There may be some version problems with the docker containers used... just a guess, I might be wrong.