Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclosed root tag error #2

Open
ciesinsn opened this issue Nov 21, 2020 · 3 comments
Open

Unclosed root tag error #2

ciesinsn opened this issue Nov 21, 2020 · 3 comments

Comments

@ciesinsn
Copy link

I have not spent much time trying to debug your code to find where the issue is, but, when I try and run it I get the following error. Trying to run it against a 12.5 cluster.

Fri Nov 20 2020 21:48:16 GMT-0600 (CST) Getting Phones from AXL
Fri Nov 20 2020 21:48:16 GMT-0600 (CST) Found [4070] Phones from AXL
Fri Nov 20 2020 21:48:16 GMT-0600 (CST) Getting ip/registration from RisPort
Fri Nov 20 2020 21:48:16 GMT-0600 (CST) getAllDevices blocks:5
.Error: Error Error: Unclosed root tag
Line: 0
Column: 1302411
Char:

@saschamonteiro
Copy link
Owner

Hi, I added some console.log maybe there are special characters that are not being dealt with correctly,
can you update (git pull) and try again?

@ciesinsn
Copy link
Author

I was about to write you that I was digging in more to the issue. The problem is when running, my guess because of the number of devices returned, in risport.js the stepsize of 1000 (stepSize: 1000) seems to cause the issue where the XML is getting cut off in the returned data. I changed stepsize to 100 and it ran through that part without a error. I tried a stepsize of 250 and it error'ed again.

I got then to another issue in the phone.js script with the function getPhoneSerial. Some devices may have a registration IP in CUCM but the URL for getting the serial via XML is invalid and returns an error. This would kill the script. As a quick workaround I added a try/catch in this block.

        try {
                var r = result["DeviceInformation"];
         if (typeof r["serialNumber"] !== 'undefined'){
                phone.serial = r["serialNumber"][0];
          } else if (typeof r["SerialNumber"] !== 'undefined'){
                phone.serial = r["SerialNumber"][0];
          }
          if (typeof r["modelNumber"] !== 'undefined'){
                phone.model = r["modelNumber"][0];
          } else if (typeof r["ModelNumber"] !== 'undefined'){
                phone.model = r["ModelNumber"][0];
          }
          resolve(phone);
}
catch (err) {
        phone.model = 'Unknown';
        phone.serial = 'Unknown';
        resolve(phone);
        }});

@saschamonteiro
Copy link
Owner

thanks, I had no issues with a customer that had about 20,000 devices and a stepsize of 1000, good to know that it's not always successful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants