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

[BUG] <UnexpectedException when run scanner dfa> #1613

Open
tobytas opened this issue Aug 29, 2024 · 0 comments
Open

[BUG] <UnexpectedException when run scanner dfa> #1613

tobytas opened this issue Aug 29, 2024 · 0 comments
Labels
SFGE Issues related to the Salesforce Graph Engine

Comments

@tobytas
Copy link

tobytas commented Aug 29, 2024

Have you tried to resolve this issue yourself first?

Yes

Bug Description

Hello,
When run second scan from here:

https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/security_review_code_analyzer_scan.htm

with such options:
sf scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target ./ --projectdir ./ --category Security

every time receiving errors:
Analyzing with Salesforce Graph Engine. .../.sfdx-scanner/sfge.log for details.... Error
Error (1): Unexpected exception while loading graph. See logs for more information.
Logs are attached.

Output / Logs

2024-08-29 16:47:38 INFO GraphUtil:207 - Loading file. path=/Users/new/Work/hr-app-pro/core/main/default/triggers/PerformanceReviewTrigger.trigger
2024-08-29 16:47:38 INFO GraphUtil:244 - Skipping subtree of path=/Users/new/Work/hr-app-pro/.sfdx
2024-08-29 16:47:38 INFO GraphUtil:244 - Skipping subtree of path=/Users/new/Work/hr-app-pro/.sf
2024-08-29 16:47:49 ERROR Main:157 - Unexpected exception while loading graph
com.salesforce.exception.UnexpectedException: vp[FirstChild->false], vp[BeginLine->93], vp[DefiningType_CaseSafe->resourcerequesttr...], vp[LastChild->false], vp[DefiningType->ResourceRequestTr...], vp[EndLine->93], vp[childIdx->2], vp[BeginColumn->9]
at com.salesforce.graph.build.GremlinUtil.getChildren(GremlinUtil.java:60) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.MethodPathBuilderVisitor.visitForEachStatement(MethodPathBuilderVisitor.java:235) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.MethodPathBuilderVisitor._visit(MethodPathBuilderVisitor.java:130) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.MethodPathBuilderVisitor._visit(MethodPathBuilderVisitor.java:159) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.MethodPathBuilderVisitor.apply(MethodPathBuilderVisitor.java:97) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.AbstractApexVertexBuilder.afterInsert(AbstractApexVertexBuilder.java:169) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.AbstractApexVertexBuilder.buildVertices(AbstractApexVertexBuilder.java:153) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.AbstractApexVertexBuilder.buildVertices(AbstractApexVertexBuilder.java:125) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.AbstractApexVertexBuilder.buildVertices(AbstractApexVertexBuilder.java:35) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.CustomerApexVertexBuilder.build(CustomerApexVertexBuilder.java:21) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.build.Util.buildGraph(Util.java:39) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.graph.ops.GraphUtil.loadSourceFolders(GraphUtil.java:170) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.Main$Dependencies.loadSourceFoldersToGraph(Main.java:252) ~[sfge-1.0.1-pilot.jar:?]
at com.salesforce.Main.execute(Main.java:151) [sfge-1.0.1-pilot.jar:?]
at com.salesforce.Main.process(Main.java:101) [sfge-1.0.1-pilot.jar:?]
at com.salesforce.Main.main(Main.java:69) [sfge-1.0.1-pilot.jar:?]

Steps To Reproduce

run next command in 2GP project:
sf scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target ./ --projectdir ./ --category Security

Expected Behavior

successfully running scanner with required parameters

Operating System

MacOS Monterey 12.7.6 (21H1320)

Salesforce CLI Version

@salesforce/cli/2.55.6 darwin-x64 node-v20.16.0

Code Analyzer Plugin (@salesforce/sfdx-scanner) Version

@salesforce/sfdx-scanner 4.4.0 (4.4.0)

Java Version

Java HotSpot(TM) 64-Bit Server VM (build 17.0.12+8-LTS-286, mixed mode, sharing)

Additional Context (Screenshots, Files, etc)

No response

Workaround

No response

Urgency

High

@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SFGE Issues related to the Salesforce Graph Engine
Projects
None yet
Development

No branches or pull requests

2 participants