<?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: Ambari 2.7.3 Dashboard &amp;quot;Yarn Container&amp;quot; widget shows n/a when number of containers is other than 0 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/283050#M210374</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/70776"&gt;@JayZhang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Until the mentioned JIRA is fixed permanently can you&amp;nbsp; please try this workaround. One time One line change inside the "/usr/lib/ambari-server/web/javascripts/app.js" file should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step-1).&amp;nbsp;&lt;/STRONG&gt;Take a Safe Backup of the file "/usr/lib/ambari-server/web/javascripts/app.js" on ambari server host.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# cp -f /usr/lib/ambari-server/web/javascripts/app.js /PATH/To/Backup/app.js.ORIGINAL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Step-2).&lt;/STRONG&gt; Also just above the &lt;EM&gt;"App.YarnContainersView = App.TextDashboardWidgetView.extend"&lt;/EM&gt; line inside the above file you will see a function declaration like "counterOr" we will need to make one change there.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;(BEFORE CHANGE)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# grep -B12 'App.YarnContainersView' /usr/lib/ambari-server/web/javascripts/app.js

var App = require('app');

function counterOrNA(key) {
  var _key = 'model.{0}.length'.format(key);
  return Em.computed(_key, function () {
    if (Em.isNone(this.get('model.' + key)) || this.get('model.metricsNotAvailable')) {
      return Em.I18n.t('services.service.summary.notAvailable');
    }
    return this.get(_key);
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step-3). &lt;/STRONG&gt;&amp;nbsp;IN the above function block you will see a line as&lt;EM&gt; "var _key = 'model.{0}&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;.length&lt;/STRONG&gt;&lt;/FONT&gt;'.format(key);"&lt;/EM&gt;&lt;BR /&gt;We need to just remove the ".length" work from that string.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;(AFTER CHANGE)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# grep -B12 'App.YarnContainersView' /usr/lib/ambari-server/web/javascripts/app.js 

var App = require('app');

function counterOrNA(key) {
  var _key = 'model.{0}'.format(key);
  return Em.computed(_key, function () {
    if (Em.isNone(this.get('model.' + key)) || this.get('model.metricsNotAvailable')) {
      return Em.I18n.t('services.service.summary.notAvailable');
    }
    return this.get(_key);
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Step-4).&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;Save the file and then Hard Refresh the Browser. On Mac (command + Shift + R)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2019 04:30:52 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2019-11-15T04:30:52Z</dc:date>
    <item>
      <title>Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/281836#M209605</link>
      <description>&lt;P&gt;"Yarn Container" widget shows 0/0/0 when no containers are allocated,pending or reserved, but if any of the 3 metrics changed, the widget shows n/a, wonder if it is a bug or not?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2019 12:28:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/281836#M209605</guid>
      <dc:creator>JayZhang</dc:creator>
      <dc:date>2019-11-01T12:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/281927#M209665</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot_1.png" style="width: 900px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/25128i8FAE522E787E8E7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot_1.png" alt="Screenshot_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 02:39:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/281927#M209665</guid>
      <dc:creator>JayZhang</dc:creator>
      <dc:date>2019-11-04T02:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/282430#M209997</link>
      <description>&lt;P&gt;I am facing same issue with ambari 2.7.3 dashboard. Is this a bug?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/AMBARI-25170" target="_blank"&gt;https://issues.apache.org/jira/browse/AMBARI-25170&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 09:17:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/282430#M209997</guid>
      <dc:creator>cvrocks</dc:creator>
      <dc:date>2019-11-08T09:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/282679#M210130</link>
      <description>&lt;P&gt;&lt;A href="https://issues.apache.org/jira/browse/AMBARI-25170" target="_blank" rel="nofollow noopener noreferrer"&gt;AMBARI-25170&lt;/A&gt;&amp;nbsp;was closed as "not a problem", obviously the reporter hadn't tested with container change.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 01:52:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/282679#M210130</guid>
      <dc:creator>JayZhang</dc:creator>
      <dc:date>2019-11-12T01:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/282869#M210251</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please add&amp;nbsp; more insights here please to understand it explicitly. What do you mean by container change, is there a resolution for the mentioned issue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 10:47:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/282869#M210251</guid>
      <dc:creator>cvrocks</dc:creator>
      <dc:date>2019-11-13T10:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/283050#M210374</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/70776"&gt;@JayZhang&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Until the mentioned JIRA is fixed permanently can you&amp;nbsp; please try this workaround. One time One line change inside the "/usr/lib/ambari-server/web/javascripts/app.js" file should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step-1).&amp;nbsp;&lt;/STRONG&gt;Take a Safe Backup of the file "/usr/lib/ambari-server/web/javascripts/app.js" on ambari server host.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# cp -f /usr/lib/ambari-server/web/javascripts/app.js /PATH/To/Backup/app.js.ORIGINAL&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Step-2).&lt;/STRONG&gt; Also just above the &lt;EM&gt;"App.YarnContainersView = App.TextDashboardWidgetView.extend"&lt;/EM&gt; line inside the above file you will see a function declaration like "counterOr" we will need to make one change there.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;(BEFORE CHANGE)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# grep -B12 'App.YarnContainersView' /usr/lib/ambari-server/web/javascripts/app.js

var App = require('app');

function counterOrNA(key) {
  var _key = 'model.{0}.length'.format(key);
  return Em.computed(_key, function () {
    if (Em.isNone(this.get('model.' + key)) || this.get('model.metricsNotAvailable')) {
      return Em.I18n.t('services.service.summary.notAvailable');
    }
    return this.get(_key);
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step-3). &lt;/STRONG&gt;&amp;nbsp;IN the above function block you will see a line as&lt;EM&gt; "var _key = 'model.{0}&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;.length&lt;/STRONG&gt;&lt;/FONT&gt;'.format(key);"&lt;/EM&gt;&lt;BR /&gt;We need to just remove the ".length" work from that string.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;(AFTER CHANGE)&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# grep -B12 'App.YarnContainersView' /usr/lib/ambari-server/web/javascripts/app.js 

var App = require('app');

function counterOrNA(key) {
  var _key = 'model.{0}'.format(key);
  return Em.computed(_key, function () {
    if (Em.isNone(this.get('model.' + key)) || this.get('model.metricsNotAvailable')) {
      return Em.I18n.t('services.service.summary.notAvailable');
    }
    return this.get(_key);
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Step-4).&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;Save the file and then Hard Refresh the Browser. On Mac (command + Shift + R)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 04:30:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/283050#M210374</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-11-15T04:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/283063#M210386</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/50614"&gt;@jsensharma&lt;/a&gt;&amp;nbsp; It works after the change. Thanks a lot for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 06:42:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/283063#M210386</guid>
      <dc:creator>JayZhang</dc:creator>
      <dc:date>2019-11-15T06:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari 2.7.3 Dashboard "Yarn Container" widget shows n/a when number of containers is other than 0</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/288030#M213407</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/50614"&gt;@jsensharma&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; Thanks for providing patch for this issue. I tested patch from&amp;nbsp;&lt;A href="https://github.com/apache/ambari/pull/3125/commits/973bb3fafdfb3c8e1f8516ca7a6efbb27897fb11" target="_blank"&gt;https://github.com/apache/ambari/pull/3125/commits/973bb3fafdfb3c8e1f8516ca7a6efbb27897fb11&lt;/A&gt;&amp;nbsp;and it fix issue for yarn container metric.&lt;BR /&gt;&lt;BR /&gt;But above accepted solution does not work for "yarn container" metrics. Trick is to find correct counterOrNA function as this function is available at 4 places in app.js file . Just thought to let you and others know.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;Ajit Mote&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 14:04:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ambari-2-7-3-Dashboard-quot-Yarn-Container-quot-widget-shows/m-p/288030#M213407</guid>
      <dc:creator>clv11</dc:creator>
      <dc:date>2020-01-21T14:04:08Z</dc:date>
    </item>
  </channel>
</rss>

