Attempt at local development run fails with CORS error

Hi all,
I’m just trying to get anything running and am failing. I am working with Fineract 1. On the server side I follow the instructions from github.com/apache/fineract and a server comes up, listening only on port 8080 (a netstat confirms this). Then I try to run the community app. I change my URL to (http) localhost:9002/?baseApiUrl=http://localhost:8080&tenantIdentifier=default#/ and attempt to log in.

In the browser developer console I’m getting:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:8080/fineract-provider/api/v1/authentication. (Reason: CORS request did not succeed)

Note two things:

  1. the URL has an https even though I told it http. My Fineract server starts up and says “The Server is running at http ://localhost:8080/fineract-provider” so https isn’t going to work (space isn’t there, working around new user link count)
  2. There is a CORS error accessing this.

I’d really just like to try to get something, anything running locally. I’ll admit that I’m not super familiar with the build environment so I may be missing something simple. Any help would be greatly appreciated.

Hi @stdunbar,

As i understand you have mentioned two issues here

1.https to http
http changes we do on tomcat server will not affect the platform deployment.
Platform is configured to deploy only on ssh, so the application runs on https with port 8443 or 443(default port of https)
so actual server will be running on "https://localhost:8443/fineract-provider” or "https://localhost:443/fineract-provider”

2.CORS error
CORS error was present in the release 1.3.0 which was later fixed on 1.3.1
refer the commit for reference


I hope this information helps. Kindly let me know if have any other questions.

Hello Scott,

After starting starting the fineract server in the browser open the URL:
https://localhost:8443/fineract-provider/api/v1/authentication?username=abcd&password=efgh

This will send the request to the server and a certificate error will be shown by the browser. Adding the certificate to the exception will allow the request to pass through and the browser will not block the request.

This is because a self-signed certificate is being used by the server for https.

Restarting server also generally fixed CORS if all this is already in place.

1.3.1 of Fineract doesn’t build for me:

scott:~/fineract$ git checkout 1.3.1
Branch '1.3.1' set up to track remote branch '1.3.1' from 'origin'.
Switched to a new branch '1.3.1'
scott:~/fineract$ docker run --name mysql-5.5 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mysql -d mysql:5.5
2e5b4917bf23a911e561bc6cfc2f405f63a0f65a0a69e59db8726a73d46c1a66
scott:~/fineract$ ./gradlew createDB -PdbName=mifosplatform-tenants
Listening for transport dt_socket at address: 8005
:createDB FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/scott/fineract/fineract-provider/build.gradle' line: 403

* What went wrong:
Execution failed for task ':createDB'.
> No such property: sql for class: org.gradle.api.DefaultTask_Decorated
  Possible solutions: ant

1.4.0 does build. But it doesn’t lissten on https:

The Server is running at http://localhost:8080/fineract-provider

Either way the issue still exists when using either https://github.com/openMF/web-app (master branch) or https://github.com/openMF/community-app (develop branch). As these are being served via either ng serve or grunt serve I would have thought that the fix would have been on that side.