eapowertools-archive / qs-governance-dashboard

Unsupported - Collects metadata and parses script logs for Qlik Sense applications for use with Qlik Sense Governance
Other
38 stars 14 forks source link

2 bugs found during ParseLoadScripts #73

Open DiegoBormann opened 6 years ago

DiegoBormann commented 6 years ago

Prerequisites

Description

ParseScriptLogs is giving errors on some files

Steps to Reproduce

  1. Run GenerateMetaData and ParseLoadScripts from API or Web-App

Expected behavior: Expect all Sense apps to output XML files

Actual behavior: Some Apps do not produce XML output

Reproduces how often: 100 %. Also when duplicating same app, that app also fails.

Versions

Agent: 1.0.1.0 OS: Windows server 2012 R2 standard

Additional Information

to catch the problem I have put an extra debug line to output to the logfile here: agent/lib/parseScriptLogs.js

-->>> function parseQlikLogFile(parser, file) {

try {

    var parsed = parser.parse(file.fileContent);
    parsed.fileName = file.fileName;

    return parsed

} catch (e) {

    if (e.name === 'SyntaxError') {
        return {
            fileName: file.fileName,
            parsed: false,
            message: e.message,
            expected: e.expected,
            found: e.found,
            location: e.location
        }

    } else {
    logMessage("error", "what happened here?");     // Extra debug line!
        throw e;
    }

}

} <<---

This results in the following log: ..... {"jsFile":"parseScriptLogs.js","level":"info","message":"81 files to process","timestamp":"2017-11-28T10:13:39.822Z"} ... some errors occur after parsing?? (but seem to be ok) (bug 1) ..... {"jsFile":"parseScriptLogs.js","level":"info","message":"Finishing parsing 04666bd9-7bc8-42fb-97b5-dc3cb0fd7579.2017_10_30_09_00_40.78819A4E856F6AB8D589.log","timestamp":"2017-11-28T10:13:42.994Z"} {"jsFile":"parseScriptLogs.js","level":"error","message":"An error occured parsing 04666bd9-7bc8-42fb-97b5-dc3cb0fd7579.2017_10_30_09_00_40.78819A4E856F6AB8D589.log","timestamp":"2017-11-28T10:13:42.994Z"} .... other files can not be parsed at all and result in immediate error (see my extra debug logMessage (bug 2) .... {"jsFile":"parseScriptLogs.js","level":"info","message":"Processing file number 1: 069c6e82-b779-424c-9d9b-6aaa1ddd587f.2017_10_28_01_54_16.BEDE257E37C1ED0479FC.log","timestamp":"2017-11-28T10:13:43.260Z"} {"jsFile":"parseScriptLogs.js","level":"info","message":"begin parsing 069c6e82-b779-424c-9d9b-6aaa1ddd587f.2017_10_28_01_54_16.BEDE257E37C1ED0479FC.log","timestamp":"2017-11-28T10:13:43.260Z"} {"jsFile":"parseScriptLogs.js","level":"error","message":"what happened here?","timestamp":"2017-11-28T10:13:43.401Z"} {"jsFile":"parseScriptLogs.js","level":"error","message":"Error parsing 069c6e82-b779-424c-9d9b-6aaa1ddd587f.2017_10_28_01_54_16.BEDE257E37C1ED0479FC.log","timestamp":"2017-11-28T10:13:43.401Z"}