[GH-ISSUE #2937] Blueprint apply: UNIQUE constraint failed: certificates.domain #23563

Open
opened 2026-06-05 06:26:18 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @xMikux on GitHub (Apr 30, 2026).
Original GitHub issue: https://github.com/fosrl/pangolin/issues/2937

Originally assigned to: @oschwartz10612 on GitHub.

Describe the Bug

Applying a blueprint via Newt fails when the new resource falls under an existing wildcard certificate.

blueprint yaml

public-resources:
  resource-nice-id-uno:
    name: this is my resource
    protocol: http
    full-domain: never-gonna-give-you-up.web.domain.com
    targets:
      - site: lively-yosemite-toad
        hostname: localhost
        method: http
        port: 8000

and pop out error:

Blueprint applied with errors: SqliteError: UNIQUE constraint failed: certificates.domain

Environment

  • OS Type & Version: Ubuntu 24.04
  • Pangolin Version: v1.18.1
  • Gerbil Version: 1.3.1
  • Traefik Version: v3.6
  • Newt Version: v1.12.3

To Reproduce

  1. Set up a wildcard domain (e.g. *.web.domain.com) — not using Traefik auto-generated per-domain cert.
  2. In the dashboard, open Blueprints and add a blueprint with a resource whose full-domain falls under that wildcard, e.g.:
    public-resources:
      resource-nice-id-uno:
        name: this is my resource
        protocol: http
        full-domain: never-gonna-give-you-up.web.domain.com
        targets:
          - site: lively-yosemite-toad
            hostname: localhost
            method: http
            port: 8000
    
  3. Apply -> fails with SqliteError: UNIQUE constraint failed: certificates.domain.

Expected Behavior

Should be applied normally.

Originally created by @xMikux on GitHub (Apr 30, 2026). Original GitHub issue: https://github.com/fosrl/pangolin/issues/2937 Originally assigned to: @oschwartz10612 on GitHub. ### Describe the Bug Applying a blueprint via Newt fails when the new resource falls under an existing wildcard certificate. blueprint yaml ```yaml public-resources: resource-nice-id-uno: name: this is my resource protocol: http full-domain: never-gonna-give-you-up.web.domain.com targets: - site: lively-yosemite-toad hostname: localhost method: http port: 8000 ``` and pop out error: ``` Blueprint applied with errors: SqliteError: UNIQUE constraint failed: certificates.domain ``` ### Environment - OS Type & Version: Ubuntu 24.04 - Pangolin Version: v1.18.1 - Gerbil Version: 1.3.1 - Traefik Version: v3.6 - Newt Version: v1.12.3 ### To Reproduce 1. Set up a wildcard domain (e.g. `*.web.domain.com`) — not using Traefik auto-generated per-domain cert. 2. In the dashboard, open **Blueprints** and add a blueprint with a resource whose `full-domain` falls under that wildcard, e.g.: ```yaml public-resources: resource-nice-id-uno: name: this is my resource protocol: http full-domain: never-gonna-give-you-up.web.domain.com targets: - site: lively-yosemite-toad hostname: localhost method: http port: 8000 ``` 3. Apply -> fails with SqliteError: UNIQUE constraint failed: certificates.domain. ### Expected Behavior Should be applied normally.
GiteaMirror added the bug label 2026-06-05 06:26:19 -05:00
Author
Owner

@AstralDestiny commented on GitHub (Apr 30, 2026):

sqlite3 config/db/db.sqlite

delete from certificates;

Fixes some 1.18 stuff, Try again afterwards.

<!-- gh-comment-id:4349065151 --> @AstralDestiny commented on GitHub (Apr 30, 2026): sqlite3 config/db/db.sqlite > delete from certificates; Fixes some 1.18 stuff, Try again afterwards.
Author
Owner

@xMikux commented on GitHub (Apr 30, 2026):

After deleting, the issue still persists.

<!-- gh-comment-id:4350450879 --> @xMikux commented on GitHub (Apr 30, 2026): After deleting, the issue still persists.
Author
Owner

@xMikux commented on GitHub (Apr 30, 2026):

Image
<!-- gh-comment-id:4350492461 --> @xMikux commented on GitHub (Apr 30, 2026): <img width="705" height="543" alt="Image" src="https://github.com/user-attachments/assets/f4c0d1d4-a1d7-4eb6-83c9-63642a777e97" />
Author
Owner

@oschwartz10612 commented on GitHub (Apr 30, 2026):

@xMikux would you be able to do the following? It will help me figure out what is up here.

$ sqlite3 config/db/db.sqlite "select domain,domainId,wildcard,status from certificates;"
<!-- gh-comment-id:4355000753 --> @oschwartz10612 commented on GitHub (Apr 30, 2026): @xMikux would you be able to do the following? It will help me figure out what is up here. ``` $ sqlite3 config/db/db.sqlite "select domain,domainId,wildcard,status from certificates;" ```
Author
Owner

@xMikux commented on GitHub (May 1, 2026):

/app # sqlite3 config/db/db.sqlite "select domain,domainId,wildcard,status from certificates;"
*.domain.com|domain1|1|valid
*.web.domain.com|ov1e75i14fwsq5y|1|valid
<!-- gh-comment-id:4357825603 --> @xMikux commented on GitHub (May 1, 2026): ```sh /app # sqlite3 config/db/db.sqlite "select domain,domainId,wildcard,status from certificates;" *.domain.com|domain1|1|valid *.web.domain.com|ov1e75i14fwsq5y|1|valid ```
Author
Owner

@xMikux commented on GitHub (May 1, 2026):

I also do some test, apply succeeds for resources under *.domain.com, but fails for resources under *.web.domain.com.

Image Image
<!-- gh-comment-id:4357880442 --> @xMikux commented on GitHub (May 1, 2026): I also do some test, apply succeeds for resources under `*.domain.com`, but fails for resources under `*.web.domain.com`. <img width="664" height="417" alt="Image" src="https://github.com/user-attachments/assets/e980dcae-4113-48c0-b57d-2496c2d85154" /> <img width="670" height="444" alt="Image" src="https://github.com/user-attachments/assets/33758190-7c9c-4ebd-be6b-3adebc0802f4" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/pangolin#23563