Skip to content

Container not starting using #385

Description

@bastien-snk

Hey, i have a problem with starting containers, sometimes it displays me this error, here is an example of the JSON that is sent to Docker Engine API to create the container. The creation is always successful, but startup isn't. But it doesn't happen only for this container. Char 80 corresponds to a random char in the JSON. It tells me each times char 80.

try {
    Container container = DockerManager.getInstance().getDocker().containers().get(containerName);
    if(container == null) return;
    container.start();
} catch (IOException e) {
    e.printStackTrace();
}
{
  "Image": "itzg/minecraft-server:java8",
  "AutoRemove": true,
  "Domainname": "test-lobby",
  "Env": [
    "TYPE\u003dCUSTOM",
    "CUSTOM_SERVER\u003d/data/server.jar",
    "EULA\u003dTRUE",
    "SERVER_NAME\u003dtest-lobby"
  ],
  "HostConfig": {
    "PortBindings": {
      "25565/tcp": [
        {
          "HostPort": "62207"
        }
      ]
    },
    "Mounts": [
      {
        "Target": "/data",
        "Source": "C:\\Users\\basti\\Documents\\GitHub\\TestDocker\\src\\main\\resources\\modules\\lobby\\server",
        "Type": "bind",
        "ReadOnly": false
      }
    ]
  },
  "Tty": true,
  "OpenStdin": true,
  "Volumes": {}
}

Exception in thread "main" javax.json.stream.JsonParsingException: Unexpected char 80 at (line no=1, column no=1, offset=0)
at org.glassfish.json.JsonTokenizer.unexpectedChar(JsonTokenizer.java:532)
at org.glassfish.json.JsonTokenizer.nextToken(JsonTokenizer.java:415)
at org.glassfish.json.JsonParserImpl$NoneContext.getNextEvent(JsonParserImpl.java:222)
at org.glassfish.json.JsonParserImpl$StateIterator.next(JsonParserImpl.java:172)
at org.glassfish.json.JsonParserImpl.next(JsonParserImpl.java:149)
at org.glassfish.json.JsonReaderImpl.readObject(JsonReaderImpl.java:101)
at com.amihaiemil.docker.PayloadOf.lambda$new$1(PayloadOf.java:81)
at com.amihaiemil.docker.JsonResource.(JsonResource.java:64)
at com.amihaiemil.docker.PayloadOf.(PayloadOf.java:77)
at com.amihaiemil.docker.MatchStatus.handleResponse(MatchStatus.java:95)
at com.amihaiemil.docker.MatchStatus.handleResponse(MatchStatus.java:43)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:223)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:165)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:140)
at com.amihaiemil.docker.HttpClientEnvelope.execute(HttpClientEnvelope.java:103)
at com.amihaiemil.docker.RtContainer.start(RtContainer.java:93)
at dev.lyramc.seedplant.modules.lobby.LobbyInstance.start(LobbyInstance.java:50)
at dev.lyramc.seedplant.managers.docker.DockerManager.load(DockerManager.java:40)
at dev.lyramc.seedplant.managers.Manager.initManagers(Manager.java:21)
at dev.lyramc.seedplant.SeedPlant.(SeedPlant.java:18)
at dev.lyramc.seedplant.Main.main(Main.java:6)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions