Fabric CA unable to register user "attempt to write a readonly database" #fabricca #fabric-ca #fabric-questions #fabric


Mattia Bolzonella
 

Hi, I'm trying to register a user via Fabric Java SDK but I get the error: "Registration of 'UserToRegister' failed: Error adding identity 'UserToRegister' to the database: attempt to write a readonly database".

To register the user I'm using the certificates of an organization admin previously registerd and enrolled on the same CA. 
The registration was made using the following command (sensible infos are replaced with variables):

fabric-ca-client register -d --id.name Admin@$DOMAIN --id.secret $ADMINPSW --id.type admin --id.attrs "hf.Registrar.Roles=client,hf.Registrar.Attributes=*,hf.Revoker=true,hf.GenCRL=true,admin=true:ecert,abac.init=true:ecert" -u https://ca.$DOMAIN:$CAPORT

And enrolled with:
fabric-ca-client enroll -d -u https://Admin@$DOMAIN:$ADMINPSW@ca.$DOMAIN:$CAPORT

I'm trying to register users with client roles, ad looking at the register command I understand that the Admin@$Domain user can do so, but when I try I get the error above:
Registration of 'UserToRegister' failed: Error adding identity 'UserToRegister' to the database: attempt to write a readonly database

What I'm missing?