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: SObjectType is not available in DescribeSObjectResult #1216

Closed
ppillai7777 opened this issue Oct 7, 2023 · 4 comments
Labels
BUG P3 Rarely Malfunction duplicate This issue or pull request already exists SFGE Issues related to the Salesforce Graph Engine

Comments

@ppillai7777
Copy link

Ran the graph engine scan on our application source as shown below and report shows the InternalExecutionError rules.

sfdx scanner:run:dfa --format=csv --outfile=CodeAnalyzerDFA9.csv --target="./" --projectdir="./" --category="Security" --sfgejvmargs "-Xmx30g" --pathexplimit -1 --rule-thread-count 2 --rule-thread-timeout 21600000

Description column shows the following:
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: SObjectType is not available in DescribeSObjectResult: ApexStandardValue{apexType='Schema.DescribeSObjectResult'} ApexValue(DescribeSObjectResult) {status=INITIALIZED, declarationVertex=null, valueVertex=null, resolvedValues={}, returnedFrom=ApexStandardValue{apexType='Schema.SObjectField'} ApexValue(SObjectField) {status=INITIALIZED, declarationVertex=null, valueVertex=null, resolvedValues={}, returnedFrom=ApexValue(ApexFieldDescribeMapValue) {status=INITIALIZED, declarationVertex=null, valueVertex=null, resolvedValues={}, returnedFrom=ApexStandardValue{apexType='Schema.DescribeSObjectResult'} ApexValue(DescribeSObjectResult) {status=INITIALIZED, declarationVertex=null, valueVertex=null, resolvedValues={}, returnedFrom=SObjectType{associatedObjectType='null'} ApexStandardValue{apexType='Schema.SObjectType'} ApexValue(SObjectType) {status=INDETERMINANT, declarationVertex=SObjectType{associatedObjectType='null'} ApexStandardValue{apexType='Schema.SObjectType'} ApexValue(SObjectType) {status=INDETERMINANT, declarationVertex=VariableDeclaration{properties={FirstChild=false, BeginLine=753, Type=SObjectType, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=753, Name_CaseSafe=sotype, childIdx=1, BeginColumn=21, Name=soType}}, valueVertex=MethodCallExpressionVertex{fullMethodName=so.getSObjectType, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[so], BeginLine=753, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=753, Name_CaseSafe=so, childIdx=0, BeginColumn=30, ReferenceType=METHOD, Name=so}}}, chainedNames=[so], properties={FirstChild=true, FullMethodName=so.getSObjectType, BeginLine=753, FullMethodName_CaseSafe=so.getsobjecttype, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=753, MethodName_CaseSafe=getsobjecttype, childIdx=0, BeginColumn=33, MethodName=getSObjectType}}, resolvedValues={MethodCallExpressionVertex{fullMethodName=so.getSObjectType, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[so], BeginLine=753, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=753, Name_CaseSafe=so, childIdx=0, BeginColumn=30, ReferenceType=METHOD, Name=so}}}, chainedNames=[so], properties={FirstChild=true, FullMethodName=so.getSObjectType, BeginLine=753, FullMethodName_CaseSafe=so.getsobjecttype, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=753, MethodName_CaseSafe=getsobjecttype, childIdx=0, BeginColumn=33, MethodName=getSObjectType}}=NewKeyValueObjectExpression{properties={FirstChild=true, BeginLine=55, Type=Ecm_Object_Store__c, DefiningType_CaseSafe=ecmmetadatamodel, LastChild=false, DefiningType=EcmMetadataModel, EndLine=55, childIdx=0, BeginColumn=34}}}, returnedFrom=null, invocableExpression=null, method=null}, valueVertex=MethodCallExpressionVertex{fullMethodName=so.getSObjectType, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[so], BeginLine=753, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=753, Name_CaseSafe=so, childIdx=0, BeginColumn=30, ReferenceType=METHOD, Name=so}}}, chainedNames=[so], properties={FirstChild=true, FullMethodName=so.getSObjectType, BeginLine=753, FullMethodName_CaseSafe=so.getsobjecttype, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=753, MethodName_CaseSafe=getsobjecttype, childIdx=0, BeginColumn=33, MethodName=getSObjectType}}, resolvedValues={MethodCallExpressionVertex{fullMethodName=so.getSObjectType, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[so], BeginLine=753, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=753, Name_CaseSafe=so, childIdx=0, BeginColumn=30, ReferenceType=METHOD, Name=so}}}, chainedNames=[so], properties={FirstChild=true, FullMethodName=so.getSObjectType, BeginLine=753, FullMethodName_CaseSafe=so.getsobjecttype, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=753, MethodName_CaseSafe=getsobjecttype, childIdx=0, BeginColumn=33, MethodName=getSObjectType}}=NewKeyValueObjectExpression{properties={FirstChild=true, BeginLine=55, Type=Ecm_Object_Store__c, DefiningType_CaseSafe=ecmmetadatamodel, LastChild=false, DefiningType=EcmMetadataModel, EndLine=55, childIdx=0, BeginColumn=34}}}, returnedFrom=null, invocableExpression=null, method=null}, invocableExpression=MethodCallExpressionVertex{fullMethodName=soType.getDescribe, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[soType], BeginLine=754, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=754, Name_CaseSafe=sotype, childIdx=0, BeginColumn=53, ReferenceType=METHOD, Name=soType}}}, chainedNames=[soType], properties={FirstChild=true, FullMethodName=soType.getDescribe, BeginLine=754, FullMethodName_CaseSafe=sotype.getdescribe, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=754, MethodName_CaseSafe=getdescribe, childIdx=0, BeginColumn=60, MethodName=getDescribe}}, method=Method{properties={FirstChild=false, BeginLine=2, IsStandard=true, DefiningType_CaseSafe=schema.sobjecttype, LastChild=false, DefiningType=Schema.SObjectType, Constructor=false, EndLine=2, Name_CaseSafe=getdescribe, childIdx=1, ReturnType=Schema.DescribeSObjectResult, Name=getDescribe, Arity=0, ReturnType_CaseSafe=schema.describesobjectresult, BeginColumn=38}}}, invocableExpression=MethodCallExpressionVertex{fullMethodName=fields.getMap, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[fields], BeginLine=754, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=754, Name_CaseSafe=fields, childIdx=0, BeginColumn=74, ReferenceType=METHOD, Name=fields}}}, chainedNames=[fields], properties={FirstChild=true, FullMethodName=fields.getMap, BeginLine=754, FullMethodName_CaseSafe=fields.getmap, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=754, MethodName_CaseSafe=getmap, childIdx=0, BeginColumn=81, MethodName=getMap}}, method=null}, invocableExpression=MethodCallExpressionVertex{fullMethodName=fieldMap.get, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[fieldMap], BeginLine=760, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=760, Name_CaseSafe=fieldmap, childIdx=0, BeginColumn=39, ReferenceType=METHOD, Name=fieldMap}}}, chainedNames=[fieldMap], properties={FirstChild=true, FullMethodName=fieldMap.get, BeginLine=760, FullMethodName_CaseSafe=fieldmap.get, DefiningType_CaseSafe=ecmcustomsync, LastChild=false, DefiningType=EcmCustomSync, EndLine=760, MethodName_CaseSafe=get, childIdx=0, BeginColumn=48, MethodName=get}}, method=null}, invocableExpression=MethodCallExpressionVertex{fullMethodName=sof.getDescribe, referenceVertex=LazyVertex{result=ReferenceExpression{properties={FirstChild=true, Names=[sof], BeginLine=766, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=766, Name_CaseSafe=sof, childIdx=0, BeginColumn=21, ReferenceType=METHOD, Name=sof}}}, chainedNames=[sof], properties={FirstChild=true, FullMethodName=sof.getDescribe, BeginLine=766, FullMethodName_CaseSafe=sof.getdescribe, DefiningType_CaseSafe=ecmcustomsync, LastChild=true, DefiningType=EcmCustomSync, EndLine=766, MethodName_CaseSafe=getdescribe, childIdx=0, BeginColumn=25, MethodName=getDescribe}}, method=Method{properties={FirstChild=false, BeginLine=2, IsStandard=true, DefiningType_CaseSafe=schema.sobjectfield, LastChild=false, DefiningType=Schema.SObjectField, Constructor=false, EndLine=2, Name_CaseSafe=getdescribe, childIdx=1, ReturnType=Schema.DescribeFieldResult, Name=getDescribe, Arity=0, ReturnType_CaseSafe=schema.describefieldresult, BeginColumn=36}}}: com.salesforce.rules.fls.apex.operations.FlsValidationRepresentation.setObject(FlsValidationRepresentation.java:86);com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.convert(SchemaBasedValidationAnalyzer.java:183);com.salesforce.rules.fls.apex.operations.SchemaBasedValidationAnalyzer.checkForValidation(SchemaBasedValidationAnalyzer.java:77);com.salesforce.rules.fls.apex.operations.FlsValidationCentral.checkSchemaBasedFlsValidation(FlsValidationCentral.java:71);com.salesforce.rules.fls.apex.AbstractFlsVisitor.afterVisit(AbstractFlsVisitor.java:67);com.salesforce.graph.vertex.StandardConditionVertex$Negative.afterVisit(StandardConditionVertex.java:82)

@johnbelosf johnbelosf changed the title UnexpectedException: SObjectType is not available in DescribeSObjectResult [BUG] UnexpectedException: SObjectType is not available in DescribeSObjectResult Feb 20, 2024
@johnbelosf johnbelosf added the BUG P3 Rarely Malfunction label Feb 20, 2024
Copy link

git2gus bot commented Feb 20, 2024

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

@rmohan20
Copy link
Contributor

Duplicate of #1209

@rmohan20 rmohan20 marked this as a duplicate of #1209 Mar 13, 2024
@rmohan20
Copy link
Contributor

Not a direct duplicate in terms of the stacktrace, but the behavior to fix is the same.

@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label May 23, 2024
@stephen-carter-at-sf stephen-carter-at-sf added the duplicate This issue or pull request already exists label Jun 3, 2024
@stephen-carter-at-sf
Copy link
Collaborator

Marking this as a duplicate of #1497

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

No branches or pull requests

4 participants