The instructions you are looking at are for setting up a dev environment. You do not have to use docker but that means you need to have all the services running in some other way. This includes, PostgreSQL, CouchDB, Elasticsearch, Redis, Kafka, RiakCS, Formplayer.
For a dev environment using docker greatly simplifies the setup process.
That error means that the "formplayer" service isn't running or that the primary server process cannot connect to it. There are two options for doing so, described here. Running the standalone jar is a bit simpler. I'd ensure that the process is running and that you've adjusted your localsettings as described.
Are there any traceback either from Formplayer or from CommCareHQ?
There are a number of places that could be an issue. One place to check is the developer tools window in the browser to see where it is making the request to - that will allow you to test if Formplayer is actually running at that URL. If not you may need to change FORMPLAYER_URL in settings.
Looks like it is the FORMPLAYER_URL problem. I am going to re-start the installation.
I am not sure about the URL itself. Is it localhost:8000 or localhost:8010? My IP is 172.17.0.1:8000
The problem is I think I am using different IPs everywhere. Could you please tell me if this is right?
This should be the publicly accessible URL since it needs to be available from the browser. For a dev environment setup this is likely something like http://localhost:8010 (port that Formplayer is running on).
In a production environment you'll most likely have Formplayer behind a reverse proxy and can create a location match to route requests to it. Then the URL would be something like https://www.mysite.com/formplayer
I tried running formplayer in docker. same error.
I also tried running formplayer.jar as
java -jar formplayer.jar --spring.config.name=formplayer
Still same error.
I can see the port (formplayer is configured to run on 8010) is listening at system side
tcp6 0 0 :::8010 :::* LISTEN
value of variable FORMPLAYER_INTERNAL_AUTH_KEY in localsettings.py and commcarehq.formplayerAuthKey in formplayer.properties are same.
Please give some information on what could cause this error.
Another observation is that I keep getting error in Developer window of the browser.
ws4redis.js:37 WebSocket connection to ‘ws://172.18.0.1:8000/ws/commcare-test:99eb2b3824788ae48ea49602ce004f4a:daec32b4fdb749799b31c1663aaaab77?subscribe-broadcast’ failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
connect @ ws4redis.js:37
(anonymous) @ ws4redis.js:56
ws4redis.js:100 Websocket connection is broken!
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8010/delete_application_dbs. (Reason: CORS request did not succeed).
All the services and formplayer is running in Docker. Only Django is running locally.
Is there any network settings/changes to be done for enabling access from client systems (these systems are in the same network).
This can happen when you are accessing HQ and formplayer on different host urls for ex. localhost vs 127.0.0.1 even though they practically directs you to the same page. So if your formplyaer url is defined as http://localhost:8080 make sure you are accessing HQ through a localhost url as well.
connection in the localhost is fine, but we are facing problem only while connecting from external clients. How do we provide URL for external clients.
I think the recommended production setup for external access is to proxy formplayer through a different URL on the same server using something like nginx.
In production Dimagi sets up www.commcarehq.org/formplayer to proxy the underlying formplayer URL which avoids the CORS issue.