AKSW / OntoWiki

Semantic data wiki as well as Linked Data publishing engine
https://ontowiki.net
204 stars 51 forks source link

ODBC problem with Docker setup with Virtuoso 7.2.6 and virtodbc.so #442

Closed KonradHoeffner closed 3 years ago

KonradHoeffner commented 3 years ago

We have a docker-compose setup including OntoWiki but our outdated tenforce/virtuoso:1.2.0-virtuoso7.2.4 was crashing all the time, so we updated it to the more up to date openlink/virtuoso-opensource-7:7 (right now pointing to version 7.2.6).

While the Virtuoso SPARQL endpoint now runs again, hopefully more stable than before, this seems to have killed our included OntoWiki docker container. I'm a Docker beginner so I'm sorry if that is the wrong information, I'm happy to supply more. The docker-compose.yml is given below.

Strangely, docker-compose logs ontowiki does not show any errors:

ontowiki_1         | OntoWiki is ready to set sail!
ontowiki_1         |             ___        _     __        ___ _    _ 
ontowiki_1         |            / _ \ _ __ | |_ __\ \      / (_) | _(_)
ontowiki_1         |           | | | | '_ \| __/ _ \ \ /\ / /| | |/ / |     .
ontowiki_1         |           | |_| | | | | || (_) \ V  V / | |   <| |    ==
ontowiki_1         |            \___/|_| |_|\__\___/ \_/\_/  |_|_|\_\_|   ===
ontowiki_1         |            /"""""""""""""""""""""""""""""""""""""\___/ ===
ontowiki_1         |       ~~~ {~~ ~~~~ ~~~ ~~~~~ ~~~~ ~~~ ~~~~~ ~~~~ ~~ ~ /  ===- ~~~
ontowiki_1         |            \______ o                               __/
ontowiki_1         |              \    \                             __/
ontowiki_1         |               \____\___________________________/
ontowiki_1         | 
ontowiki_1         | following log:

And docker-compose logs phpserver does not help much either (the problem occurred the last time after 14:00):

# docker-compose logs phpserver
Attaching to sniktoolset_phpserver_1
phpserver_1        | [22-Jun-2021 12:00:20] NOTICE: fpm is running, pid 1
phpserver_1        | [22-Jun-2021 12:00:20] NOTICE: ready to handle connections
phpserver_1        | [22-Jun-2021 12:00:20] NOTICE: systemd monitor interval set to 10000ms
phpserver_1        | [22-Jun-2021 12:47:00] NOTICE: Terminating ...
phpserver_1        | [22-Jun-2021 12:47:00] NOTICE: exiting, bye-bye!
phpserver_1        | [22-Jun-2021 12:47:02] NOTICE: fpm is running, pid 1
phpserver_1        | [22-Jun-2021 12:47:02] NOTICE: ready to handle connections
phpserver_1        | [22-Jun-2021 12:47:02] NOTICE: systemd monitor interval set to 10000ms
phpserver_1        | 172.23.11.5 -  22/Jun/2021:12:53:07 +0000 "GET /ontowiki/index.php" 500

So it seems like the log files are not linked to the docker logs.

Anyways, one of the problems was, that virtodbc.so seems to not be included in the new Virtuoso version, so I copied the one of the other version (hoping they are compatible) and the only way to see the logs of the resulting problems is to go into the PHP container via docker exec -it sniktoolset_phpserver_1 /bin/bash and then cat /var/www/html/logs/ontowiki.log shows:

2021-06-22T14:53:08+02:00 EMERG (0): Erfurt_Store_Adapter_Exception: Unable to connect to Virtuoso Universal Server via ODBC: 
odbc_connect(): SQL error: [unixODBC][OpenLink][Virtuoso iODBC Driver]CL034: Bad login, SQL state 28000 in SQLConnect -> /var/www/html/vendor/aksw/erfurt/library/Erfurt/Store/Adapter/Virtuoso.php@290

However I didn't change any login data, only increased the virtuoso version and kept the virtuoso.db so all the login data should be the same, so I'm not sure how to fix this.

This is probably a too complicated situation to fix quickly but maybe I as a Docker newbie missed something obvious here that you can see at a glance.

docker-compose.yml

version: '2'

services:

# Virtuoso:
#   Access via http://<hostname>:8080
#   Access vio iSQL://localhost:1111
  virtuoso:
    image: openlink/virtuoso-opensource-7:7
    #image: tenforce/virtuoso:1.2.0-virtuoso7.2.4
    environment:
      DBA_PASSWORD: 'password here'
      SPARQL_UPDATE: 'true'
      #DEFAULT_GRAPH: 'http://www.snik.eu/ontology'
      VIRT_DefaultGraph: 'http://www.snik.eu/ontology'
    volumes:
      - virtuoso-lib:/usr/local/virtuoso-opensource/lib
      - virtuoso-data:/data
      - virtuoso-database:/database
    ports:
      - "8080:8890"
      - "127.0.0.1:1111:1111"
    restart: always

# OntoWiki/phpserver
  phpserver:
    image: aksw/php-5.6-fpm-odbc-virtuoso
    #build: ./phpserver
    environment:
      #DBA_PASSWORD: 'DBA'
      SPARQL_UPDATE: "true"
    volumes_from:
      - ontowiki
      - virtuoso
    volumes:
      - ./config.ini:/var/www/html/config.ini
      #  - virtuoso-data:/usr/local/virtuoso-opensource/lib
    links:
      - virtuoso
    restart: always

# OntoWiki/nginx
#   Access via http://<hostname>:8085/ontowiki
  nginx:
    #image: aksw/nginx-ontowiki
    build: ./nginx
    volumes_from:
      #- ontowiki
      - phpserver
    #volumes:
    #  - ./nginx.conf:/etc/nginx/nginx.conf
    #  - nmdr_virtuoso-data:/usr/local/virtuoso-opensource/lib
    links:
      - phpserver
    ports:
      #- "127.0.0.1:8085:80"
      - "8085:80"
    restart: always

# OntoWiki/ontowiki
  ontowiki:
    #image: aksw/ontowiki
    build: ./ontowiki
    #environment:
      #DBA_PASSWORD: dba
      #SPARQL_UPDATE: "true" 
    volumes:
    #  - nmdr_virtuoso-data:/usr/local/virtuoso-opensource/lib
      - /var/www/html
    links:
      - virtuoso

 LodView
#   Access via http://<hostname>:8889
  lodview:
    build: ./lodview
    ports:
      - "8889:8080"
    links:
      - virtuoso
    restart: always

# TripleCheckMate
#   Access via http://<hostname>:8888
  triplecheckmate:
    build: ./TripleCheckMate
    ports:
      - "8888:8080"
    links:
      - virtuoso
    restart: always

networks:
  default:
    ipam:
      driver: default
      config:
         - subnet: 172.23.11.0/24
           ip_range: 172.23.11.0/24
           gateway: 172.23.11.254

volumes:
  virtuoso-lib:
  virtuoso-data:
  virtuoso-database:
KonradHoeffner commented 3 years ago

Issue can be closed, it seems like it wasn't a Virtuoso problem after all. The docker pull seems to have overwritten the config.ini from the OntoWiki so that the password needed to be set again.