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] AcquireTokenSilentSupplier failed: Token not found in the cache #40654

Closed
krysiuda opened this issue Jun 17, 2024 · 2 comments
Closed

[BUG] AcquireTokenSilentSupplier failed: Token not found in the cache #40654

krysiuda opened this issue Jun 17, 2024 · 2 comments
Labels
Azure.Identity customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly

Comments

@krysiuda
Copy link

Describe the bug
Between msal4j versions 1.14.0 and 1.15.0 logging for AuthenticationErrorCode.CACHE_MISS has changed. I believe the change was accidental, resulting in additional (and potentially misleading) WARN messages being log.

Exception or Stack Trace
Our production system is logging "Execution of class com.microsoft.aad.msal4j.AcquireTokenSilentSupplier failed: Token not found in the cache" on "com.microsoft.aad.msal4j.ConfidentialClientApplication" logger (severity: WARN) every hour.

Expected behavior
Since cache miss simply triggers retrieval of a new token, I would expect this event (cache miss) to be logged with low severity. Preferably DEBUG level.

Setup (please complete the following information):

  • OS: linux
  • IDE: IntelliJ
  • Library/Libraries: msal4j-1.15.0-sources.jar
  • Java version: openjdk-21
  • App Server/Environment: N/A
  • Frameworks: N/A

Additional context
in msal4j-1.14.0 AuthenticationResultSupplier there was:

            if (exception.errorCode() != null && exception.errorCode().equalsIgnoreCase(AuthenticationErrorCode.CACHE_MISS)) {
                clientApplication.log.debug(logMessage, ex);
                return;
            }
            ...
            clientApplication.log.error(logMessage, ex);

logging CACHE_MISS on DEBUG level instead of ERROR.

in msal4j-1.15.0, there is only:

                clientApplication.log.warn(
                        LogHelper.createMessage(
                                String.format("Execution of %s failed: %s", this.getClass(), ex.getMessage()),
                                msalRequest.headers().getHeaderCorrelationIdValue()));

logging cache misses always on WARN level.

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 17, 2024
@joshfree
Copy link
Member

Hi @krysiuda, msal4j development and issue tracking happens in a separate git repo, here: https://github.com/AzureAD/microsoft-authentication-library-for-java.

I'll copy the issue over on your behalf and resolve this issue here as closed.

@joshfree joshfree added Azure.Identity tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly labels Jun 27, 2024
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 27, 2024
@joshfree
Copy link
Member

Closing issue. New issue created here: AzureAD/microsoft-authentication-library-for-java#833

@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Projects
Development

No branches or pull requests

2 participants