PaloAltoNetworks/Splunk-Apps

Splunk unable to load the dashboard and we are getting A custom JavaScript error caused an issue loading your dashboard. See the developer console for more details.

aattelli91 opened this issue · 8 comments

Describe the bug

We have upgrade the Palo alto app to 7.1.0 and we notice dashboard is not loading and prompting with below error
A custom JavaScript error caused an issue loading your dashboard. See the developer console for more details.

Expected behavior

Current behavior

Possible solution

Steps to reproduce

  1. Upgrade the app to 7.1.0 and you will able to see the error

Screenshots

image

Context

Your Environment

  • Version used:
  • Environment name and version (e.g. Chrome 59, node.js 5.4, python 3.7.3):
  • Operating System and version (desktop or mobile):
  • Link to your project:

🎉 Thanks for opening your first issue here! Welcome to the community!

Are you using Splunk Cloud or Splunk Enterprise? What version?

Hi Brian,

I noticed the same issue of aattelli91.
I'm using Splunk Enterprise 8.2.6.
This issue appeared after upgrade from splunk 7 to splunk 8.2.6
I also tried an upgrade to 9.0.1 in a dev environment, same issue.

I think this issue could be related to another issue: #264

I wish it were that simple. We've been working with Splunk on this issue for months and they can't figure out what causes this JavaScript error either. We even use servers in Spkunk's labs to reproduce the issue, then gutted our App so it had zero JavaScript or Python and the issue was still there. We also can't reliably reproduce it. It seems to have nothing to do with the App or Addon and is caused by something in the Splunk environment which is different for each installation.

Side note, Splunk's tooling says the App is not ready for jQuery 3.5 or Python 3, but it is. These are false positives in Splunk's tooling where they detect issues in Splunk's own SDKs, not the App/Addon code.

We'll be updating the Addon from Addon-builder 4.0 to 4.1 with the latest SDKs, so we hope that will help eliminate some false positives as the latest Splunk SDKs have removed Python 2 support.

As for the JavaScript error message, we are continuing to investigate with Splunk but have no workaround at this time.

I think the issue could be related to apps update procedure.
In my environment I noticed the issue after core Splunk update and also apps update via command line.

I tried a workaround,

Fully remove PA app 7.1.0
Reinstall PA app 7.1.0

Now the PA apps are working fine without any alert, in the section " Upgrade Readiness App "
The tests passed

Palo Alto Networks > Passed
Palo Alto Networks Add-on > Passed

I previously saved old app folders and compared now with new fresh installation (same release), not considering "local" folder that contains customization.

There are many differences about number and type of files, an interesting example is this folder:

appserver/static/js

we have more js than expected and especially this: common.js

this files, probably not used anymore, contains explicit references to old jquery version. (jquery-2.1.0)

I hope these information could be useful.

@braies This information is very helpful thank you! We've been trying to figure out why this is happening with no luck on our end. Just curious was there a specific version you upgraded from? What version is the App you compared it too?

@paulmnguyen

Here below you can see my update history

Splunk 7.3 > Splunk 8.0.8 ( PA apps 6.5.0 )
PA apps 6.5.0 > PA apps 7.0.1 ( Splunk 8.0.8 )
PA apps 7.0.1 > PA apps 7.0.2 ( Splunk 8.0.8 )
Splunk 8.0.8 > Splunk 8.2.6 and PA apps 7.0.2 > PA apps 7.0.4 ( This is the first time I noticed this issue )
Splunk 8.2.6 > Splunk 9.0.1 ( The issue persists )

I usually update apps from the command line.
I totally removed PA apps and I installed the last release, I'm now running 7.1.0 and it works fine.

About apps comparison:

Splunk 9.0.1, PA 7.1.0 apps release. Issue present.
I saved entire PA apps folders.
I totally removed PA 7.1.0 apps
I restarted the splunk service and I reinstalled the same app release, 7.1.0

The issue disappeared, I compared the two apps folders contents, before and after new installation. In the old folders there were many unexpected differences, the most interesting was common.js that contains explicit references to jquery 2.1.0.

I don't known how Splunk core checks the apps.
I supposed (I'm not sure) with an inspection of the app folder and probably when it founds references to the old jquery version it marks the app as not compliant.

Please remove previous versions of the app prior to updating to 8.0.0. This will resolve the javascript issue.

Thank you @braies for finding the solution.