stg-tud / MUBench

Other
54 stars 30 forks source link

Ensure review-site database file is created on first startup #445

Closed oneturkmen closed 4 years ago

oneturkmen commented 4 years ago

When I run reviewsite start and go to localhost:8080, at the first request I get an empty page, but then the server stops for some reason.

Steps to reproduce:

  1. Run the docker image. This should run a container with the MuBench Docker image.
  2. Start a review site with reviewsite start
  3. Open localhost:8080 on the browser (e.g., Firefox). This returns an empty page.
  4. Reload localhost:8080 page. This returns "Connection Reset".
  5. Run an experiment, e.g., pipeline publish ex2 MuDetect --only thomas-s-b-visualee -s http://localhost:8080 -u ... -p ...

and (5) will throw PublishFindingsTask exception:

[ERROR ] Exception in PublishFindingsTask: Failed to establish a new connection: [Errno 111] Connection refused

P.S. After step (3), if you try to stop the server with reviewsite stop, it says that no process was killed:

mubench> reviewsite stop Stopping MUBench review site... killall: php: no process killed

salsolatragus commented 4 years ago

Do you have any error output from the review site? The error in (5) only tells me that the server is unavailable at that point... It seems the site crashes in (3), because the page should not be empty. Maybe there's something broken in the database setup... but that's just guesswork 🤔

oneturkmen commented 4 years ago

It seems that just running reviewsite start does not redirect any logs, nor running in non-blocking mode with redirections (it just throws one line saying "Segmentation Fault") does the job. So after in the blocking way (without 2>&1 &), I get:

image

Typed:

0 /mubench/mubench.reviewsite/vendor/illuminate/database/Connectors/ConnectionFactory.php(183): Illuminate\Database\Connectors\SQLiteConnector->connect(Array)

1 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()

2 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(913): call_user_func(Object(Closure))

3 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(938): Illuminate\Database\Connection->getPdo()

4 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(399): Illuminate\Database\Connection->getReadPdo()

5 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(325): Illuminate\Database\Connection->getPdoForSelect(true)

6 /mubench/mubench.reviewsite/vendor in /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php on line 664

\ [Wed May 13 02:32:48 2020] 172.17.0.1:34794 [500]: / - Uncaught InvalidArgumentException: Database (/mubench/mubench.reviewsite/../findings/reviews.sqlite) does not exist. in /mubench/mubench.reviewsite/vendor/illuminate/database/Connectors/SQLiteConnector.php:34 Stack trace:

0 /mubench/mubench.reviewsite/vendor/illuminate/database/Connectors/ConnectionFactory.php(183): Illuminate\Database\Connectors\SQLiteConnector->connect(Array)

1 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors{closure}()

2 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(913): call_user_func(Object(Closure))

3 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(938): Illuminate\Database\Connection->getPdo()

4 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(399): Illuminate\Database\Connection->getReadPdo()

5 /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php(325): Illuminate\Database\Connection->getPdoForSelect(true)

6 /mubench/mubench.reviewsite/vendor in /mubench/mubench.reviewsite/vendor/illuminate/database/Connection.php on line 664

salsolatragus commented 4 years ago

Thanks for the details. Could you try running touch /mubench/mubench.reviewsite/../findings/reviews.sqlite before reviewsite start and see whether the problem persists?

oneturkmen commented 4 years ago

It worked. Thanks a lot!

salsolatragus commented 4 years ago

Thanks for trying it out! Now, at least, we know what the problem is and how to work around it. I'll try to come up with a fix.

salsolatragus commented 4 years ago

Indeed, the culprit is that the database file we create in the Docker and the database file we configure for the review site in the Docker differ... Fix should be to make them the same.

salsolatragus commented 4 years ago

Will release an update to the docker image asap.

salsolatragus commented 4 years ago

Just tested and released the fix to svamann/mubench:stable: https://hub.docker.com/r/svamann/mubench/tags