Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Error: [Errno 111] Connection refused #42

Closed
cjsoft opened this issue May 11, 2016 · 12 comments
Closed

System Error: [Errno 111] Connection refused #42

cjsoft opened this issue May 11, 2016 · 12 comments

Comments

@cjsoft
Copy link

cjsoft commented May 11, 2016

和之前那个issue不太一样...

我这里是判题服务器和web端在同一个主机上

root@oj-Junyi-A410:/home/OnlineJudge/dockerfiles/judger# docker inspect d0ca0b419d29
[{
    "AppArmorProfile": "",
    "Args": [
        "-c",
        "bash /var/judger/code/dockerfiles/judger/run.sh"
    ],
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "/bin/sh",
            "-c",
            "bash /var/judger/code/dockerfiles/judger/run.sh"
        ],
        "CpuShares": 0,
        "Cpuset": "",
        "Domainname": "",
        "Entrypoint": null,
        "Env": [
            "rpc_token=c4318372f98f4c46ed3a32c16ee4d7a76c832886d887631c0294b3314f34edf1",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "DEBIAN_FRONTEND=noninteractive"
        ],
        "ExposedPorts": {
            "8080/tcp": {}
        },
        "Hostname": "d0ca0b419d29",
        "Image": "qduoj/judger",
        "Labels": {
            "com.docker.compose.config-hash": "05431ef649584f2808acf17d5762c37d4154294a737e300bd8765b01386cb5a5",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "judger",
            "com.docker.compose.service": "judger",
            "com.docker.compose.version": "1.7.1"
        },
        "MacAddress": "",
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkDisabled": false,
        "OnBuild": null,
        "OpenStdin": false,
        "PortSpecs": null,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": {
            "/var/judger/code": {},
            "/var/judger/code/judge/log": {},
            "/var/judger/test_case": {}
        },
        "WorkingDir": "/var/judger/code/judge"
    },
    "Created": "2016-05-12T09:50:13.039379025Z",
    "Driver": "aufs",
    "ExecDriver": "native-0.2",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": [
            "/home/OnlineJudge:/var/judger/code:rw",
            "/home/log:/var/judger/code/judge/log:rw",
            "/home/test_case:/var/judger/test_case:rw"
        ],
        "CapAdd": null,
        "CapDrop": null,
        "CgroupParent": "",
        "ContainerIDFile": "",
        "CpuShares": 0,
        "CpusetCpus": "",
        "Devices": null,
        "Dns": null,
        "DnsSearch": null,
        "ExtraHosts": null,
        "IpcMode": "",
        "Links": null,
        "LogConfig": {
            "Config": null,
            "Type": "json-file"
        },
        "LxcConf": null,
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkMode": "",
        "PidMode": "",
        "PortBindings": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "8085"
                }
            ]
        },
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": ""
        },
        "SecurityOpt": null,
        "Ulimits": null,
        "VolumesFrom": []
    },
    "HostnamePath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/hostname",
    "HostsPath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/hosts",
    "Id": "d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a",
    "Image": "f84e5f70479f4856c844838540cd3e4e4ca198e1c6a3f3bf13fb79b12f33e924",
    "LogPath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a-json.log",
    "MountLabel": "",
    "Name": "/judger_judger_1",
    "NetworkSettings": {
        "Bridge": "docker0",
        "Gateway": "172.17.42.1",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "172.17.0.8",
        "IPPrefixLen": 16,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "fe80::42:acff:fe11:8",
        "LinkLocalIPv6PrefixLen": 64,
        "MacAddress": "02:42:ac:11:00:08",
        "PortMapping": null,
        "Ports": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "8085"
                }
            ]
        }
    },
    "Path": "/bin/sh",
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "0001-01-01T00:00:00Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 4131,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2016-05-12T09:50:13.345216836Z"
    },
    "Volumes": {
        "/var/judger/code": "/home/OnlineJudge",
        "/var/judger/code/judge/log": "/home/log",
        "/var/judger/test_case": "/home/test_case"
    },
    "VolumesRW": {
        "/var/judger/code": true,
        "/var/judger/code/judge/log": true,
        "/var/judger/test_case": true
    }
}
]

http://r5.loli.io/RjYZRz.png: http://r5.loli.io/RjYZRz.png

@virusdefender
Copy link
Contributor

你在服务器上,curl http://172.17.0.8看下什么输出啊,应该是一个502。

@cjsoft
Copy link
Author

cjsoft commented May 11, 2016

oj@oj-Junyi-A410:~$ curl http://172.17.0.1
curl: (52) Empty reply from server

重启之后docker inspect看到ip变成了.0.1

root@oj-Junyi-A410:/home/oj# docker inspect d0ca0b419d29
[{
    "AppArmorProfile": "",
    "Args": [
        "-c",
        "bash /var/judger/code/dockerfiles/judger/run.sh"
    ],
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "/bin/sh",
            "-c",
            "bash /var/judger/code/dockerfiles/judger/run.sh"
        ],
        "CpuShares": 0,
        "Cpuset": "",
        "Domainname": "",
        "Entrypoint": null,
        "Env": [
            "rpc_token=c4318372f98f4c46ed3a32c16ee4d7a76c832886d887631c0294b3314f34edf1",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "DEBIAN_FRONTEND=noninteractive"
        ],
        "ExposedPorts": {
            "8080/tcp": {}
        },
        "Hostname": "d0ca0b419d29",
        "Image": "qduoj/judger",
        "Labels": {
            "com.docker.compose.config-hash": "05431ef649584f2808acf17d5762c37d4154294a737e300bd8765b01386cb5a5",
            "com.docker.compose.container-number": "1",
            "com.docker.compose.oneoff": "False",
            "com.docker.compose.project": "judger",
            "com.docker.compose.service": "judger",
            "com.docker.compose.version": "1.7.1"
        },
        "MacAddress": "",
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkDisabled": false,
        "OnBuild": null,
        "OpenStdin": false,
        "PortSpecs": null,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": {
            "/var/judger/code": {},
            "/var/judger/code/judge/log": {},
            "/var/judger/test_case": {}
        },
        "WorkingDir": "/var/judger/code/judge"
    },
    "Created": "2016-05-12T09:50:13.039379025Z",
    "Driver": "aufs",
    "ExecDriver": "native-0.2",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": [
            "/home/OnlineJudge:/var/judger/code:rw",
            "/home/log:/var/judger/code/judge/log:rw",
            "/home/test_case:/var/judger/test_case:rw"
        ],
        "CapAdd": null,
        "CapDrop": null,
        "CgroupParent": "",
        "ContainerIDFile": "",
        "CpuShares": 0,
        "CpusetCpus": "",
        "Devices": null,
        "Dns": null,
        "DnsSearch": null,
        "ExtraHosts": null,
        "IpcMode": "",
        "Links": null,
        "LogConfig": {
            "Config": null,
            "Type": "json-file"
        },
        "LxcConf": null,
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkMode": "",
        "PidMode": "",
        "PortBindings": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "8085"
                }
            ]
        },
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": ""
        },
        "SecurityOpt": null,
        "Ulimits": null,
        "VolumesFrom": []
    },
    "HostnamePath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/hostname",
    "HostsPath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/hosts",
    "Id": "d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a",
    "Image": "f84e5f70479f4856c844838540cd3e4e4ca198e1c6a3f3bf13fb79b12f33e924",
    "LogPath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a-json.log",
    "MountLabel": "",
    "Name": "/judger_judger_1",
    "NetworkSettings": {
        "Bridge": "docker0",
        "Gateway": "172.17.42.1",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "172.17.0.1",
        "IPPrefixLen": 16,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "fe80::42:acff:fe11:1",
        "LinkLocalIPv6PrefixLen": 64,
        "MacAddress": "02:42:ac:11:00:01",
        "PortMapping": null,
        "Ports": {
            "8080/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "8085"
                }
            ]
        }
    },
    "Path": "/bin/sh",
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/d0ca0b419d293d76217fd2a456dbdbbd1971a9ff520cd37841d892ae21a7f80a/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Dead": false,
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "2016-05-12T23:25:08.084334507Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 2697,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2016-05-12T23:36:03.703235134Z"
    },
    "Volumes": {
        "/var/judger/code": "/home/OnlineJudge",
        "/var/judger/code/judge/log": "/home/log",
        "/var/judger/test_case": "/home/test_case"
    },
    "VolumesRW": {
        "/var/judger/code": true,
        "/var/judger/code/judge/log": true,
        "/var/judger/test_case": true
    }
}
]

@cjsoft
Copy link
Author

cjsoft commented May 11, 2016

以及好像不能删除判题服务器?

@virusdefender
Copy link
Contributor

  • docker的机制造成的问题,如果使用静态ip会很麻烦,这个如果判题服务器ip变了,手动的编辑一下吧。我也看下看下有没有别的方案。
  • 数据库里面的东西基本上都不能删除,涉及到外键的关联和加锁的问题,处理起来有点麻烦。

感谢支持。

@Ir1d
Copy link

Ir1d commented May 12, 2016

啊……不是
我是说换成了.0.1之后还是不好使……
交题之后是 connection refused

@virusdefender
Copy link
Contributor

curl 172.17.0.1:8085看看什么输出

@virusdefender virusdefender reopened this May 12, 2016
@cjsoft
Copy link
Author

cjsoft commented May 12, 2016

oj@oj-Junyi-A410:~$ curl http://172.17.0.1:8085
curl: (7) Failed to connect to 192.168.0.201 port 808: Connection timed out

oj@oj-Junyi-A410:~$ curl 172.17.0.1:8085
curl: (52) Empty reply from server

@virusdefender
Copy link
Contributor

我觉像是你容器里面的进程挂了,要不看下日志?

@cjsoft
Copy link
Author

cjsoft commented May 12, 2016

查到问题了
connection refused 的原因是language.py改的时候改多了一个括号
之后变成了System Error: timed out 是因为token出了问题……
您没写token的长度限制……我就直接sha256sum出来了一个用上了……gg

@cjsoft cjsoft closed this as completed May 12, 2016
@cjsoft
Copy link
Author

cjsoft commented May 12, 2016

其实主要是没找到log……后来进入judger的容器里发现log就在眼皮底下= =

@virusdefender
Copy link
Contributor

token不对为什么会导致timeout啊

@cjsoft
Copy link
Author

cjsoft commented May 12, 2016

不知道......

bnc1010 pushed a commit to bnc1010/OnlineJudge that referenced this issue Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants