Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Bug : When SSO login is started twice within the same running process, the CLI crashes with a panic

Offen
#549 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Sarthak-Shreshtha01 arbeitet bereits daran.

Seit 04.10.2026.

  • #571 von @Sarthak-Shreshtha01 — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go
Bereich
authentication, cli

Rechercherichtung

Start at the oauth2login entry point and inspect how it registers /auth/callback on Go’s global HTTP router. Reproduce the failure with the provided TestReproduceSSODuplicateCallbackPanic case, then verify that invoking SSO login twice returns normally without a duplicate-route panic and that the existing login flow still works.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

component/cli kind/bug
Describe the bug
When SSO login is started twice within the same running process, the CLI crashes with a panic:

This happens because oauth2login registers /auth/callback on Go’s global HTTP router every time it runs. The second registration causes Go to panic.

Image
Steps to reproduce:
  1. Start SSO login once.
  2. Start SSO login again in the same process.
  3. Observe the panic.

here is the Panic: `panic: pattern "/auth/callback" conflicts with pattern "/auth/callback"


The issue can be reproduced with:

package cmd

import (
    "context"
    "testing"
    "time"

    "golang.org/x/oauth2"
)

func TestReproduceSSODuplicateCallbackPanic(t *testing.T) {
    config := &oauth2.Config{
        Endpoint: oauth2.Endpoint{
            AuthURL:  "http://127.0.0.1",
            TokenURL: "http://127.0.0.1",
        },
    }

    go func() {
        _, _, _ = oauth2login(context.Background(), 0, config, false)
    }()

    time.Sleep(2 * time.Second)

    // The second invocation registers /auth/callback again and panics.
    _, _, _ = oauth2login(context.Background(), 0, config, false)
}
Expected behavior:
  • The second login should return a normal error or create its own temporary callback server.
Actual behavior:
  • The process crashes with a panic and stack trace.
Impact:
  • Applications, tests, or services that reuse the CLI cannot safely perform multiple SSO logins.
Suggested fix:
  • Use a private http.ServeMux for each login instead of the global http.DefaultServeMux..
Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

@Harsh4902
Please review and assign if valid

Vorherrschende Sprache
Go
Sterne
58
Forks
72
Ø Merge
1 T. 7 Std.
Gemergte PRs (30 T.)
22

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microcks/microcks-cli

Alle Issues in microcks/microcks-cli

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.