DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
712 stars 250 forks source link

Though restapi.secret has been set, the docker container of judgehost can't be run correctly. #2352

Closed HuParry closed 6 months ago

HuParry commented 6 months ago

NOTE: If this is a discussion starter, you need any installation help or have a question on how to accomplish something, rather post at our discussion channel or send an email to our DOMjudge-devel mailinglist instead of filing an issue here.

Description of the problem

The dockercontainer of judgehost can't be run correctly.

Your environment

Steps to reproduce

I use docker-compose way from the project domjudge-compose. Definitely I've succeeded in set up a domjudge in my previous server. So this way is a perfect way for me. But today I use another server to set up a domjudge. Both database and domserver are formal, but when run judgehost docker container there are any wrong message.

Expected behaviour

It should be successful.

Actual behaviour

Let's see what happened in judgehost container: image Error while executing curl POST to url http://domserver/api/v4/judgehosts: http status code: 404. I learned the same situation of others. They all said that restapi.secret don't be set correctly. But now I've set it as before.

Any other information that you want to share?

I'm a Chienese student, and not good in English. If someone can help me, I will appreciate it.

87ouo commented 6 months ago

As you can see this in your screenshot and description: http://domserver/api/v4/judgehosts It's not a valid API address, don't you think so? You should set this API address correctly with what address your domserver actually at, like http://192.168.0.220/api/v4/judgehosts. If your domserver is also a docker container, you should be careful with the port.

HuParry commented 6 months ago

Alright. Domserver was set up by docker, either.

How can I change the address? I never modify it before.

Dup4 commented 6 months ago

Perhaps you can set your domserver address by injecting the DOMSERVER_BASEURL Environment variables

HeRaNO commented 6 months ago

Maybe you can check the guide at domjudge/judgehost - Docker Image | Docker Hub, and set the Environment variables. These variables should also be set using docker-compose (w/o --link options).

HuParry commented 6 months ago

I got it. Thank you very much.