[Gitea 1.16.0] Unable to find configuration file #287
Labels
No Label
has
backport
in progress
invalid
kind
breaking
kind
bug
kind
build
kind
dependency
kind
deployment
kind
docs
kind
enhancement
kind
feature
kind
lint
kind
proposal
kind
question
kind
refactor
kind
security
kind
testing
kind
translation
kind
ui
need
backport
priority
critical
priority
low
priority
maybe
priority
medium
reviewed
duplicate
reviewed
invalid
reviewed
wontfix
skip-changelog
status
blocked
status
needs-feedback
status
needs-reviews
status
wip
upstream
gitea
upstream
other
No Milestone
No Assignees
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/helm-chart#287
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Can't currently upgrade to gitea v1.16. Getting the following errors on
configure-gitea
container:Looks like
GITEA_APP_INI
is no longer used and we need to explicit pass it to the cli via-c ${GITEA_APP_INI}
?OK, looks like i need to first update to chart version v5, currently using latest v4
Nope, same issue with chart v5.0.1
[1.16.0] Unable to find configuration fileto [Gitea 1.16.0] Unable to find configuration filemaybe also fixes this https://github.com/go-gitea/gitea/pull/18524
You can try 1.16.1 now.
With 1.16.1, the env var is used, but the configure-gitea container can't find the app.ini file while in 1.15.10 it would find it.
Will have a look at this today.
Need more time to investigate this. I wasn't even able to run a simple "gitea serv" inside the containers (rootful/rootless) when not using the entrypoint of the container.
The problem is related to the code below in
/usr/local/bin/gitea
:https://github.com/go-gitea/gitea/blob/main/docker/rootless/usr/local/bin/gitea#L35
The thing is that $CONF_ARG in the bottom line is expanded into
-c '"/data/gitea/conf/app.ini"'
(extra single quotes). Not sure whybash
is doing this.As a workaround I added
export PATH=/app/gitea/:$PATH
to the top ofconfigure_gitea.sh
file. This waygitea
there will run/app/gitea/gitea
instead of/usr/local/bin/gitea
.It's related with https://github.com/go-gitea/gitea/pull/17846 . @zeripath
Well it's more related to https://github.com/go-gitea/gitea/pull/18524 and related to the way the helm chart is passing in the variable.
(In some ways I'm slightly confused as to why that was needed in the first place because the
docker-entrypoint.sh
actually sets the-c ${GITEA_APP_INI}
correctly so it should not have been needed if people were going through thedocker-entrypoint.sh
)Not running the helm chart myself - I cannot begin to understand how or why the variable is ending up being double escaped. Nor can I test or change the script to make it work or print out what variable it is being sent. I am almost convinced that the problem has to be that helm chart is pre-quoting the environment variable - but I don't know enough to say that that is the case.
My suspicion comes from
docker run -e GITEA_APP_INI="/etc/gitea/app-special.ini" gitea/gitea:1.16-dev-rootless
does exactly the right thing.Whereas,
docker run -e GITEA_APP_INI="\"/etc/gitea/app-special.ini\"" gitea/gitea:1.16-dev-rootless
replicates the problem.The only thing I can think is that the helm chart is deliberately putting these quotes in and passing them to bash.
One option is to remove the
\"
from the shim?But tbh
docker-entrypoint.sh
anddocker-setup.sh
should be changed to be quoting their use of${GITEA_APP_INI}
too.From what I've seen, there's no problem with helm chart setting the GITEA_APP_INI env var.
here's the minimal sample to demonstrate the extra single quotes added by bash:
results into:
It works because
docker-entrypoint.sh
passes the-c <ini_path>
into/usr/local/bin/gitea
and the latter doesn't hit the faulty branch.The thing is that
init
containers in helm chart override the entrypoint from Dockerfile (docker-entrypoint.sh
) with init/config scripts and/usr/local/bin/gitea
has to deduce the config filepath on it's own (from GITEA_APP_INI env var).shellcheck
reports an error for line 35 in/usr/local/bin/gitea
I think it might be related to the problem.
https://github.com/go-gitea/gitea/blob/main/docker/rootless/usr/local/bin/gitea#L35
aha...
I've replicated it by just using the command line.
OK that at least means I can fix the damned problem.
fixes the problem
https://github.com/go-gitea/gitea/pull/18690
Can confirm that the current 1.16-dev(-rootless) image works again.
FWIW I also face troubles on a fresh install using chart v5.0.0 and
but I am not sure, it might be a different error.
I am almost running the vanilla chart, with only changes to
ingress
andconfig.database
which should not have an effect on theapp.ini
location.EDIT: Probably related to a different issue, see #296.
Yes, it works with
1.16-dev
?Just to add it works but it fails SSH authentication via public key even when SSH key is
Verified
in gitea. Not sure if this is related to this bug. No issue when root-mode is used.