Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8828

Creating new buckets results in corrupted NiFi Registry SQL Database



    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • NiFi Registry
    • None
    • Important



      I made some quite common web-based thing - I clicked twice the button for creating a new bucket inside NiFi Registry Web-GUI. The GUI responded with some tiny red message but it was gone way too soon and NiFi Registry (and versioning in NiFi too) seemed to work okay so I forgot about it and moved on.

      A few days later my colleague was working with GITLab side of things and complained to me that no changes at all are written to GIT from NiFi, even when NiFi and NiFi Registry talks to each other with ease (new buckets are seen in NiFi, versioning submenu works without problem).

      After a bit of digging around in a NiFi Registry logs it surfaced that issue is:

      ERROR [NiFi Registry Web Server-20] o.a.n.r.web.mapper.ThrowableMapper An unexpected error has occurred: org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO BUCKET (ID, NAME, DESCRIPTION, CREATED, ALLOW_EXTENSION_BUNDLE_REDEPLOY, ALLOW_PUBLIC_READ) VALUES (?, ?, ?, ?, ?, ?)]; Unique index or primary key violation: "PUBLIC.UNIQUE__BUCKET_NAME_INDEX_3 ON PUBLIC.BUCKET(NAME) VALUES 3";

      Only then I remembered the issue with second click for creating the same bucket. Moreover since this error happened, all commit history since that moment was lost because we are running it in Docker container (https://michalklempa.com/2019/03/nifi-registry-in-docker-with-git-flow/).

      I suppose that quite simple and convenient resolution would be to disable second clicking until previous click is resolved. Also blocking creation of second same-named bucket would be nice. And indicaton of process underway (first creation takes noticeably more time) would be a really nice touch


      Thank you for your consideration of this.




            Unassigned Unassigned
            RaoCZ Michal Šunka
            1 Vote for this issue
            1 Start watching this issue