[Gitea 1.16.0] Unable to find configuration file #287
Closed
opened 2022-02-01 09:05:39 +00:00 by viceice
·
21 comments
No Branch/Tag Specified
main
renovate/postgresql-ha-15.x
renovate/postgresql-16.x
renovate/redis-20.x
renovate/redis-cluster-11.x
fix-674
app-ini-recreation
fix-env-to-ini
clean-app-ini
gitea-ha
v10.6.0
v10.5.0
v10.4.1
v10.4.0
v10.3.0
v10.2.0
v10.1.4
v10.1.3
v10.1.2
v10.1.1
v10.1.0
v10.0.2
v10.0.1
v10.0.0
v9.6.1
v9.6.0
v9.5.1
v9.5.0
v9.4.0
v9.3.0
v9.2.1
v9.2.0
v9.1.0
v9.0.4
v9.0.3
v9.0.2
v9.0.1
v9.0.0
v8.3.0
v8.2.0
v8.1.0
v8.0.3
v8.0.2
v8.0.1
v8.0.0
v7.0.4
v7.0.3
v7.0.2
v7.0.1
v7.0.0
v6.0.5
v6.0.4
v6.0.3
v6.0.2
v6.0.1
v6.0.0
v5.0.9
v5.0.8
v5.0.7
v5.0.6
v5.0.5
v5.0.4
v5.0.3
v5.0.2
v5.0.1
v5.0.0
v4.1.1
v4.1.0
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.1.4
v3.1.3
v3.1.2
v3.1.1
v3.1.0
v3.0.0
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.11
v2.1.10
v2.1.9
v2.1.8
v2.1.7
v2.1.6
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.0
v1.5.5
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.9
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
Labels
Clear labels
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
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: lunny/helm-chart#287
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking 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
maybe 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 https://gitea.com/gitea/helm-chart/issues/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.