Multiple replicas error when cron.GIT_GC_REPOS
is defined
#488
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?
Hi,
Tried to use replicaCount: 3 in the helm chart, but i am getting the following error:
Helm upgrade failed: template: gitea/templates/gitea/deployment.yaml:29:28: executing "gitea/templates/gitea/deployment.yaml" at <include │
│ (print $.Template.BasePath "/gitea/config.yaml") .>: error calling include: template: gitea/templates/gitea/config.yaml:28:16: executing "gitea/templates/gitea/config.yaml" at <.Values.gitea.config │
│ .cron.GIT_GC_REPOS>: nil pointer evaluating interface {}.GIT_GC_REPOS
That was the only change in the helm values. Worked fine with replicaCount: 1.
Any clue?
Thanks.
In
35fcb41ce2/templates/gitea/config.yaml (L28-L30)
we check whether the value exists and require it befalse
.Do you have something set for this value? I don't really see why the template would error but I guess your answer might reveal possible required actions.
For a short-term fix you can delete the setting from your
app.ini
.@pat-s i have no setting defined for cron, this is the config section i use:
I see the following getting auto-added to
app.ini
I can replicate your issue. I think it's because
GIT_GC_REPOS
is a map and the template is checking for a single value definition. Will check for a fix. Thanks for reporting!@pat-s Tried to upgrade today, the only changed values:
are chart version to 9.2.1 and image to 1.20.3 and replicaCount: 3
Please delete any existing
cron
entries inapp.ini
- there might be some due to the previous upscaling attempts which do not get removed automatically.@pat-s the container got recreated automatically when updating, there was no persistent data other than the data stored in postgresql cluster
@ovisan
Careful with this. The app.ini must be persistent. Otherwise, some data won't be accessible anymore. Some settings in app.ini must stay the same once created.
What confuses me is the syntax that is generated. Isn't this the syntax for cron-related configurations?
4803766f7a/custom/conf/app.example.ini (L2175)
(similar for other settings). Have I missed a major change in the app.ini design?@justusbunsi There is nothing cron related in the app.ini, but by having more than one replicaCount it will trigger the error from above. The app.ini is not persisted because it lives in the gitea container and it is generated each time the helm chart is being deployed.
Contents of app.ini
gitea-57b4c7fbb7-4n5vh:/# cat /data/gitea/conf/app.ini
I think I got confused by the comment from pat-s. (https://gitea.com/gitea/helm-chart/issues/488#issuecomment-747888) 🙂
I am aware and know which settings are persistet atm. This is also the tricky part in solving this issue in general 🙂 I haven't got enough time to wrap my head around a good solution yet.
I was also unsure myself but it seems that most config sections now use the "X.Y" notation as the section name. This is somewhat an issue with how helm treats a "X.Y" notation, i.e. it usually nests these values unless they are quoted or treated with the
get()
function in helm templates. Which is what initially caused the error reported here.@pat-s @justusbunsi should this be reopened or moved into a separate bug?
@pat-s @justusbunsi https://github.com/go-gitea/gitea/issues/26821#issuecomment-1699020365 maybe related
I wouldn't say this is an issue of the helm chart but in the end how
env-to-ini
parses helm config values. I am also not sure if this is an issue or desired behavior and actually a user error.It would be nice if
env-to-ini
would be able to account for this.Example:
The following values notation
is translated into
instead of
because
env-to-ini
doesn't convert nested sections into the section header but into a subsequentmap
.On the user end, the following works
https://github.com/go-gitea/gitea/issues/26838