Closed matentzn closed 1 year ago
Exception: max one repo; current=('Matentzoglu', 'myont')
The odk.py
script is complaining it is receiving more than one argument.
That script is invoked through seed-via-docker.sh
like this:
docker run -e ODK_USER_ID=$(id -u) -e ODK_GROUP_ID=$(id -g) -v $PWD:/work -w /work --rm obolibrary/$ODK_IMAGE:$ODK_TAG /tools/odk.py seed --gitname "$ODK_GITNAME" --gitemail "$ODK_GITEMAIL" "$@"
The seed-via-docker.sh
script is itself invoked by make tests
like this:
test_no_yaml_dependencies_none:
$(CMD) $(EMAIL_ARGS) -c -t my-ontology1 myont
So in the end, the invocation should be:
docker run -e ODK_USER_ID=$(id -u) -e ODK_GROUP_ID=$(id -g) -v $PWD:/work -w /work --rm obolibrary/$ODK_IMAGE:$ODK_TAG /tools/odk.py seed --gitname "$ODK_GITNAME" --gitemail "$ODK_GITEMAIL" -c -t my-ontology1 myont
So myont
should be the only non-optional argument. So where does the Matentzoglu
argument come from?
The only beginning of an explanation I have is it must come from the ODK_GITNAME
variable, which is initialised in the seed-via-docker.sh
script as follows:
ODK_GITNAME=${ODK_GITNAME:-$(git config --get user.name)}
Most likely your Git username is set to “Nico Matentzoglu”? Then the invocation becomes:
docker run -e ODK_USER_ID=$(id -u) -e ODK_GROUP_ID=$(id -g) -v $PWD:/work -w /work --rm obolibrary/$ODK_IMAGE:$ODK_TAG /tools/odk.py seed --gitname "Nico Matentzoglu" --gitemail "$ODK_GITEMAIL" -c -t my-ontology1 myont
So it looks like as if somehow the quoting around the expansion of the ODK_GITNAME
variable was stripped, so that only Nico
is taken as the value of the --gitname
option and Matentzoglu
is interpreted as the first positional argument:
docker run -e ODK_USER_ID=$(id -u) -e ODK_GROUP_ID=$(id -g) -v $PWD:/work -w /work --rm obolibrary/$ODK_IMAGE:$ODK_TAG /tools/odk.py seed --gitname Nico Matentzoglu --gitemail "$ODK_GITEMAIL" -c -t my-ontology1 myont
But I have no idea how that could be happening. I can’t reproduce the issue here. My own Git username is, obviously enough, Damien Goutte-Gattat
, but it is always passed to the script as one argument only, as it should.
... Other than perhaps the fact that my server does not have any user management and only a root user..
I won’t even bother to ask you why. But I can reproduce the issue by setting ODK_USER_ID
to 0 in seed-via-docker.sh
(which is the value it would get when the script itself is called by the root user).
That’s because, while the entrypoint.sh
script does quote its argument when sudo-ing the command to execute inside the container in the normal case:
exec sudo -H -E -u odkuser "$@"
it does not do so when exec'ing the same command in the case it should run as root:
if [ x$ODK_USER_ID = x0 ]; then
exec $@
fi
@gouttegd THANKS a mil! Running tests now, but your explanations make total sense!
When running
make build tests
on Ubuntu as I have always done, I get the following error:This has always worked, and I don't have any indications of what could be wrong..
... Other than perhaps the fact that my server does not have any user management and only a root user..