Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#549 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@Sarthak-Shreshtha01 ya está trabajando en esto.

Desde el 4/10/2026.

  • #571 de @Sarthak-Shreshtha01 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
go

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Go
Estrellas
58
Forks
72
Merge medio
1 d 7 h
PR fusionados (30 d)
22

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microcks/microcks-cli

Todos los issues de microcks/microcks-cli

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.