Michal Šunka created NIFIREG-438:
------------------------------------

             Summary: Creating new buckets results in corrupted NiFi Registry 
SQL Database
                 Key: NIFIREG-438
                 URL: https://issues.apache.org/jira/browse/NIFIREG-438
             Project: NiFi Registry
          Issue Type: Bug
    Affects Versions: 0.8.0
            Reporter: Michal Šunka


Hello,

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:
{code:java}
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";{code}
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/|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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to