Sample Test Downloads, Team Accounts

Jaap Eldering jaap at
Thu Nov 9 23:27:59 CET 2017

Hi Marc,

On 09/11/17 17:05, Marc Furon wrote:
> Also, I am trying to import team accounts with passwords.  I used the
> format in the standards document, using the team names as the "Full
> Name".  I get this SQL error when doing the import:
> error: SQL error, Error#1452: Cannot add or update a child row: a
> foreign key constraint fails (`domjudge`.`user`, CONSTRAINT
> `user_ibfk_1` FOREIGN KEY (`teamid`) REFERENCES `team` (`teamid`) ON
> DELETE SET NULL), query: 'REPLACE INTO user SET `name` = "Big
> Ballers", `username` = "acm101", `password` =
> "$2y$10$ILEqS5X6w93RVQ/euA1UYeTKXseyUAK9efUnmMknnk5CPprWvCg/K",
> `teamid` = "acm101"'
> Here are the first few lines of the team account file:
> accounts	1
> team	Big Ballers	acm101	password1
> team	Brain Dead Simple	acm102	password2
> team	Kernel Sanders	acm103	password3
> The teams imported correctly and exist with the given names.

On a second look: the problem is that your account file is not quite up to spec, and we're arguably not very fault tolerant in parsing it. According to the specification [1] a team account should be of the form "team-nnn" where nnn is a number with leading zeros. Our code doesn't recognize "acm101". This can be "fixed" by editing this line:

Clearly, we have to think of a more flexible way of dealing with this and implement better error handling.



More information about the DOMjudge-devel mailing list