Question: ```
woman(lisa).
woman(maggie).

parents(lisa  , homer, marge).
parents(maggie, homer, marge).

sister(X, Y) :-
   X \= Y,
   woman(X),
   parents(X, P, M),
   parents(Y, P, M).

```

When I ran the following query, I *did not expect failure* (but got it nonetheless).

```
?- sister(lisa, X).
false.                         % expected result: X = maggie

```

Why am I seeing this behavior?

Answer: 
So my guess is after 10 seconds timeout your minecraft server is still running (according to docs it saves some data to disk and stuff) and when you try to run another instance it fails due to port still being used.

Try it like this:

```
serverSpawnProcess.stdin.write('stop\n');
serverSpawnProcess.on("close", function() {
    // Wait for process to exit, then run again

    serverSpawnProcess = spawn('java', [
        '-Xmx512M',
        '-Xms512M',
        '-jar',
        'server_files/minecraft_server.jar',
        'nogui'
    ]);
});

```

Also as <https://stackoverflow.com/users/1139700/ross> suggests, add a listener to error event so you know exactly what your problem is.

```
serverSpawnProcess.on("error", function(err) {
    // ugh, something went wrong
    console.log("Server error:", err);
});

```
```
  var serverSpawnProcess = spawn('java', [
    '-Xmx512M',
    '-Xms512M',
    '-jar',
    'server_files/minecraft_server.jar',
    'nogui'
  ]);

serverSpawnProcess.on('exit', function (code)
{
    console.log("exit here with code: ", code);
});
serverSpawnProcess.stdout.on('data', function (data) {
    console.log('stdout: ' + data);
});

serverSpawnProcess.stderr.on('data', function (data) {
    console.log('stderr: ' + data);
});

```