Unique constraint failed on namespace name when registering clients using OIDC #333

Closed
opened 2025-12-29 01:27:09 +01:00 by adam · 3 comments
Owner

Originally created by @juanfont on GitHub (Sep 20, 2022).

When registering multiple clients at the same time using OIDC we might break the UNIQUE constraint on namespace name:

From oidc.go:

	namespace, err := h.GetNamespace(namespaceName)
	if errors.Is(err, ErrNamespaceNotFound) {
		namespace, err = h.CreateNamespace(namespaceName)

		if err != nil {
			log.Error().
				Err(err).
				Caller().
				Msgf("could not create new namespace '%s'", namespaceName)

I reckon this is a bit of a edge case in our integration tests, but seems to be there.

Originally created by @juanfont on GitHub (Sep 20, 2022). When registering multiple clients at the same time using OIDC we might break the UNIQUE constraint on namespace name: From `oidc.go`: ```go namespace, err := h.GetNamespace(namespaceName) if errors.Is(err, ErrNamespaceNotFound) { namespace, err = h.CreateNamespace(namespaceName) if err != nil { log.Error(). Err(err). Caller(). Msgf("could not create new namespace '%s'", namespaceName) ``` I reckon this is a bit of a edge case in our integration tests, but seems to be there.
adam added the stalebug labels 2025-12-29 01:27:09 +01:00
adam closed this issue 2025-12-29 01:27:09 +01:00
Author
Owner

@kradalby commented on GitHub (Apr 19, 2023):

Is this still relevant with the new integration tests?

@kradalby commented on GitHub (Apr 19, 2023): Is this still relevant with the new integration tests?
Author
Owner

@github-actions[bot] commented on GitHub (Oct 17, 2023):

This issue is stale because it has been open for 180 days with no activity.

@github-actions[bot] commented on GitHub (Oct 17, 2023): This issue is stale because it has been open for 180 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2023):

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions[bot] commented on GitHub (Nov 1, 2023): This issue was closed because it has been inactive for 14 days since being marked as stale.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#333