Skip to content

Conversation

@airajena
Copy link
Contributor

@airajena airajena commented Jan 3, 2026

Description

Fixes the error "Job LOAN_COB is not found or it is disabled" that appears when navigating to Manage Jobs with LOAN_COB disabled.

Root Cause

When fineract.job.loan-cob-enabled=false, the /api/v1/loans/is-catch-up-running endpoint throws JobIsNotFoundOrNotEnabledException, which maps to HTTP 403 Forbidden.

Fix

Changed the isCatchUpRunning() method to return a default IsCatchUpRunningDTO(false, null) when the service is not available, instead of throwing an exception.

Before:

.orElseThrow(() -> new JobIsNotFoundOrNotEnabledException(JobName.LOAN_COB.name()));

After:

.orElse(new IsCatchUpRunningDTO(false, null));

Related Issue

Fixes FINERACT-2320

@adamsaghy
Copy link
Contributor

    Test testPostInterestNotZero() FAILED (1.9s)
  
    java.lang.AssertionError: 1 expectation failed.
    Expected status code <200> but was <400>.
        at org.apache.fineract.integrationtests.SavingsInterestPostingTest.lambda$testPostInterestNotZero$4(SavingsInterestPostingTest.java:346)

Please run:

./gradlew spotlessApply spotbugsMain spotbugsTest checkstyleMain checkstyleTest

@airajena airajena force-pushed the FINERACT-2320/fix-loan-cob-disabled-error branch from 993ad03 to 0a23eaa Compare January 9, 2026 08:36
@airajena
Copy link
Contributor Author

airajena commented Jan 9, 2026

Test testPostInterestNotZero() FAILED (1.9s)

java.lang.AssertionError: 1 expectation failed.
Expected status code <200> but was <400>.
    at org.apache.fineract.integrationtests.SavingsInterestPostingTest.lambda$testPostInterestNotZero$4(SavingsInterestPostingTest.java:346)

The test failures (testPostInterestNotZero) should be resolved since they were caused by being behind upstream.

@adamsaghy
Copy link
Contributor

Test testPostInterestNotZero() FAILED (1.9s)

java.lang.AssertionError: 1 expectation failed.
Expected status code <200> but was <400>.
    at org.apache.fineract.integrationtests.SavingsInterestPostingTest.lambda$testPostInterestNotZero$4(SavingsInterestPostingTest.java:346)

The test failures (testPostInterestNotZero) should be resolved since they were caused by being behind upstream.

They might have been resolved. Can you rebase with latest develop branch?

Please let me know if it is still failing and i will take a look.

@adamsaghy
Copy link
Contributor

* What went wrong:
Execution failed for task ':fineract-provider:spotlessJavaCheck'.
> The following files had format violations:
      src/main/java/org/apache/fineract/cob/api/LoanCOBCatchUpApiResource.java
          @@ -86,7 +86,6 @@
           ····@Produces({·MediaType.APPLICATION_JSON·})
gradle/actions: Writing build results to /home/runner/work/_temp/.gradle-actions/build-results/__run-1767947855361.json

[Incubating] Problems report is available at: file:///home/runner/work/fineract/fineract/build/reports/problems/problems-report.html
           ····@Operation(summary·=·"Retrieves·whether·Loan·COB·catch·up·is·running",·description·=·"Retrieves·whether·Loan·COB·catch·up·is·running,·and·the·current·execution·date·if·it·is·running.")

           ····public·IsCatchUpRunningDTO·isCatchUpRunning()·{
          -········return·loanCOBCatchUpServiceOp.map(LoanCOBCatchUpService::isCatchUpRunning)
          -················.orElse(new·IsCatchUpRunningDTO(false,·null));
          +········return·loanCOBCatchUpServiceOp.map(LoanCOBCatchUpService::isCatchUpRunning).orElse(new·IsCatchUpRunningDTO(false,·null));
           ····}
           }
  Run './gradlew :fineract-provider:spotlessApply' to fix these violations.

Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly check the failing build!

@airajena airajena force-pushed the FINERACT-2320/fix-loan-cob-disabled-error branch from 0a23eaa to 9095203 Compare January 13, 2026 15:59
@airajena
Copy link
Contributor Author

Kindly check the failing build!

Can you please share the details of the failing case, also is there any way where I can see the details of failing case?

@adamsaghy
Copy link
Contributor

@airajena Please rebase this PR with latest develop branch.

Copy link
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be rebased as base branch is out of sync.

@adamsaghy adamsaghy closed this Jan 15, 2026
@adamsaghy
Copy link
Contributor

Duplicate #5291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants