Scriptring Error on start

Support and questions for using and managing Chocolatey NuGet inside of Labtech
Post Reply
mwilhelmi
Posts: 37
Joined: Thu Nov 19, 2020 7:16 am
3

Scriptring Error on start

Post by mwilhelmi »

Hi, when starting choclatey from tools in CWA we get this script-error:

http://charts.squidworks.net/index.php? ... EyQUIyNnxw

How to fix this?

User avatar
Cubert
Posts: 2456
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Scriptring Error on start

Post by Cubert »

Ok how to trouble shoot Java Charting errors in Chocolatey


In Chocolatey For Labtech we used a technique to pass chart operations off to a Java embeded charting service we host.

Then we pipe this java post to a web page object in the plugin to show you charts. This works great until you get some bad data that mucks up the java. These charts were much more flexible then any MS charting at the time.

If you launch the URL in a browser you will see the following if you do a view source.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Squid Charts API</title><link rel="stylesheet" href="style.css" type="text/css"> <script src="./amcharts/amcharts.js" type="text/javascript"></script><script src="./amcharts/serial.js" type="text/javascript"></script>
        <script>
            var chart;

            var chartData = [
{"thing": " Der Zugriff auf den Pfad "C:ProgramDatachocolateychoco.exe.old" wurde verweigert.","counts": 11,"color": "#3FF599"},{"thing": " Error converted to warning:","counts": 11,"color": "#04F906"},{"thing": "7Zip","counts": 49,"color": "#2B6EA7"},{"thing": "7zip.install","counts": 11,"color": "#B66CF1"},{"thing": "Adobe Reader","counts": 61,"color": "#CB71DF"},{"thing": "adobereader","counts": 3,"color": "#7C4190"},{"thing": "autohotkey.portable","counts": 2,"color": "#D322A8"},{"thing": "Chocolatey","counts": 79,"color": "#5FBB31"},{"thing": "chocolatey-core.extension","counts": 76,"color": "#35628F"},{"thing": "chocolatey-dotnetfx.extension","counts": 13,"color": "#E15C91"},{"thing": "chocolatey-windowsupdate.extension","counts": 3,"color": "#EE87D9"},{"thing": "Citrix Workspace","counts": 10,"color": "#4E99B8"},{"thing": "citrix-workspace","counts": 4,"color": "#0BB824"},{"thing": "cutepdf","counts": 2,"color": "#C6A087"},{"thing": "CutePDF  Writer","counts": 2,"color": "#A4D004"},{"thing": "DotNet4.5","counts": 9,"color": "#87EFE1"},{"thing": "dotnet4.6.2","counts": 13,"color": "#9050D1"},{"thing": "Firefox","counts": 9,"color": "#704D5F"},{"thing": "flashplayeractivex","counts": 1,"color": "#3DDF3A"},{"thing": "Ghostscript.app","counts": 4,"color": "#67CE96"},{"thing": "Google Chrome","counts": 48,"color": "#764A12"},{"thing": "GoogleChrome","counts": 8,"color": "#16C7E5"},{"thing": "gotomeeting","counts": 14,"color": "#187DD7"},{"thing": "Greenshot","counts": 50,"color": "#267088"},{"thing": "iCloud","counts": 2,"color": "#6C0D82"},{"thing": "jre8","counts": 7,"color": "#20BBEA"},{"thing": "KB2919355","counts": 65,"color": "#2DAD72"},{"thing": "KB2919442","counts": 65,"color": "#AD500B"},{"thing": "KB2999226","counts": 3,"color": "#C07E39"},{"thing": "KB3033929","counts": 3,"color": "#7A10BA"},{"thing": "KB3035131","counts": 3,"color": "#7EA3EA"},{"thing": "keepass","counts": 3,"color": "#8D4F56"},{"thing": "keepass-keepasshttp","counts": 1,"color": "#758E08"},{"thing": "keepass.install","counts": 3,"color": "#1F6F71"},{"thing": "Maximum tries of 3 reached. Throwing error.","counts": 11,"color": "#0A6ADF"},{"thing": "Microsoft Edge","counts": 74,"color": "#490440"},{"thing": "Microsoft Office365 Business","counts": 7,"color": "#DC1D24"},{"thing": "Microsoft Office365 ProPlus","counts": 3,"color": "#4F3A20"},{"thing": "Microsoft Teams","counts": 10,"color": "#23C9F9"},{"thing": "microsoft-edge","counts": 1,"color": "#065549"},{"thing": "microsoft-teams","counts": 1,"color": "#AB9E6D"},{"thing": "microsoft-teams.install","counts": 2,"color": "#1CA8CD"},{"thing": "Mozilla Firefox","counts": 60,"color": "#9DDEBD"},{"thing": "netfx-4.6.2","counts": 13,"color": "#2CAA2D"},{"thing": "nmap","counts": 2,"color": "#E10E3E"},{"thing": "NotePad ++","counts": 57,"color": "#00A3E6"},{"thing": "Notepad++","counts": 2,"color": "#2B7679"},{"thing": "notepadplusplus","counts": 33,"color": "#F89DF3"},{"thing": "notepadplusplus.install","counts": 5,"color": "#962E69"},{"thing": "office365proplus","counts": 4,"color": "#C96A86"},{"thing": "Process Explorer","counts": 24,"color": "#5C6F38"},{"thing": "procexp","counts": 9,"color": "#BF73D0"},{"thing": "putty","counts": 4,"color": "#04EDC1"},{"thing": "Putty Client","counts": 59,"color": "#12AB26"},	
            ];


            AmCharts.ready(function () {
                // SERIAL CHART
                chart = new AmCharts.AmSerialChart();
                chart.dataProvider = chartData;
                chart.categoryField = "thing";
                // the following two lines makes chart 3D
                chart.depth3D = 30;
                chart.angle = 20;

                // AXES
                // category
                var categoryAxis = chart.categoryAxis;
                categoryAxis.labelRotation = 25;
                categoryAxis.dashLength = 5;
                categoryAxis.gridPosition = "start";

                // value
                var valueAxis = new AmCharts.ValueAxis();
                valueAxis.title = "Installed Applications";
                valueAxis.dashLength = 5;
                chart.addValueAxis(valueAxis);

                // GRAPH
                var graph = new AmCharts.AmGraph();
                graph.valueField = "counts";
                graph.colorField = "color";
                graph.balloonText = "<span style='font-size:14px'>[[category]]: <b>[[value]]</b></span>";
                graph.type = "column";
                graph.lineAlpha = 0;
                graph.fillAlphas = 1;
                chart.addGraph(graph);

                // CURSOR
                var chartCursor = new AmCharts.ChartCursor();
                chartCursor.cursorAlpha = 0;
                chartCursor.zoomable = false;
                chartCursor.categoryBalloonEnabled = false;
                chart.addChartCursor(chartCursor);

                // WRITE
                chart.write("chartdiv");
            });
        </script>


	
		
</head><body><div id="chartdiv" style="width: 100%; height:280px;"></div></body></html>
You have the first 2 data points as bad data and primarily the first datapoint has extra quotes in it...

Code: Select all

{"thing": " Der Zugriff auf den Pfad "C:ProgramDatachocolateychoco.exe.old" wurde verweigert.","counts": 11,"color": "#3FF599"}

Code: Select all

{"thing": " Error converted to warning:","counts": 11,"color": "#04F906"},
If you have a look in the database for a table called plugin_p4l_chocolatey_computers

Inside there there looks to be 11 Der Zugriff auf den Pfad "C:ProgramDatachocolateychoco.exe.old" wurde verweigert. entries, delete these entries from the database will remove this from the chart data.

Post Reply

Return to “Chocolatey For Labtech”