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

Unhandled: Unexpected token = #11

Open
spvrk opened this issue Mar 7, 2018 · 12 comments
Open

Unhandled: Unexpected token = #11

spvrk opened this issue Mar 7, 2018 · 12 comments
Labels

Comments

@spvrk
Copy link

spvrk commented Mar 7, 2018

Hi, I’m running the build agent task in vsts

I’ve got everything configured to scan my microservice at a specific target url, method is POST via an active scan with a sample payload.

In the build process I get the error mentioned above in the title right after the task description block (where it says the task name, description, version, etc etc..) no additional information or any leads are given... any idea on what’s going on here?

Thanks

@nuphoff
Copy link

nuphoff commented Apr 11, 2018

I have the same issue but i'm running the task on a on-premise installation of tfs

@kasunkv kasunkv added the bug label Apr 13, 2018
@kasunkv
Copy link
Owner

kasunkv commented Apr 13, 2018

Hi, a new version of the task (v2.0.5) is released now, Please check to see if this issue still exists. If so let me know here. Sorry for the delayed response.

@t3hcr
Copy link

t3hcr commented Apr 16, 2018

Thanks for the recent updates @kasunkv . Receiving the same issue/error here as well and will chime in with details we captured below...

With v2.0.6 we are still seeing the "Unhandled: Unexpected token =" issue which results in failed tasks running. We're using a private agent running Windows Server 2016. We can see the code/task related to the scan being delivered to the private build agent, but fail immediately after the task description block as @spvrk mentioned.

@kasunkv
Copy link
Owner

kasunkv commented Apr 16, 2018

@t3hcr Thanks for the feedback. I'll look in to this and keep you guys updated here..

@t3hcr
Copy link

t3hcr commented Apr 23, 2018

@kasunkv is there anything we can help or additional information we can provide to help debug the issue? We appreciate your time as you look at this!

@kasunkv
Copy link
Owner

kasunkv commented Apr 24, 2018

@t3hcr If you can send me the console logs for the task it would help a lot to troubleshoot this issue. To get the full task logs, in your variables section define the system.debug variable (if its not already there) and set the value to true (it will already be false if its set). Then you will see additional debug information including the inputs you provide. Send these debug lines and it would be helpful.

Please note that, the inputs will include the ZAP API key and the TargetUrl. Hide these when you post them here.

@spvrk If you can send these debug information too, it will help out a lot :)

@t3hcr
Copy link

t3hcr commented Apr 24, 2018

@kasunkv thanks for your continued work here. I captured some details for you based on your request.

Please see:
https://gist.github.com/t3hcr/e77e613b8658796abdb4b5c918ddab17

@t3hcr
Copy link

t3hcr commented Apr 30, 2018

@kasunkv Were you able to access the logs I placed in the gist at: https://gist.github.com/t3hcr/e77e613b8658796abdb4b5c918ddab17 ??

Is there any additional information or anything else I can help you with to help debug this issue?

Thank you very much for your time and work on this!

@kasunkv
Copy link
Owner

kasunkv commented Apr 30, 2018

@t3hcr Thanks for sending the logs. I'll look in to this ASAP. Was busy for the last few days.

@cil818317
Copy link

I've done a bit of investigation and it looks like the issue is in the reports.js;
const Report_1 = require("./classes/Report");
const report = new Report_1.Report(helper, requestService, taskInputs);
If you comment out the 2 lines that generate the base report file;


Starting task: OWASP ZAP Scan


Set workingFolder to default: E:\agent\tasks\OwaspZapScan\2.0.6
OWASP ZAP Spider Scan Initiated. ID: 0
Spider Scan In Progress: 100%
Spider Scan Complete.

OWASP ZAP Active Scan Initiated. ID: 0
Active Scan In Progress: 100%
Active Scan Complete.

Generating the report...
Task Failed. Error: "report is not defined"

@akratzert
Copy link

I'm using 2.0.7 and getting the same error. I don't see where that Report_1 = require("./classes/Report"); line is

@iaunzu
Copy link

iaunzu commented Sep 4, 2019

Seems like a js bug related with ECMAScript version supported in TFS.

I solved this problem changing line 279 in ./classes/Report.js to:

createAlertRow(header, value, rowType) {
  rowType = typeof rowType !== 'undefined' ? rowType : Enums_1.AlertRowType.AlertRow;
  let cssClass = 'attribute';

I am using v2.0.7 with TFS 15.112.26307.0.

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

No branches or pull requests

7 participants