<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Ranger usersync fails with returned a response status of 400 Bad Request in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131177#M39414</link>
    <description>&lt;P&gt;This issue has been fixed in RANGER 0.6. Please refer &lt;A href="https://issues.apache.org/jira/browse/RANGER-1041"&gt;RANGER-1041&lt;/A&gt; for the fix details. &lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2016 11:11:54 GMT</pubDate>
    <dc:creator>pagrawa</dc:creator>
    <dc:date>2016-09-07T11:11:54Z</dc:date>
    <item>
      <title>Ranger usersync fails with returned a response status of 400 Bad Request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131173#M39410</link>
      <description>&lt;P&gt;Usersync finds correclty users from given user seachfilter string, but fails with update with bad request 400&lt;/P&gt;&lt;P&gt;----grep&lt;/P&gt;&lt;P&gt;01 Sep 2016 13:46:04  INFO LdapUserGroupBuilder [UnixUserSyncThread] - Updating user count: 13, userName: user1, groupList: [group1, group2] &lt;/P&gt;&lt;P&gt;01 Sep 2016 13:46:04  INFO LdapUserGroupBuilder [UnixUserSyncThread] - LDAPUserGroupBuilder.updateSink() completed with user count: 13&lt;/P&gt;&lt;P&gt;01 Sep 2016 13:46:04 ERROR LdapUserGroupBuilder [UnixUserSyncThread] - sink.addOrUpdateUser failed with exception: POST &lt;A href="http://server1:6080/service/users/default" target="_blank"&gt;http://server1:6080/service/users/default&lt;/A&gt; returned a response status of 400 Bad Request, for user: user1, groups: [group1, group2] &lt;/P&gt;&lt;P&gt;----grep&lt;/P&gt;&lt;P&gt;why it uses URL (API I guess) &lt;A href="http://server1:6080/service/users/default" target="_blank"&gt;http://server1:6080/service/users/default&lt;/A&gt; which gives bad request 400 ?&lt;/P&gt;&lt;P&gt;Ranger 0.5.0.2.4&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:58:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131173#M39410</guid>
      <dc:creator>indrek_maestu</dc:creator>
      <dc:date>2016-09-01T17:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger usersync fails with returned a response status of 400 Bad Request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131174#M39411</link>
      <description>&lt;P&gt;can you please provide the more error details from the logs and please check xa_portal.log also , there also you must see some error reg. why 400 ERROR was thrown&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 18:05:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131174#M39411</guid>
      <dc:creator>dsharma</dc:creator>
      <dc:date>2016-09-01T18:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger usersync fails with returned a response status of 400 Bad Request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131175#M39412</link>
      <description>&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/7219-xa-portal.txt"&gt;xa-portal.txt&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 18:17:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131175#M39412</guid>
      <dc:creator>indrek_maestu</dc:creator>
      <dc:date>2016-09-01T18:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger usersync fails with returned a response status of 400 Bad Request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131176#M39413</link>
      <description>&lt;P&gt;looking errors in xa-portal.log, there is error
Please make sure while create/update given userId should be of x_user&lt;/P&gt;&lt;P&gt;I tried delete users from ranger database (through rest api) delete operation hung. I canceled.&lt;/P&gt;&lt;P&gt;Seems that database left some weird status, where some data weren't deleted&lt;/P&gt;&lt;P&gt;Now updating again userdata from LDAP, some user groups failing to update, because some old id-s still exists in database.&lt;/P&gt;&lt;P&gt;Deleting wrongly syncronized data from ranger is very essential function, which today is not there!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 21:27:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131176#M39413</guid>
      <dc:creator>indrek_maestu</dc:creator>
      <dc:date>2016-09-01T21:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger usersync fails with returned a response status of 400 Bad Request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131177#M39414</link>
      <description>&lt;P&gt;This issue has been fixed in RANGER 0.6. Please refer &lt;A href="https://issues.apache.org/jira/browse/RANGER-1041"&gt;RANGER-1041&lt;/A&gt; for the fix details. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 11:11:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131177#M39414</guid>
      <dc:creator>pagrawa</dc:creator>
      <dc:date>2016-09-07T11:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger usersync fails with returned a response status of 400 Bad Request</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131178#M39415</link>
      <description>&lt;P&gt;This issue is usually seen when user wan't removed properly from Ranger db and some information is still available in user tables.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;For example in above situation it might be possible that 'user1' is not available in x_user table but its still part of other user tables such as x_portal_user, x_portal_user_role, x_user_module_perm, x_auth_sess etc.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Perform below steps to resolve this issue.&lt;/P&gt;&lt;P&gt;Verify whether problematic user is available in other tables&lt;/P&gt;&lt;PRE&gt;MariaDB [ranger]&amp;gt; select * from x_user where user_name = 'user1';
MariaDB [ranger]&amp;gt;&amp;nbsp;select id from x_portal_user where&amp;nbsp;login_id = 'user1';&amp;nbsp;
+----+
| id |
+----+
| 44 |
+----+

MariaDB [ranger]&amp;gt;&amp;nbsp;delete from x_portal_user_role where id = 44;&amp;nbsp;
MariaDB [ranger]&amp;gt;&amp;nbsp;delete from x_user_module_perm where user_id = 44;
MariaDB [ranger]&amp;gt;&amp;nbsp;delete from x_auth_sess where user_id = 44;
MariaDB [ranger]&amp;gt;&amp;nbsp;delete from x_portal_user where id = 44;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;To get all such user's&lt;/P&gt;&lt;PRE&gt;MariaDB [ranger]&amp;gt; &amp;nbsp;select * from x_portal_user_role where id not in (select id from x_user);
MariaDB [ranger]&amp;gt; &amp;nbsp;select * from x_user_module_perm where user_id not in (select id from x_user);
MariaDB [ranger]&amp;gt; &amp;nbsp;select * from x_auth_sess where user_id not in (select id from x_user);
MariaDB [ranger]&amp;gt; &amp;nbsp;select * from x_portal_user where id not in (select id from x_user);&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Remove users which are not part of x_user table but available in other tables&lt;/P&gt;&lt;PRE&gt;MariaDB [ranger]&amp;gt;&amp;nbsp; delete from x_portal_user_role where id not in (select id from x_user);&amp;nbsp;
MariaDB [ranger]&amp;gt;&amp;nbsp; delete from x_user_module_perm where user_id not in (select id from x_user);&amp;nbsp;
MariaDB [ranger]&amp;gt;&amp;nbsp; delete from x_auth_sess where user_id not in (select id from x_user);&amp;nbsp;
MariaDB [ranger]&amp;gt;&amp;nbsp; delete from x_portal_user where id not in (select id from x_user);&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Restart usersync process&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 00:54:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-usersync-fails-with-returned-a-response-status-of-400/m-p/131178#M39415</guid>
      <dc:creator>gul_shad</dc:creator>
      <dc:date>2019-05-13T00:54:41Z</dc:date>
    </item>
  </channel>
</rss>

