-
-
Notifications
You must be signed in to change notification settings - Fork 184
Frontend Development Troubleshooting
Leszek Pietrzak edited this page May 5, 2021
·
25 revisions
Note: we assume you used kobo-install to setup your development environment.
If your http://kf.kobo.local/ is broken, try these things:
- Check out
python run.py --logs
output. - Check http://kf.kobo.local/service_health/ status.
- You should probably be on
kobo-install
onmaster
on latest commit -- see if you're not behind. - Restart
npm run watch
, as sometimes hot reloading chokes on itself. - Restart
kpi
softly:./run.py -cf restart kpi
- Restart
kobo-install
instance:python run.py --stop && python run.py
. - When there are
kpi
Backend changes on your branch, you may need to rebuild it:./run.py -cf build kpi
. - If you're on
kpi
's non-master
branch, try switching tomaster
and see if problem still occurs. - Rerun migrations:
./run.py -cf exec kpi bash
and./manage.py makemigrations
plus./manage.py migrate
- If you get this error for Docker on MacOS, try restarting docker:
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
. You can also try increasing timeout by runningCOMPOSE_HTTP_TIMEOUT=200 ./run.py
.
Hardcore options:
- Restart Docker.
- Wipe out database by removing
kobo-docker/.vols
directory. - Stop all docker containers
docker stop $(docker ps -aq)
. (Longer better version:docker rm $(docker ps -a -q); docker rmi $(docker images -q); docker volume rm $(docker volume ls -qf dangling=true)
) - Remove all stopped docker containers and unused data:
docker system prune
. - Remove
kobo-docker
andkobo-deployments
directories, and hard restartkobo-install
:python run.py --stop && python run.py --setup
. - Sometimes old
.pyc
files causes errors while startingkobo-install
(e.g.ImportError: cannot import name KpiUidField
), usefind . -name "*.pyc" -type f -delete
in your kpi/kobocat local repository to fix it
This error:
nginx_1 | nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx_1 | nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
…
nginx_1 | nginx: [emerg] still could not bind()
- Enter nginx container:
docker exec -it kobo-docker_nginx_1 bash
(your container name may be a bit different). - Run
sv stop nginx
.
- Enter your KPI container:
docker exec -it kpi_1 bash
- Build:
npm run build
- Gather new static files:
python manage.py collectstatic
- Exit container
- Restart KPI:
./run.py -cf restart kpi
Checking out Enketo logs: ./run.py -cf logs --tail=10 -f enketo_express
Checking out logs: ./run.py --logs