Akhil Naik created AMBARI-25523:
-----------------------------------

             Summary: AMBARI UI KEEPS LOADING AT STEP3 WHILE ADDING THE NEW 
NAMESPACE FOR HDFS For the Second Time
                 Key: AMBARI-25523
                 URL: https://issues.apache.org/jira/browse/AMBARI-25523
             Project: Ambari
          Issue Type: Bug
          Components: ambari-web
    Affects Versions: 2.7.5
            Reporter: Akhil Naik
            Assignee: Szabolcs Beki


Problem Statement : I am Trying to add namespace to HDFS via Ambari, my HDFS 
already have two namespaces : namespace1,namespace2 . when i am trying to add 
the third one say : namespace3, it fails with below script error at Step3:

{code:java}
app.js:5310 Uncaught TypeError: Cannot read property 'split' of undefined
    at Class.prepareDependencies (app.js:5310)
    at Class.tweakServiceConfigs (app.js:5337)
    at Class.onLoad (app.js:5293)
    at invokeAction (vendor.js:15179)
    at iterateSet (vendor.js:15161)
    at Object.sendEvent (vendor.js:15278)
    at notifyObservers (vendor.js:13870)
    at Object.Ember.notifyObservers (vendor.js:13985)
    at Object.propertyDidChange (vendor.js:14618)
    at set (vendor.js:13424)
{code}

Analysis : Upon analysing the code : 
https://github.com/apache/ambari/blob/release-2.7.5/ambari-web/app/controllers/main/admin/federation/step3_controller.js#L110

It looks we are blindly taking 0th nameService as the one that have namenode1 
and namenode2 and then assiging the namenode1 and namenode2 :


{code:java}
    var nameServices = 
App.HDFSService.find().objectAt(0).get('masterComponentGroups').mapProperty('name');
    ret.nameServicesList = nameServices.join(',');
    ret.nameservice1 = nameServices[0];
    ret.newNameservice = this.get('content.nameServiceId');
    ret.namenode1 = hdfsSiteConfigs['dfs.namenode.rpc-address.' + 
ret.nameservice1 + '.nn1'].split(':')[0];
    ret.namenode2 = hdfsSiteConfigs['dfs.namenode.rpc-address.' + 
ret.nameservice1 + '.nn2'].split(':')[0];
{code}


The abouve logic is wrong, when you try to fetch `nameServices` as abouve the 
order is not neccessarly the way it was created

This logic need to rewramped.








--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to