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] Consolidation of InternalExecutionError for "manual verify that you have a sanitizer" issues. #1497

Open
stephen-carter-at-sf opened this issue Jun 3, 2024 · 17 comments
Labels
BUG P3 Rarely Malfunction SFGE Issues related to the Salesforce Graph Engine

Comments

@stephen-carter-at-sf
Copy link
Collaborator

stephen-carter-at-sf commented Jun 3, 2024

Have you tried to resolve this issue yourself first?

Yes

Bug Description

The Salesforce Graph Engine has a number of cases that currently not supported. These manifest themselves to users with an error message that says:

Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace:
...

Since this is occurring more frequently, we would like to consolidate all user reported cases in this issue to clean up our issue backlog.

If you have received this error. Please add a comment below with your stack trace instead of creating a new issue. Otherwise, the issue you create will just be duplicated to this one.

Output / Logs

No response

Steps To Reproduce

sf scanner run dfa ...

Expected Behavior

People expect this to just work and give proper violation messages instead of telling them to create an issue for our team to look at.

Operating System

Various

Salesforce CLI Version

Various

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

Various

Java Version

Various

Additional Context (Screenshots, Files, etc)

No response

Workaround

No response

Urgency

Low

@stephen-carter-at-sf
Copy link
Collaborator Author

stephen-carter-at-sf commented Jun 3, 2024

Issues where this has been reported:

This was referenced Jun 3, 2024
@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label Jun 3, 2024
@stephen-carter-at-sf stephen-carter-at-sf added the BUG P3 Rarely Malfunction label Jun 3, 2024
Copy link

git2gus bot commented Jun 3, 2024

This issue has been linked to a new work item: W-15923250

@jason-actico
Copy link

jason-actico commented Jun 7, 2024

I'm facing this same issue and I need to submit my org for a security review this week.
Should I go ahead and submit it or will this violation cause me to fail the security review?

Correct me if I'm wrong, but this is a bug in the Salesforce Code Analyzer, right?

@rmohan20 @stephen-carter-at-sf

@yippie
Copy link

yippie commented Jun 17, 2024

I just received this error:

Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: NullPointerException: null: java.base/java.util.concurrent.ConcurrentSkipListMap.computeIfAbsent(ConcurrentSkipListMap.java:1459);com.salesforce.graph.vertex.SyntheticTypedVertex.get(SyntheticTypedVertex.java:41);com.salesforce.graph.symbols.apex.ApexMapValue.apply(ApexMapValue.java:188);com.salesforce.graph.symbols.PathScopeVisitor.handleApexValueMethod(PathScopeVisitor.java:1487);com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:1242);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:800)

@jvg123
Copy link

jvg123 commented Jun 22, 2024

We received 6 of these, all with identical error and stack:

UnexpectedException: 
BooleanExpression{properties={FirstChild=false, Operator=&&, BeginLine=35, DefiningType_CaseSafe=utils, LastChild=false, DefiningType=Utils, EndLine=35, childIdx=1, BeginColumn=14}}: com.salesforce.graph.ops.MethodTypeMatchUtil.getTypeFromSymbol(MethodTypeMatchUtil.java:167);
com.salesforce.graph.ops.MethodTypeMatchUtil.parameterTypesMatch(MethodTypeMatchUtil.java:150);
com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:358);
com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:158);
com.salesforce.graph.ops.MethodUtil.getPaths(MethodUtil.java:703);
com.salesforce.graph.ops.expander.ApexPathExpander.resolveMethodCall(ApexPathExpander.java:849)

Example code structure (names changed):

public with sharing class SubClass extends BaseClass{
    @AuraEnabled
    public static CustomApexType[] methodName(
        String someId,
        String anotherId
    ) {
        return BaseClass.methodName(
            new SubClass(null, someId),
            anotherId
        );
    }
}

Side note: adding /* sfge-disable-stack ApexFlsViolationRule */ to these methods has no effect

@nCinoel
Copy link

nCinoel commented Jul 12, 2024

Hey guys, just reporting our issues with the DFA scanner here. Seeing this InternalExecutionError in a few spots:

1. SObjectType.newSObject(recordTypeId, loadDefaultValues)

UnexpectedException: MethodCallExpressionVertex{fullMethodName=sObjType.newSObject, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[sObjType], BeginLine=22, DefiningType_CaseSafe=OUR_APEX_CLASS_HERE, LastChild=false, DefiningType=OUR_APEX_CLASS_HERE, EndLine=22, Name_CaseSafe=sobjtype, childIdx=0, BeginColumn=28, ReferenceType=METHOD, Name=sObjType}}}, chainedNames=[sObjType], properties={FirstChild=true, FullMethodName=sObjType.newSObject, BeginLine=22, FullMethodName_CaseSafe=sobjtype.newsobject, DefiningType_CaseSafe=OUR_APEX_CLASS_HERE, LastChild=false, DefiningType=OUR_APEX_CLASS_HERE, EndLine=22, MethodName_CaseSafe=newsobject, childIdx=0, BeginColumn=37, MethodName=newSObject}}: com.salesforce.graph.symbols.apex.ApexValue.validateParameterSize(ApexValue.java:610);com.salesforce.graph.symbols.apex.schema.SObjectType._applyMethod(SObjectType.java:131);com.salesforce.graph.symbols.apex.schema.SObjectType.executeMethod(SObjectType.java:121);com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681)

We were NOT able to find a workaround for this. We attempted to add /* sfge-disable InternalExecutionError */ above, but that didn't stop the scan from failing.

It seems to be an issue specifically with calling: SObject objectInstance = sObjType.newSObject('someRecordTypeId', true); Looks like this was reported before in #1175, but we can't do the workaround described there as we need to load the default values in.

2. Decimal.abs()

UnexpectedException: MethodCallExpressionVertex{fullMethodName=sObjType.newSObject, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[sObjType], BeginLine=22, DefiningType_CaseSafe=OUR_APEX_CLASS_HERE, LastChild=false, DefiningType=OUR_APEX_CLASS_HERE, EndLine=22, Name_CaseSafe=sobjtype, childIdx=0, BeginColumn=28, ReferenceType=METHOD, Name=sObjType}}}, chainedNames=[sObjType], properties={FirstChild=true, FullMethodName=sObjType.newSObject, BeginLine=22, FullMethodName_CaseSafe=sobjtype.newsobject, DefiningType_CaseSafe=OUR_APEX_CLASS_HERE, LastChild=false, DefiningType=OUR_APEX_CLASS_HERE, EndLine=22, MethodName_CaseSafe=newsobject, childIdx=0, BeginColumn=37, MethodName=newSObject}}: com.salesforce.graph.symbols.apex.ApexValue.validateParameterSize(ApexValue.java:610);com.salesforce.graph.symbols.apex.schema.SObjectType._applyMethod(SObjectType.java:131);com.salesforce.graph.symbols.apex.schema.SObjectType.executeMethod(SObjectType.java:121);com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681)

The offending code seems to be when we use Decimal.abs() like this:

private static Boolean canFilterInteger(Decimal value) {
	if (value.abs() > 2147483647) {
		return false;
	}
	return true;
}

Replacing it with this works around the issue for us:

private static Boolean canFilterInteger(Decimal value) {
	final Decimal MAX_INTEGER = 2147483647;
	if (value > MAX_INTEGER || value < -MAX_INTEGER) {
		return false;
	}
	return true;
}

3. Database.query()

ClassCastException: class com.salesforce.graph.vertex.BinaryExpressionVertex cannot be cast to class com.salesforce.graph.vertex.SoqlExpressionVertex (com.salesforce.graph.vertex.BinaryExpressionVertex and com.salesforce.graph.vertex.SoqlExpressionVertex are in unnamed module of loader 'app'): com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.buildSanitizedValue(SObjectAccessDecision.java:171);com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.executeMethod(SObjectAccessDecision.java:112);com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532)

We have a typical Database.query() call that is failing with the error above. Replacing this with Database.queryWithBinds() with an empty binds map seems to get rid of this error, but not entirely sure if that's the root cause.

Let me know if you need any additional information for these! Thanks!

@dinghongyan
Copy link

sfge.log

sfdx-scanner: 4.3.2
java : 1.8.0_421
salesforce cli : 2.30.8 win32-x64 node-v20.11.1

reproduce: sf scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target ./ --projectdir ./force-app --category Security

List<ACustomObject__c> aList= new List<ACustomObject__c>();
//... add objects to alist
Database.UpsertResult[] srList = Database.upsert(
      aList,
      ACustomObject__c.Fields.afield__c
      false,
      AccessLevel.USER_MODE
    );

I try to change the code like this:

List<ACustomObject__c> aList= new List<ACustomObject__c>();
//... add objects to alist

Schema.DescribeFieldResult describeFieldResult = ACustomObject__c.afield__c.getDescribe();
Database.UpsertResult[] srList = Database.upsert(
      aList,
      describeFieldResult.getSobjectField()
      false,
      AccessLevel.USER_MODE
    );
      

still get the same error.

@nzhdanova-intellective
Copy link

Hi,
I have several "manual verify that you have a sanitizer" errors:
1.
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: ClassCastException: class com.salesforce.graph.vertex.DefaultVertex cannot be cast to class com.salesforce.graph.vertex.VariableExpressionVertex (com.salesforce.graph.vertex.DefaultVertex and com.salesforce.graph.vertex.VariableExpressionVertex are in unnamed module of loader 'app'): com.salesforce.graph.vertex.AssignmentExpressionVertex.getLhs(AssignmentExpressionVertex.java:70); com.salesforce.graph.symbols.PathScopeVisitor.visit(PathScopeVisitor.java:739); com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.visit(DefaultSymbolProviderVertexVisitor.java:360); com.salesforce.graph.vertex.AssignmentExpressionVertex.visit(AssignmentExpressionVertex.java:27); com.salesforce.graph.ops.expander.ApexPathExpander.shouldVisitChildren(ApexPathExpander.java:573); com.salesforce.graph.ops.expander.ApexPathExpander.lambda$visit$1(ApexPathExpander.java:519)
2.
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: Did not expect NOT_A_MATCH when ranking parameter match. parameterType = LdConfig.Field, type = OrderedTreeSet{internalList=[NULL, Object]}: com.salesforce.graph.ops.TypeableUtil.rankParameterMatch(TypeableUtil.java:211); com.salesforce.graph.vertex.Typeable.rankParameterMatch(Typeable.java:41); com.salesforce.graph.ops.MethodTypeMatchUtil.getMatchRank(MethodTypeMatchUtil.java:191); com.salesforce.graph.ops.MethodTypeMatchUtil.parameterTypesMatch(MethodTypeMatchUtil.java:128); com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:358); com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:158)
3.
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ArrayLoadExpression{properties={FirstChild=false, BeginLine=40, DefiningType_CaseSafe=ldpagebuilder, LastChild=true, DefiningType=LdPageBuilder, EndLine=40, childIdx=3, BeginColumn=13}}: com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:761); com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737); com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58); com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577); com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536); com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523)

@jag-j
Copy link
Collaborator

jag-j commented Aug 12, 2024

We have a couple of new bugs created in this category - #1562 and #1568. This is the error text: Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ArrayLoadExpression{properties={FirstChild=false, BeginLine=75, DefiningType_CaseSafe=requestbriefingcontroller, LastChild=true, DefiningType=RequestBriefingController, EndLine=79, childIdx=1, BeginColumn=34}}: com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:761);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737);com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58);com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523)

@jag-j jag-j closed this as completed Aug 12, 2024
@jag-j jag-j reopened this Aug 12, 2024
@nzhdanova-intellective
Copy link

nzhdanova-intellective commented Aug 12, 2024

Hi,
one more error of the same kind:
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ApexValue(ApexSingleValue) {status=INDETERMINANT, declarationVertex=com.salesforce.graph.vertex.SyntheticTypedVertex@57e84b28, valueVertex=null, resolvedValues={}, returnedFrom=ApexValue(ApexListValue) {status=INITIALIZED, declarationVertex=null, valueVertex=NewListInitExpression{properties={FirstChild=false, BeginLine=9, Type=List, DefiningType_CaseSafe=ldsearchquerybuilder, LastChild=true, DefiningType=LdSearchQueryBuilder, EndLine=9, childIdx=1, BeginColumn=33}}, resolvedValues={}, returnedFrom=null, invocableExpression=null, method=null}, invocableExpression=MethodCallExpressionVertex{fullMethodName=sorting.get, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[sorting], BeginLine=192, DefiningType_CaseSafe=ldsearchquerybuilder, LastChild=false, DefiningType=LdSearchQueryBuilder, EndLine=192, Name_CaseSafe=sorting, childIdx=0, BeginColumn=30, ReferenceType=METHOD, Name=sorting}}}, chainedNames=[sorting], properties={FirstChild=true, FullMethodName=sorting.get, BeginLine=192, FullMethodName_CaseSafe=sorting.get, DefiningType_CaseSafe=ldsearchquerybuilder, LastChild=true, DefiningType=LdSearchQueryBuilder, EndLine=192, MethodName_CaseSafe=get, childIdx=0, BeginColumn=38, MethodName=get}}, method=null}: com.salesforce.graph.symbols.PathScopeVisitor.getIndeterminantArrayLoadValue(PathScopeVisitor.java:894); com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:810); com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737); com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58); com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577); com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536)
Code:

  private String buildOffsetByValueCondition(
    String objectName,
    List<String> sorting,
    LdDto.LastRecord last
  ) {
    if (null == sorting || sorting.size() < 1 || String.isEmpty(sorting.get(0)) || !sorting.get(0).contains(' ')) {
      throw new IllegalArgumentException('Invalid sorting parameter passed: ' + sorting);
    }
    String[] fieldAndOrder = sorting.get(0).split(' '); // line 192
    ...
}

@nzhdanova-intellective
Copy link

And another one:

Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: NoSuchElementException: No value present: 
java.base/java.util.Optional.get(Optional.java:148);
com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:935);
com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:744);
com.salesforce.graph.vertex.AssignmentExpressionVertex.afterVisit(AssignmentExpressionVertex.java:37);
com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577);
com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536)

Logs:

2024-08-14 19:53:56  INFO  AbstractMetadataInfoImpl:81 - Loading [] as known custom settings. Thread: Thread[main,5,main]
2024-08-14 19:53:56  INFO  ThreadableRuleExecutor:100 - Queued 2 path-based rule executions
2024-08-14 19:53:56  INFO  ThreadableRuleExecutor:50 - Beginning wait #1
2024-08-14 19:53:58 4a67717b-d428-4ec2-bdc1-b4f8c8839e8e INFO  PathExpansionRegistry:79 - Path expansion limit has been set to 2490 based on max allocated heap space 6396313600 bytes.
2024-08-14 19:53:59 060b908a-10a0-4718-bddc-fcb3e162d3d8 INFO  PathExpansionRegistry:79 - Path expansion limit has been set to 2490 based on max allocated heap space 6396313600 bytes.
2024-08-14 19:53:59 060b908a-10a0-4718-bddc-fcb3e162d3d8 WARN  ApexPathExpanderUtil:233 - expand-Finished.
2024-08-14 19:53:59 060b908a-10a0-4718-bddc-fcb3e162d3d8 INFO  PathExpansionRegistry:79 - Path expansion limit has been set to 2490 based on max allocated heap space 6396313600 bytes.
2024-08-14 19:53:59 060b908a-10a0-4718-bddc-fcb3e162d3d8 WARN  ApexPathExpanderUtil:233 - expand-Finished.
2024-08-14 19:53:59 060b908a-10a0-4718-bddc-fcb3e162d3d8 INFO  PathExpansionRegistry:79 - Path expansion limit has been set to 2490 based on max allocated heap space 6396313600 bytes.
2024-08-14 19:54:02 4a67717b-d428-4ec2-bdc1-b4f8c8839e8e ERROR ApexPathExpanderUtil:297 - Incomplete. Current ApexPathExpanders size=0
java.util.NoSuchElementException: No value present
	at java.util.Optional.get(Optional.java:148) ~[?:?]
	at com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:935) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:744) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.vertex.AssignmentExpressionVertex.afterVisit(AssignmentExpressionVertex.java:37) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler.expand(ApexPathExpanderUtil.java:222) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler.expand(ApexPathExpanderUtil.java:160) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler._expand(ApexPathExpanderUtil.java:94) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil.expand(ApexPathExpanderUtil.java:53) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.ApexPathUtil.getPaths(ApexPathUtil.java:201) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.ApexPathUtil.summarizeForwardPaths(ApexPathUtil.java:80) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.PathBasedRuleRunner.getPathSummary(PathBasedRuleRunner.java:240) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.PathBasedRuleRunner.runRules(PathBasedRuleRunner.java:80) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.runRules(ThreadableRuleExecutor.java:228) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.call(ThreadableRuleExecutor.java:165) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.call(ThreadableRuleExecutor.java:125) [sfge-1.0.1-pilot.jar:?]
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:408) [?:?]
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:736) [?:?]
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.run(ForkJoinTask.java:1456) [?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
2024-08-14 19:54:02 4a67717b-d428-4ec2-bdc1-b4f8c8839e8e ERROR ApexPathExpanderUtil:98 - Incomplete. Current PathCollector size=0
java.util.NoSuchElementException: No value present
	at java.util.Optional.get(Optional.java:148) ~[?:?]
	at com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:935) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:744) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.vertex.AssignmentExpressionVertex.afterVisit(AssignmentExpressionVertex.java:37) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler.expand(ApexPathExpanderUtil.java:222) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler.expand(ApexPathExpanderUtil.java:160) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler._expand(ApexPathExpanderUtil.java:94) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil.expand(ApexPathExpanderUtil.java:53) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.ApexPathUtil.getPaths(ApexPathUtil.java:201) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.ApexPathUtil.summarizeForwardPaths(ApexPathUtil.java:80) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.PathBasedRuleRunner.getPathSummary(PathBasedRuleRunner.java:240) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.PathBasedRuleRunner.runRules(PathBasedRuleRunner.java:80) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.runRules(ThreadableRuleExecutor.java:228) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.call(ThreadableRuleExecutor.java:165) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.call(ThreadableRuleExecutor.java:125) [sfge-1.0.1-pilot.jar:?]
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:408) [?:?]
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:736) [?:?]
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.run(ForkJoinTask.java:1456) [?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
2024-08-14 19:54:02  ERROR ThreadableRuleExecutor:206 - Internal Error executing rule. submission=RuleRunnerSubmission{pathEntry=Method{properties={FirstChild=false, BeginLine=48, DefiningType_CaseSafe=ldsearchcontroller, LastChild=false, DefiningType=LdSearchController, Constructor=false, EndLine=48, Name_CaseSafe=findbyid, childIdx=2, ReturnType=LdDto.Response, Name=findById, Arity=1, ReturnType_CaseSafe=lddto.response, BeginColumn=32}}, rules=[com.salesforce.rules.ApexFlsViolationRule@2707a093, com.salesforce.rules.UseWithSharingOnDatabaseOperation@4831dcd4]}
java.util.NoSuchElementException: No value present
	at java.util.Optional.get(Optional.java:148) ~[?:?]
	at com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:935) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:744) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.vertex.AssignmentExpressionVertex.afterVisit(AssignmentExpressionVertex.java:37) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:676) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:452) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler.expand(ApexPathExpanderUtil.java:222) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler.expand(ApexPathExpanderUtil.java:160) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil$ApexPathExpansionHandler._expand(ApexPathExpanderUtil.java:94) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.expander.ApexPathExpanderUtil.expand(ApexPathExpanderUtil.java:53) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.ApexPathUtil.getPaths(ApexPathUtil.java:201) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.graph.ops.ApexPathUtil.summarizeForwardPaths(ApexPathUtil.java:80) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.PathBasedRuleRunner.getPathSummary(PathBasedRuleRunner.java:240) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.PathBasedRuleRunner.runRules(PathBasedRuleRunner.java:80) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.runRules(ThreadableRuleExecutor.java:228) ~[sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.call(ThreadableRuleExecutor.java:165) [sfge-1.0.1-pilot.jar:?]
	at com.salesforce.rules.ThreadableRuleExecutor$CallableExecutor.call(ThreadableRuleExecutor.java:125) [sfge-1.0.1-pilot.jar:?]
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:408) [?:?]
	at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:736) [?:?]
	at java.util.concurrent.ForkJoinTask$AdaptedCallable.run(ForkJoinTask.java:1456) [?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
2024-08-14 19:54:02  INFO  ThreadableRuleExecutor:214 - Finished. method=LdSearchController:findById:48
2024-08-14 19:54:02  INFO  ThreadableRuleExecutor:117 - Future returned after 5617 ms
2024-08-14 19:54:02  INFO  ThreadableRuleExecutor:57 - Wait #1 finished, adding 0 new entries

@AyushMamgain24
Copy link

Hello I am also facing Internal Execution Error:

1- Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ArrayLoadExpression{properties={FirstChild=true, BeginLine=105, DefiningType_CaseSafe=conversationcontroller.conversationwrapper, LastChild=true, DefiningType=ConversationController.ConversationWrapper, EndLine=105, childIdx=0, BeginColumn=84}}: com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:761);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737);com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58);com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:523)

2- Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ApexValue(ApexSingleValue) {status=INDETERMINANT, declarationVertex=com.salesforce.graph.vertex.SyntheticTypedVertex@7905a6eb, valueVertex=null, resolvedValues={}, returnedFrom=ApexValue(ApexMapValue) {status=INDETERMINANT, declarationVertex=VariableDeclaration{properties={FirstChild=false, BeginLine=324, Type=Map<String,Object>, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=324, Name_CaseSafe=responsedata, childIdx=1, BeginColumn=33, Name=responseData}}, valueVertex=MethodCallExpressionVertex{fullMethodName=JSON.deserializeUntyped, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[JSON], BeginLine=324, DefiningType_CaseSafe=messagesender, LastChild=false, DefiningType=MessageSender, EndLine=324, Name_CaseSafe=json, childIdx=0, BeginColumn=70, ReferenceType=METHOD, Name=JSON}}}, chainedNames=[JSON], properties={FirstChild=true, FullMethodName=JSON.deserializeUntyped, BeginLine=324, FullMethodName_CaseSafe=json.deserializeuntyped, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=324, MethodName_CaseSafe=deserializeuntyped, childIdx=0, BeginColumn=75, MethodName=deserializeUntyped}}, resolvedValues={}, returnedFrom=null, invocableExpression=null, method=null}, invocableExpression=MethodCallExpressionVertex{fullMethodName=responseData.get, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[responseData], BeginLine=326, DefiningType_CaseSafe=messagesender, LastChild=false, DefiningType=MessageSender, EndLine=326, Name_CaseSafe=responsedata, childIdx=0, BeginColumn=56, ReferenceType=METHOD, Name=responseData}}}, chainedNames=[responseData], properties={FirstChild=true, FullMethodName=responseData.get, BeginLine=326, FullMethodName_CaseSafe=responsedata.get, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=326, MethodName_CaseSafe=get, childIdx=0, BeginColumn=69, MethodName=get}}, method=null}: com.salesforce.graph.symbols.PathScopeVisitor.getIndeterminantArrayLoadValue(PathScopeVisitor.java:894);com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:810);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737);com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58);com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536)

3- Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: ClassCastException: class com.salesforce.graph.vertex.VariableExpressionVertex$Single cannot be cast to class com.salesforce.graph.vertex.SoqlExpressionVertex (com.salesforce.graph.vertex.VariableExpressionVertex$Single and com.salesforce.graph.vertex.SoqlExpressionVertex are in unnamed module of loader 'app'): com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.buildSanitizedValue(SObjectAccessDecision.java:171);com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.executeMethod(SObjectAccessDecision.java:112);com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532)

4- Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: ApexValue(ApexSingleValue) {status=INDETERMINANT, declarationVertex=com.salesforce.graph.vertex.SyntheticTypedVertex@7905a6eb, valueVertex=null, resolvedValues={}, returnedFrom=ApexValue(ApexMapValue) {status=INDETERMINANT, declarationVertex=VariableDeclaration{properties={FirstChild=false, BeginLine=324, Type=Map<String,Object>, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=324, Name_CaseSafe=responsedata, childIdx=1, BeginColumn=33, Name=responseData}}, valueVertex=MethodCallExpressionVertex{fullMethodName=JSON.deserializeUntyped, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[JSON], BeginLine=324, DefiningType_CaseSafe=messagesender, LastChild=false, DefiningType=MessageSender, EndLine=324, Name_CaseSafe=json, childIdx=0, BeginColumn=70, ReferenceType=METHOD, Name=JSON}}}, chainedNames=[JSON], properties={FirstChild=true, FullMethodName=JSON.deserializeUntyped, BeginLine=324, FullMethodName_CaseSafe=json.deserializeuntyped, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=324, MethodName_CaseSafe=deserializeuntyped, childIdx=0, BeginColumn=75, MethodName=deserializeUntyped}}, resolvedValues={VariableExpression{properties={FirstChild=false, BeginLine=324, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=324, Name_CaseSafe=responsebody, childIdx=1, BeginColumn=94, Name=responseBody}}=MethodCallExpressionVertex{fullMethodName=response.getBody, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[response], BeginLine=102, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=102, Name_CaseSafe=response, childIdx=0, BeginColumn=20, ReferenceType=METHOD, Name=response}}}, chainedNames=[response], properties={FirstChild=true, FullMethodName=response.getBody, BeginLine=102, FullMethodName_CaseSafe=response.getbody, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=102, MethodName_CaseSafe=getbody, childIdx=0, BeginColumn=29, MethodName=getBody}}}, returnedFrom=null, invocableExpression=null, method=null}, invocableExpression=MethodCallExpressionVertex{fullMethodName=responseData.get, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[responseData], BeginLine=326, DefiningType_CaseSafe=messagesender, LastChild=false, DefiningType=MessageSender, EndLine=326, Name_CaseSafe=responsedata, childIdx=0, BeginColumn=56, ReferenceType=METHOD, Name=responseData}}}, chainedNames=[responseData], properties={FirstChild=true, FullMethodName=responseData.get, BeginLine=326, FullMethodName_CaseSafe=responsedata.get, DefiningType_CaseSafe=messagesender, LastChild=true, DefiningType=MessageSender, EndLine=326, MethodName_CaseSafe=get, childIdx=0, BeginColumn=69, MethodName=get}}, method=null}: com.salesforce.graph.symbols.PathScopeVisitor.getIndeterminantArrayLoadValue(PathScopeVisitor.java:894);com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:810);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:737);com.salesforce.graph.vertex.ArrayLoadExpressionVertex.afterVisit(ArrayLoadExpressionVertex.java:58);com.salesforce.graph.ops.expander.ApexPathExpander.performAfterVisit(ApexPathExpander.java:577);com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:536)

@nzhdanova-intellective
Copy link

Hi,

One more error:

Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: MethodCallExpressionVertex{fullMethodName=curValues.sort, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[curValues], BeginLine=48, DefiningType_CaseSafe=ldpagebuilder, LastChild=false, DefiningType=LdPageBuilder, EndLine=48, Name_CaseSafe=curvalues, childIdx=0, BeginColumn=7, ReferenceType=METHOD, Name=curValues}}}, chainedNames=[curValues], properties={FirstChild=true, FullMethodName=curValues.sort, BeginLine=48, FullMethodName_CaseSafe=curvalues.sort, DefiningType_CaseSafe=ldpagebuilder, LastChild=true, DefiningType=LdPageBuilder, EndLine=48, MethodName_CaseSafe=sort, childIdx=0, BeginColumn=17, MethodName=sort}}: 
com.salesforce.graph.symbols.apex.ApexValue.validateParameterSize(ApexValue.java:610);
com.salesforce.graph.symbols.apex.ApexListValue.apply(ApexListValue.java:306);
com.salesforce.graph.symbols.PathScopeVisitor.handleApexValueMethod(PathScopeVisitor.java:1487);
com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:1242);
com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:800);
com.salesforce.graph.vertex.MethodCallExpressionVertex.afterVisit(MethodCallExpressionVertex.java:79)

Code:

      if (curValues.isEmpty()) {
        break;
      }
      curValues.sort(compare); // line 48 in ldpagebuilder

curValues variable type: List<LdSorting.ValueForSort> (list of custom objects).
compare variable type: LdSorting.ReversibleComparator (implements Comparator<LdSorting.ValueForSort>)

@hansalves
Copy link

One more:

Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. 
Error and stacktrace: ClassCastException: class com.salesforce.graph.vertex.VariableExpressionVertex$Single cannot be cast to class com.salesforce.graph.vertex.SoqlExpressionVertex (com.salesforce.graph.vertex.VariableExpressionVertex$Single and com.salesforce.graph.vertex.SoqlExpressionVertex are in unnamed module of loader 'app'):
com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.buildSanitizedValue(SObjectAccessDecision.java:171);
com.salesforce.graph.symbols.apex.system.SObjectAccessDecision.executeMethod(SObjectAccessDecision.java:112);
com.salesforce.graph.symbols.PathScopeVisitor.afterMethodCall(PathScopeVisitor.java:659);
com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterMethodCall(DefaultSymbolProviderVertexVisitor.java:318);
com.salesforce.graph.ops.expander.ApexPathExpander.handleMethodCall(ApexPathExpander.java:681);
com.salesforce.graph.ops.expander.ApexPathExpander.visit(ApexPathExpander.java:532)

@elerno
Copy link

elerno commented Dec 10, 2024

Hi, we're getting a few of these. We tried adding Engine Directives, but these had no effect.

Thanks for your attention and any help you can lend. We have Security Re-Review coming up...

Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: com.salesforce.graph.vertex.NewKeyValueObjectExpressionVertex.<init>(java.util.Map, java.lang.Object): com.salesforce.graph.vertex.SFVertexFactory.load(SFVertexFactory.java:245);com.salesforce.graph.vertex.SFVertexFactory$1.apply(SFVertexFactory.java:186);com.salesforce.graph.vertex.SFVertexFactory$1.apply(SFVertexFactory.java:183);com.salesforce.graph.cache.AbstractVertexCacheImpl.get(AbstractVertexCacheImpl.java:101);com.salesforce.graph.vertex.SFVertexFactory.loadVertices(SFVertexFactory.java:180);com.salesforce.graph.vertex.LazyVertexList.initialize(LazyVertexList.java:47)
2.
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: NoSuchElementException: No value present: java.base/java.util.Optional.get(Optional.java:148);com.salesforce.graph.symbols.apex.ApexStringValueFactory.stringValueOf(ApexStringValueFactory.java:230);com.salesforce.graph.symbols.apex.ApexStringValueFactory.lambda$static$0(ApexStringValueFactory.java:67);com.salesforce.graph.ops.ApexStandardLibraryUtil.getStandardType(ApexStandardLibraryUtil.java:155);com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:1244);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:800)
3.
Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: NullPointerException: null: java.base/java.util.concurrent.ConcurrentSkipListMap.computeIfAbsent(ConcurrentSkipListMap.java:1458);com.salesforce.graph.vertex.SyntheticTypedVertex.get(SyntheticTypedVertex.java:41);com.salesforce.graph.symbols.apex.ApexMapValue.apply(ApexMapValue.java:188);com.salesforce.graph.symbols.PathScopeVisitor.handleApexValueMethod(PathScopeVisitor.java:1487);com.salesforce.graph.symbols.PathScopeVisitor.afterVisit(PathScopeVisitor.java:1242);com.salesforce.graph.symbols.DefaultSymbolProviderVertexVisitor.afterVisit(DefaultSymbolProviderVertexVisitor.java:800)

@renepanke
Copy link

renepanke commented Dec 17, 2024

Did not expect NOT_A_MATCH when ranking parameter match.

Command

sf scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target ./ --projectdir ./ --category Security --rule-thread-timeout 9000000

Error

Full CSV

"2","3","C:\<REDACTED>\force-app\main\default\classes\<REDACTED>TriggerHandler.cls","60","17","<REDACTED>TriggerHandler","handleVirtualInsertTrigger","","","","InternalExecutionError","Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: UnexpectedException: Did not expect NOT_A_MATCH when ranking parameter match. parameterType = SObject, type = OrderedTreeSet{internalList=[NULL, Object]}: com.salesforce.graph.ops.TypeableUtil.rankParameterMatch(TypeableUtil.java:211);com.salesforce.graph.vertex.Typeable.rankParameterMatch(Typeable.java:41);com.salesforce.graph.ops.MethodTypeMatchUtil.getMatchRank(MethodTypeMatchUtil.java:191);com.salesforce.graph.ops.MethodTypeMatchUtil.parameterTypesMatch(MethodTypeMatchUtil.java:136);com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:358);com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:158)","https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/apexflsviolation-rule.html","InternalExecutionError","sfge"

Error and Stacktrace

UnexpectedException: Did not expect NOT_A_MATCH when ranking parameter match.
parameterType = SObject, type = OrderedTreeSet{internalList=[NULL, Object]}: 
com.salesforce.graph.ops.TypeableUtil.rankParameterMatch(TypeableUtil.java:211);
com.salesforce.graph.vertex.Typeable.rankParameterMatch(Typeable.java:41);
com.salesforce.graph.ops.MethodTypeMatchUtil.getMatchRank(MethodTypeMatchUtil.java:191);
com.salesforce.graph.ops.MethodTypeMatchUtil.parameterTypesMatch(MethodTypeMatchUtil.java:136);
com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:358);
com.salesforce.graph.ops.MethodUtil.getInvoked(MethodUtil.java:158)

Source line

global void handleVirtualInsertTrigger(String <REDACTED>, List<SObject> objs, String contentVersionFilterSoql, String sobjectFilterSoql, String webhookUrl, String webhookToken, String webhookTargetHeaderName, Map<String, Set<String>> fieldsUsedInSoql) {

Source column

The space after global void corresponds to the source column of this error.

@renepanke
Copy link

renepanke commented Dec 17, 2024

Cannot handle object value with more than one name

Command

sf scanner run dfa --format csv --outfile CodeAnalyzerDFA.csv --target ./ --projectdir ./ --category Security --rule-thread-timeout 9000000

Error

Full CSV

"5","3","C:\<REDACTED>\force-app\main\default\classes\<REDACTED>TriggerHandler.cls","176","17","<REDACTED>TriggerHandler","handleVirtualUpdateTriggerForSObject","","","","InternalExecutionError","Graph Engine identified your source and sink, but you must manually verify that you have a sanitizer in this path. Then, add an engine directive to skip the path. Next, create a Github issue for the Code Analyzer team that includes the error and stack trace. After we fix this issue, check the Code Analyzer release notes for more info. Error and stacktrace: TodoException: Cannot handle object value with more than one name: [ContentDocument, ContentDocumentLink]: com.salesforce.rules.fls.apex.operations.ObjectBasedCheckUtil.getObjectName(ObjectBasedCheckUtil.java:103);com.salesforce.rules.fls.apex.operations.ObjectBasedCheckUtil.isCrudCheckExpected(ObjectBasedCheckUtil.java:71);com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.isCheckLevelValid(SchemaBasedValidationAnalyzer.java:199);com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.convert(SchemaBasedValidationAnalyzer.java:174);com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.checkForValidation(SchemaBasedValidationAnalyzer.java:77);com.salesforce.rules.fls.apex.operations.FlsValidationCentral.checkSchemaBasedFlsValidation(FlsValidationCentral.java:71)","https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/apexflsviolation-rule.html","InternalExecutionError","sfge"

Error and Stacktrace

TodoException: Cannot handle object value with more than one name: 
[ContentDocument, ContentDocumentLink]: 
com.salesforce.rules.fls.apex.operations.ObjectBasedCheckUtil.getObjectName(ObjectBasedCheckUtil.java:103);
com.salesforce.rules.fls.apex.operations.ObjectBasedCheckUtil.isCrudCheckExpected(ObjectBasedCheckUtil.java:71);
com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.isCheckLevelValid(SchemaBasedValidationAnalyzer.java:199);
com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.convert(SchemaBasedValidationAnalyzer.java:174);
com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.checkForValidation(SchemaBasedValidationAnalyzer.java:77);
com.salesforce.rules.fls.apex.operations.FlsValidationCentral.checkSchemaBasedFlsValidation(FlsValidationCentral.java:71)

Source line

global void handleVirtualUpdateTriggerForSObject(String <REDACTED>, Map<Id, SObject> oldObjects, Map<Id, SObject> newObjects, String contentVersionFilterSoql, String sobjectFilterSoql, Set<String> contentVersionFilterFields, Set<String> sobjectFilterFields, String webhookUrl, String webhookToken, String webhookTargetHeaderName, Map<String, Set<String>> fieldsUsedInSoql) {

Source column

The space after global void corresponds to the source column of this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG P3 Rarely Malfunction SFGE Issues related to the Salesforce Graph Engine
Projects
None yet
Development

No branches or pull requests