You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by "Shivd131 (via GitHub)" <gi...@apache.org> on 2026/01/06 18:55:10 UTC
[PR] FINERACT-2320: Fix 403 error by returning false when Loan COB job is disabled [fineract]
Shivd131 opened a new pull request, #5291:
URL: https://github.com/apache/fineract/pull/5291
## Description
Fixes [FINERACT-2320](https://issues.apache.org/jira/browse/FINERACT-2320).
**The Issue:**
When `fineract.job.loan-cob-enabled` is set to `false`, the API endpoint `/loans/is-catch-up-running` throws a `JobIsNotFoundOrNotEnabledException`. This results in a `403 Forbidden` (or sometimes `400 Bad Request`) response, causing the "Manage Jobs" UI to display an error message unnecessarily.
**The Fix:**
Modified `LoanCOBCatchUpApiResource.java` to handle the empty Service `Optional` gracefully. Instead of throwing an exception, the API now correctly returns `200 OK` with a payload indicating the job is not running: `{"catchUpRunning": false}`.
**Verification:**
- Reproduced the issue locally by setting `export FINERACT_JOB_LOAN_COB_ENABLED=false`.
- Confirmed the API previously returned `400/403`.
- Applied the fix and confirmed via cURL that the API now returns `200 OK`.
```bash
shivd@Shiv_Laptop MINGW64 ~/Documents/mifos/fineract (develop)
$ curl -k -i -u mifos:password -H "Fineract-Platform-TenantId: default" -X GET "https://localhost:8443/fineract-provider/api/v1/loans/is-catch-up-running"
HTTP/1.1 200
X-Notification-Refresh: false
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
Strict-Transport-Security: max-age=31536000 ; includeSubDomains
X-Frame-Options: DENY
Content-Type: application/json
Content-Length: 24
Date: Tue, 06 Jan 2026 18:37:55 GMT
{"catchUpRunning":false}
```
## Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
- [x] Write the commit message as per [our guidelines](https://github.com/apache/fineract/blob/develop/CONTRIBUTING.md#pull-requests)
- [x] Acknowledge that we will not review PRs that are not passing the build _("green")_ - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
- [ ] Create/update [unit or integration tests](https://fineract.apache.org/docs/current/#_testing) for verifying the changes made.
- [x] Follow our [coding conventions](https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions).
- [x] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
- [x] [This PR must not be a "code dump"](https://cwiki.apache.org/confluence/display/FINERACT/Pull+Request+Size+Limit). Large changes can be made in a branch, with assistance. Ask for help on the [developer mailing list](https://fineract.apache.org/#contribute).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2320: Fix 403 error by returning false when Loan COB job is disabled [fineract]
Posted by "Shivd131 (via GitHub)" <gi...@apache.org>.
Shivd131 commented on PR #5291:
URL: https://github.com/apache/fineract/pull/5291#issuecomment-3719249400
@IOhacker I have removed the comment, thank you
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2320: Fix 403 error by returning false when Loan COB job is disabled [fineract]
Posted by "IOhacker (via GitHub)" <gi...@apache.org>.
IOhacker commented on PR #5291:
URL: https://github.com/apache/fineract/pull/5291#issuecomment-3716604004
@Shivd131 Run './gradlew :fineract-provider:spotlessApply' to fix these violations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2320: Fix 403 error by returning false when Loan COB job is disabled [fineract]
Posted by "Shivd131 (via GitHub)" <gi...@apache.org>.
Shivd131 commented on PR #5291:
URL: https://github.com/apache/fineract/pull/5291#issuecomment-3717348932
@IOhacker Thanks for the review!
I have:
- Rebased onto the latest develop to pick up the SavingsInterestPostingTest fix.
- Applied Spotless formatting.
The build should be green now, but kindly let me know if there are further fixes required!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2320: Fix 403 error by returning false when Loan COB job is disabled [fineract]
Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy merged PR #5291:
URL: https://github.com/apache/fineract/pull/5291
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] FINERACT-2320: Fix 403 error by returning false when Loan COB job is disabled [fineract]
Posted by "IOhacker (via GitHub)" <gi...@apache.org>.
IOhacker commented on code in PR #5291:
URL: https://github.com/apache/fineract/pull/5291#discussion_r2666501226
##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/SavingsInterestPostingTest.java:
##########
Review Comment:
Please rebase, this fix is already in place
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fineract.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org