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] LimitReached / InternalExecutionError when have @AuraEnabled on an Apex function #1323

Open
Sourciluss667 opened this issue Jan 15, 2024 · 3 comments
Labels
BUG P3 Rarely Malfunction SFGE Issues related to the Salesforce Graph Engine

Comments

@Sourciluss667
Copy link

Sourciluss667 commented Jan 15, 2024

scanner run dfa Issue Template

Fill out this template to submit your Code Analyzer issue.

Description:

I run sf scanner run dfa --format=csv --outfile=CodeAnalyzerDFA.csv --target="./force-app/main/default/classes/helpers/LeewayOrganizationName.cls" --projectdir="./" --category="Security" --sfgejvmargs "-Xmx4g" but got InternalExecutionError on a specific function. I tried lot of things (remove path limit, increase heap size, etc) but always have InternalExecutionError. I notice if I remove @AuraEnabled(cacheable=false), I don't have the issue anymore!

Documentation:

sfge.log

Steps To Reproduce:

My function call 2 others functions with @AuraEnabled too, with 2 if statements.

  @AuraEnabled(cacheable=false)
  public static String refetchOrganizationName() {
    String organizationName = LeewayRecordLeewayMasterAccount.fetchAndSaveOrganizationName();
    if (organizationName == null) {
      organizationName = LeewayRecordLeewayAccount.fetchAndSaveOrganizationName();

      if (organizationName == null) {
        return null;
      }
    }

    return organizationName;
  }

NB: LeewayRecordLeewayMasterAccount.fetchAndSaveOrganizationName() and LeewayRecordLeewayAccount.fetchAndSaveOrganizationName() doesn't have error when run scanner on theses files.

Expected Behavior:

No problems in output file.

Screenshots:

Desktop:

OS: macOS Sonoma v14.1
Code Analyzer version: latest
Salesforce CLI version: @salesforce/cli/2.22.7 darwin-arm64 node-v20.10.0

Additional Context:

Workaround:

Without @AuraEnabled, the scan work correctly, but I can't remove it because my code doesn't work without it.

Urgency:

This block us to launch our Security review

@jfeingold35
Copy link
Collaborator

@Sourciluss667 , you can document this as a false positive just as you would any others, so this isn't a blocker.
Also, the reason that removing the @AuraEnabled annotation resolves the issue is because @AuraEnabled is one of the keywords that marks the method as an entry point for data flow analysis. This is clearly indicated in the documentation.
Also-also, please include what the actual error message is, so we know what the actual problem is.

@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-15080639

@rmohan20
Copy link
Contributor

rmohan20 commented Mar 11, 2024

Duplicate of #1294

@rmohan20 rmohan20 marked this as a duplicate of #1294 Mar 11, 2024
@stephen-carter-at-sf stephen-carter-at-sf added the SFGE Issues related to the Salesforce Graph Engine label May 23, 2024
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

5 participants