git admin add-oauth --group-team-map-removal fails #13313

Open
opened 2025-11-02 10:38:18 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @angelnu on GitHub (Jul 21, 2024).

Description

When using the group-team-map-removal: true in the gitea helm chart values, gitea fails to boot:

Output from the configure-giteainit container:

No oauth configuration found with name 'kvant'. Installing it now...
Command error: auth source is not activated

which comes from 2a762f0865/templates/gitea/init.yaml (L218)

If I remove group-team-map-removal and boot once without it, then it works. Afterwards I can add it again and the command git admin update-oauth happily accepts it, even if the docs do not list it as valid argument.

This is the relevant part of the helm chart values.

gitea:
    admin:
        password: ydZeProh_driAR54mVFfRg
    oauth:
      - name: "kvant"
        provider: "openidConnect"
        ...
        group-team-map-removal: true

So I think there are 2 bugs:

  • the documentation is missing to list group-team-map-removal as valid option for git admin update-oauth
  • somehow group-team-map-removal does not work the first time - I found the error msg at https://github.com/go-gitea/gitea/blob/35c5192b2572041f14a4d33cbd0128da887b360e/services/auth/source/oauth2/providers.go#L165 but I have not debugged gothProviders to see why it does not like it.

Gitea Version

gitea/gitea:1.22.0-rootless

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

gitea/gitea:1.22.0-rootless Docker container

Operating System

Kubernetes (OpenShift)

How are you running Gitea?

Kubernetes, using the official gitea Helm chart 10.2.0

Database

PostgreSQL

Originally created by @angelnu on GitHub (Jul 21, 2024). ### Description When using the `group-team-map-removal: true` in the gitea helm chart values, gitea fails to boot: Output from the `configure-gitea`init container: ``` No oauth configuration found with name 'kvant'. Installing it now... Command error: auth source is not activated ``` which comes from https://gitea.com/gitea/helm-chart/src/commit/2a762f0865b69e8e95d5b7c91b1e758b44f23ee6/templates/gitea/init.yaml#L218 If I remove `group-team-map-removal` and boot once without it, then it works. Afterwards I can add it again and the command `git admin update-oauth` happily accepts it, even if the [docs](https://docs.gitea.com/next/administration/command-line#admin) do not list it as valid argument. This is the relevant part of the helm chart values. ```yaml gitea: admin: password: ydZeProh_driAR54mVFfRg oauth: - name: "kvant" provider: "openidConnect" ... group-team-map-removal: true ``` So I think there are 2 bugs: - the documentation is missing to list `group-team-map-removal` as valid option for `git admin update-oauth` - somehow `group-team-map-removal` does not work the first time - I found the error msg at `https://github.com/go-gitea/gitea/blob/35c5192b2572041f14a4d33cbd0128da887b360e/services/auth/source/oauth2/providers.go#L165` but I have not debugged gothProviders to see why it does not like it. ### Gitea Version gitea/gitea:1.22.0-rootless ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots <img width="965" alt="image" src="https://github.com/user-attachments/assets/40ba1d2e-014c-47d7-bf7e-2c6f2f6a138b"> ### Git Version gitea/gitea:1.22.0-rootless Docker container ### Operating System Kubernetes (OpenShift) ### How are you running Gitea? Kubernetes, using the official gitea Helm chart `10.2.0` ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 10:38:18 -06:00
Author
Owner

@lunny commented on GitHub (Aug 14, 2024):

Can you please also send a PR to https://gitea.com/gitea/helm-chart? I don't know it's a bug of helm chart to Gitea itself.

@lunny commented on GitHub (Aug 14, 2024): Can you please also send a PR to https://gitea.com/gitea/helm-chart? I don't know it's a bug of helm chart to Gitea itself.
Author
Owner

@sunziping2016 commented on GitHub (Aug 16, 2025):

Hey, I encountered the same issue. I found the chart didn't work well for boolean flags. You can see from the link below how the helm chart composes CLI flags. It just turns each pair of key into kebab-case, prefixes it with -- and quote the value. However, boolean flags should not have "value".

14a4e47b73/templates/_helpers.tpl (L208-L212)

To confirm the issue, I further inspected the script generated by the helm chart using the following command.

kubectl get secrets -n gitea gitea-init -o yaml | yq '.data."configure_gitea.sh"' | base64 -d

It output

...
  gitea admin auth add-oauth ... --group-team-map-removal "true" ...
...

The "true" argument should be removed

@sunziping2016 commented on GitHub (Aug 16, 2025): Hey, I encountered the same issue. I found the chart didn't work well for boolean flags. You can see from the link below how the helm chart composes CLI flags. It just turns each pair of key into kebab-case, prefixes it with `--` and quote the value. However, boolean flags should not have "value". https://gitea.com/gitea/helm-gitea/src/commit/14a4e47b73b9ec785a6d670635dc640fd3766c06/templates/_helpers.tpl#L208-L212 To confirm the issue, I further inspected the script generated by the helm chart using the following command. ```shell kubectl get secrets -n gitea gitea-init -o yaml | yq '.data."configure_gitea.sh"' | base64 -d ``` It output ``` ... gitea admin auth add-oauth ... --group-team-map-removal "true" ... ... ``` The `"true"` argument should be removed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13313