Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Not able to delete 1 Role from Inactive host

SOLVED Go to solution
Highlighted

Not able to delete 1 Role from Inactive host

New Contributor

Hi,

 

One of our VMs crashed and we are trying to remove it from the Cluster. We have been able to remove all the assigned Roles except 1 i.e. HDFS NFS Gateway. 

 

While removing this role, we are getting below mentioned error :

 

Caused by: org.postgresql.util.PSQLException:ERROR: update or delete on table "roles" violates foreign key constraint "fk_config_role" on table "configs" Detail: Key (role_id)=(110) is still referenced from table "configs".
at QueryExecutorImpl.java line 2102
in org.postgresql.core.v3.QueryExecutorImpl receiveErrorResponse()

 

Kindly suggest.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Not able to delete 1 Role from Inactive host

New Contributor

I was able to find the solution. Below are steps -

 

1. Run this command on SCM and retrieve the password- cat /etc/cloudera-scm-server/db.properties 

    Output - 

    com.cloudera.cmf.db.type=postgresql
    com.cloudera.cmf.db.host=localhost:7432
    com.cloudera.cmf.db.name=scm
    com.cloudera.cmf.db.user=scm
    com.cloudera.cmf.db.password=PASSWORD

 

2. Run another command - psql -U scm -p 7432 -h localhost -d scm

    This will open the interface to run Sql query

 

3. Run sql query specific to your needs e.g. delete from configs where role_id = 110

 

Hope this helps.

2 REPLIES 2

Re: Not able to delete 1 Role from Inactive host

New Contributor

I was able to find the solution. Below are steps -

 

1. Run this command on SCM and retrieve the password- cat /etc/cloudera-scm-server/db.properties 

    Output - 

    com.cloudera.cmf.db.type=postgresql
    com.cloudera.cmf.db.host=localhost:7432
    com.cloudera.cmf.db.name=scm
    com.cloudera.cmf.db.user=scm
    com.cloudera.cmf.db.password=PASSWORD

 

2. Run another command - psql -U scm -p 7432 -h localhost -d scm

    This will open the interface to run Sql query

 

3. Run sql query specific to your needs e.g. delete from configs where role_id = 110

 

Hope this helps.

Re: Not able to delete 1 Role from Inactive host

Community Manager

Thank you for sharing the solution. Hopefully it will assist others as well. :)



Cy Jervis, Community Manager

Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Learn more about the Cloudera Community:
Community Guidelines
How to use the forum