Cannot Create Menus

i installed commcare on my ubuntu server,
i feel like this issue is connected to formplayer, which i installed as the following

1- create the file submodules/touchforms-src/touchforms/backend/localsettings.py
URL_ROOT = 'http://localhost:8000/a/{{DOMAIN}}'

2- copy scripts/get_webhost and append to root/etc/hosts

3- added FORMPLAYER_URL = 'http://localhost:8010' and BASE_ADDRESS = 'webhost:8000'
to localsettings.py

so after i press make a new version on the applications page

Cannot Create Menus
Details: Unable to validate the forms due to a server error. Please try again later.

and on my server:

raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /validate_form (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f5740ddbc10>: Failed to establish a new connection: [Errno 111] Connection refused',))
2018-06-23 11:27:15,510 INFO "POST /a/firstproject/apps/save/ce10d51a6470029490265ce8f79ac915/ HTTP/1.1" 200 673

Hi Anas

We are in the process of removing touchforms so the instructions in the readme are a little out of date (though I've just updated them) but it looks like you've got it mostly right.

I'm a little confused since you have port 8010 specified in the FORMPLAYER_URL but the error is complaining about a connection to port 8080 which is the default port in settings.py. Are you sure your localsettings file is being picked up correctly?

Hello Simon,

first of all thanks for your reply i really appreciate it.

so just a quick review of the what the changes i made really look like,

submodules/touchforms-src/touchforms/backend/localsettings.py
URL_ROOT = ‘http://localhost:8000/a/{{DOMAIN}}’

etc/hosts

0.0.0.0 	localhost
127.0.1.1	HCDC-16

CONTAINER=$(docker container ls | awk '/formplayer/ { print $1 }')
docker exec $CONTAINER sh -c 'cat /etc/hosts | grep webhost'

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

localsettings.py

##### FORM PLAYER ######

FORMPLAYER_URL = 'http://localhost:8010'
BASE_ADDRESS = 'webhost:8000'

..

I'm not really sure how to check if my localsettings.py is picked up correctly to be honst

Hi Anas

You misunderstood the instructions and have copied the contents of scripts/get_webhost into your /etc/hosts file.

Rather you should run that script and copy the output into /etc/hosts which should look something like the following:

172.17.0.1 dockerhost webhost