<?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: Unable to remove older installations after upgrade to HDP 3.0.1 in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239337#M85630</link>
    <description>&lt;P&gt;I can confirm that this solution worked for me.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Dec 2018 21:35:50 GMT</pubDate>
    <dc:creator>tverhoeven</dc:creator>
    <dc:date>2018-12-21T21:35:50Z</dc:date>
    <item>
      <title>Unable to remove older installations after upgrade to HDP 3.0.1</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239335#M85628</link>
      <description>&lt;P&gt; I've tried the procedure on this page: &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/202904/how-to-remove-all-previous-version-hdp-directories.html?childToView=230847#comment-230847" target="_blank"&gt;https://community.hortonworks.com/articles/202904/how-to-remove-all-previous-version-hdp-directories.html?childToView=230847#comment-230847&lt;/A&gt;&lt;/P&gt;&lt;P&gt; on a freshly 
upgraded HDP setup (version 3.0.1). But when I launch the request it 
immediately errors out with this in the output:&lt;/P&gt;&lt;P&gt; stdout:&lt;/P&gt;
&lt;PRE&gt;	2018-12-19 10:38:04,388 - call[('ambari-python-wrap', u'/usr/bin/hdp-select', 'versions')] {}&amp;lt;br&amp;gt;	2018-12-19 10:38:04,416 - call returned (0, '2.6.2.14-5\n2.6.5.0-292\n3.0.1.0-187')&amp;lt;br&amp;gt;	2018-12-19 10:38:04,416 - available versions: ['2.6.2.14-5', '2.6.5.0-292', '3.0.1.0-187']&amp;lt;br&amp;gt;	2018-12-19 10:38:04,417 - version 2.6.2.14-5 added to remove&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;	Command failed after 1 tries&lt;/PRE&gt;&lt;P&gt;stderr:&lt;/P&gt;
&lt;PRE&gt;Traceback (most recent call last):&amp;lt;br&amp;gt;  File "/var/lib/ambari-agent/cache/custom_actions/scripts/remove_previous_stacks.py", line 119, in &amp;lt;module&amp;gt;&amp;lt;br&amp;gt;  RemovePreviousStacks().execute()&amp;lt;br&amp;gt;  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 351, in execute&amp;lt;br&amp;gt;  method(env)&amp;lt;br&amp;gt;  File "/var/lib/ambari-agent/cache/custom_actions/scripts/remove_previous_stacks.py", line 49, in actionexecute&amp;lt;br&amp;gt;  self.remove_stack_version(structured_output, low_version)&amp;lt;br&amp;gt;  File "/var/lib/ambari-agent/cache/custom_actions/scripts/remove_previous_stacks.py", line 54, in remove_stack_version&amp;lt;br&amp;gt;  packages_to_remove = self.get_packages_to_remove(version)&amp;lt;br&amp;gt;  File "/var/lib/ambari-agent/cache/custom_actions/scripts/remove_previous_stacks.py", line 77, in get_packages_to_remove&amp;lt;br&amp;gt;  all_installed_packages = self.pkg_provider.all_installed_packages()&amp;lt;br&amp;gt;AttributeError: 'YumManager' object has no attribute 'all_installed_packages'&lt;/PRE&gt;&lt;P&gt;A quick google did not return anything usefull. But it looks like the
 some of the supporting code for this is missing or we are missing a 
extra library somewhere?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 21:35:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239335#M85628</guid>
      <dc:creator>tverhoeven</dc:creator>
      <dc:date>2018-12-20T21:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to remove older installations after upgrade to HDP 3.0.1</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239336#M85629</link>
      <description>&lt;P&gt;	Hi &lt;A rel="user" href="https://community.cloudera.com/users/103186/tverhoeven.html" nodeid="103186"&gt;@Tim Verhoeven&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;	Removing old stacks and versions is something i personally wont suggest you because at any point you want to downgrade your HDP you might need it. But as you facing the above error i would like to see if below changes help you or not :&lt;/P&gt;&lt;P&gt;	I was facing the same issue and changing the below line helped me get past the abouve expection :&lt;/P&gt;&lt;P&gt;	Steps&lt;/P&gt;&lt;P&gt;	1) go to each ambari agents&lt;/P&gt;
&lt;PRE&gt;[root@asn1 current]#vi /var/lib/ambari-agent/cache/custom_actions/scripts/remove_previous_stacks.py
&lt;/PRE&gt;&lt;P&gt;	2) go to line : 77&lt;/P&gt;&lt;P&gt;	edit the line from :&lt;/P&gt;
&lt;PRE&gt;all_installed_packages = self.pkg_provider.all_installed_packages()
&lt;/PRE&gt;&lt;P&gt;	to&lt;/P&gt;
&lt;PRE&gt;all_installed_packages = self.pkg_provider.installed_packages()
&lt;/PRE&gt;&lt;P&gt;	retry the operation via curl again&lt;/P&gt;
&lt;PRE&gt;curl 'http://asn1.openstacklocal:8080/api/v1/clusters/asnaik/requests' -u admin:admin -H "X-Requested-By: ambari" -X POST -d'{"RequestInfo":{"context":"remove_previous_stacks", "action" : "remove_previous_stacks", "parameters" : {"version":"3.0.1.1-84"}}, "Requests/resource_filters": [{"hosts":"asn1.openstacklocal"}]}'
&lt;/PRE&gt;&lt;P&gt;	The operation has to be success in UI.&lt;/P&gt;&lt;P&gt;I have created an article in this regard : &lt;A href="https://community.hortonworks.com/articles/230893/remove-old-stack-versions-script-doesnt-work-in-am.html" target="_blank"&gt;https://community.hortonworks.com/articles/230893/remove-old-stack-versions-script-doesnt-work-in-am.html&lt;/A&gt;&lt;/P&gt;&lt;P style="color:green"&gt;	&lt;STRONG&gt;Please accept this answer and upvote the article if this helps you&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 02:01:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239336#M85629</guid>
      <dc:creator>akhilsnaik</dc:creator>
      <dc:date>2018-12-21T02:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to remove older installations after upgrade to HDP 3.0.1</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239337#M85630</link>
      <description>&lt;P&gt;I can confirm that this solution worked for me.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 21:35:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-remove-older-installations-after-upgrade-to-HDP-3/m-p/239337#M85630</guid>
      <dc:creator>tverhoeven</dc:creator>
      <dc:date>2018-12-21T21:35:50Z</dc:date>
    </item>
  </channel>
</rss>

