oar-team / oar-docker

Manage a small OAR developpement cluster with docker.
http://oar.imag.fr/wiki:oar-docker
6 stars 6 forks source link

webservice unreachable #53

Closed xy124 closed 5 years ago

xy124 commented 5 years ago

Hi! I executed

oardocker install git+https://github.com/oar-team/oar.git start -n 3 -v ~/workspace/melissa_parflow:/home/docker/melissa

giving me the log

...
  server | install -d `dirname /usr/local/sbin/oar_phoenix`
  server | install -m 0750 Makefiles/oardo/build/%usr%local%sbin%oar_phoenix /usr/local/sbin/oar_phoenix
  server | make[2]: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make[1]: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make: Entering directory '/tmp/install_oar.ZlLCOym2/src'
  server | make -s -f Makefiles/common.mk setup
  server | make[1]: Entering directory '/tmp/install_oar.ZlLCOym2/src'
  server | Adding group oar....done
  server | Adding system user oar....done
  server | make[1]: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make -s -f Makefiles/common-libs.mk setup
  server | make[1]: Entering directory '/tmp/install_oar.ZlLCOym2/src'
  server | make[1]: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make -s -f Makefiles/database.mk setup
  server | make[1]: Entering directory '/tmp/install_oar.ZlLCOym2/src'
  server | Currently, the oar database isn't setup automatically. Please install the database manually (using the /usr/local/sbin/oar-database script).
  server | make[1]: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make -s -f Makefiles/server.mk setup
  server | make[1]: Entering directory '/tmp/install_oar.ZlLCOym2/src'
  server | make[1]: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | make: Leaving directory '/tmp/install_oar.ZlLCOym2/src'
  server | Configure PostgreSQL to listen for remote connections
  server | Configure PostgreSQL to accept remote connections (from any host):
  server | Starting postgresql...
  server | Restarting PostgreSQL 9.6 database server: main.
  server | Waiting postgresql to be available...
  server | Set (insecure) postgres password
  server | ALTER ROLE
  server | Init database
  server | Creating the database user...
  server | CREATE ROLE
  server | Creating the database read-only user...
  server | CREATE ROLE
  server | Creating the database...
  server | CREATE DATABASE
  server | REVOKE
  server | GRANT
  server | GRANT
  server | Initializing database 'oar'...
  server | GRANT
  server | Stopping postgresql...
  server | Stopping PostgreSQL 9.6 database server: main.
  server | 2.5.8+rc8-3-g2f15913c
  server | OAR 2.5.8+rc8-3-g2f15913c (git branch 2.5)
Image oardocker/stretch-server:latest (sha256:226c0b89c1de2f93d77b3579ae4aa68a80c5678b7d92f3d137b0091c0b913a2e) --> Saved
Removing untagged images
Image <none>:<none> (sha256:e18a8f30b5a8ee869047e8e0bd430d412bb0f626d8997cf75221352d7c94469a) --> Removed
Image <none>:<none> (sha256:366875051729230e71735bd8dca02e5733029e703a381c2aaf1f7711dcb52531) --> Removed
Image <none>:<none> (sha256:a80937e84652e43a811fd5cb97c00828feb804e6ea0a280cdc7a943ca6aed4c0) --> Removed
Creating network "oardocker_373f96a1" with driver "bridge"
Container rsyslog --> Started
Container frontend --> Started
Container node1 --> Started
Container node2 --> Started
Container node3 --> Started
Container server --> Started

********************** Web Services ***********************

          Python API: http://localhost:46668/newoarapi
  Private Python API: http://localhost:46668/newoarapi-priv
            Perl API: http://localhost:46668/oarapi
    Private Perl API: http://localhost:46668/oarapi-priv
              Monika: http://localhost:40080/monika
           Drawgantt: http://localhost:40080/drawgantt-svg/
          PhpPgAdmin: http://localhost:40080/phppgadmin/

***********************************************************

but I cannot access the webservices e.g. http://localhost:40080/monika gives

This site can’t be reached
The webpage at http://localhost:40080/monika might be temporarily down or it may have moved permanently to a new web address.
ERR_SOCKET_NOT_CONNECTED

How to solve this? (I'm testing with git rev d7b93fd15ad87b67807a48c6971e3973bcc83540)

xy124 commented 5 years ago

just reexecuted

oardocker install git+https://github.com/oar-team/oar.git start -n 3 -v ~/workspace/melissa_parflow:/home/docker/melissa

this time I get to (http://localhost:40080/monika)

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Apache/2.4.25 (Debian) Server at localhost Port 40080

Seems that oar's postgres server did not start up correctly:

docker@server ~
$ systemctl status oardocker-postgresql.service
● oardocker-postgresql.service - PostgreSQL database server
   Loaded: loaded (/etc/systemd/system/oardocker-postgresql.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-11-14 14:08:46 UTC; 3s ago
  Process: 477 ExecStart=/usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf (code=exited, status=203/
 Main PID: 477 (code=exited, status=203/EXEC)

Nov 14 14:08:46 server systemd[1]: Started PostgreSQL database server.
Nov 14 14:08:46 server systemd[1]: oardocker-postgresql.service: Main process exited, code=exited, status=203/EXEC
Nov 14 14:08:46 server systemd[1]: oardocker-postgresql.service: Unit entered failed state.
Nov 14 14:08:46 server systemd[1]: oardocker-postgresql.service: Failed with result 'exit-code'.

How to fix this?

augu5te commented 5 years ago

The master branch is relatively outdated. We recommend to use the branch dev of oardocker and the debian stretch environment. Do you have used this set up ?

xy124 commented 5 years ago

yep I'm using strech and the dev branch. The oar-docker commit I'm using is 311a00828c8963d6fd85446290c34dfa79b78b03

xy124 commented 5 years ago

Ah I think I fixed it! on the server container in /etc/systemd/system/oardocker-postgresql.service the wrong postgresql version (9.4) was used! In my container the 9.6 was installed. so I had to change the line ExecStart=/usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main -c config_file=/etc/postgresql/9.4/main/postgresql.conf to ExecStart=/usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/postgresql.conf and then I executed

systemctl enable oardocker-postgresql.service
systemctl stop oardocker-postgresql.service
systemctl start oardocker-postgresql.service
systemctl status oardocker-postgresql.service
augu5te commented 5 years ago

Great, I'm preparing a fix. Thanks

augu5te commented 5 years ago

Fixed via 1954015