[
https://issues.apache.org/jira/browse/FINERACT-2320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18046920#comment-18046920
]
Jay Punekar commented on FINERACT-2320:
---------------------------------------
I checked the controller code first. In
{{{}/loans/{}}}is-catch-up-running{{{}{}}}, the method directly throws
exception when job is not found or disabled:
{code:java}
public IsCatchUpRunningDTO isCatchUpRunning() {
return loanCOBCatchUpServiceOp.map(LoanCOBCatchUpService::isCatchUpRunning)
.orElseThrow(() -> new
JobIsNotFoundOrNotEnabledException(JobName.LOAN_COB.name()));
} {code}
Because of this, when fineract.job.loan-cob-enabled{{{}=false{}}}, the endpoint
immediately throws
JobIsNotFoundOrNotEnabledException.
I traced further and saw that JobIsNotFoundOrNotEnabledExceptionMapper always
maps this exception to HTTP 403 FORBIDDEN. This is why Manage Jobs shows error
even when the job is intentionally disabled by configuration.
>From my understanding, disabled job is a valid configuration state and not an
>authorization issue.
I would like to ask what should be the expected behavior in general when job is
disabled or not found?
> Error message "Job LOAN_COB is not found or it is disabled" appears when
> accessing Manage Jobs
> ----------------------------------------------------------------------------------------------
>
> Key: FINERACT-2320
> URL: https://issues.apache.org/jira/browse/FINERACT-2320
> Project: Apache Fineract
> Issue Type: Bug
> Affects Versions: 1.11.0, 1.12.1
> Reporter: Marta Jankovics
> Priority: Major
>
> When navigating to the *Manage Jobs* section in the Fineract system, an error
> message appears in the top-right corner of the screen:
> {quote}*"Job LOAN_COB is not found or it is disabled"*
> {quote}
> Additionally, the browser developer tools show a failed API call:
> * *Request:*
> {{GET
> https://fineract-dev.dev.aws.bimaxi.net/fineract-provider/api/v1/loans/is-catch-up-running}}
> * *Response:*
> {{403 Forbidden}}
> * *Response Preview:*
>
> {{{ "developerMessage": "Job LOAN_COB is not found or it is disabled",
> "httpStatusCode": "403",
> "defaultUserMessage": "Job LOAN_COB is not found or it is disabled",
> "userMessageGlobalisationCode": "error.msg.job.disabled"
> }}}
> *Steps to Reproduce:*
> # Log in to the Fineract system.
> # Navigate to {*}Manage Jobs{*}.
> # Observe the error message in the top-right corner.
> # Open browser developer tools and inspect the failed API call.
> *Expected Result:*
> The *Manage Jobs* screen should load without errors.
> *Actual Result:*
> An error message is shown, and the API call to check the loan catch-up job
> fails with a 403 error.
> *Notes:*
> This may indicate that the {{LOAN_COB}} job is either not configured,
> disabled, or the user lacks permission to access it. Backend configuration
> and user role permissions should be reviewed.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)