Troubleshooting a private, customized KoBoToolbox installation

I just did a server restart after increasing the disk size. Now enketo forms won’t open.
It’s stuck on loading forever (this icon):
image

kf, kc are running fine. Even ee.<domain> is showing the Enketo index page. Any idea what could be the issue? @jnm (sorry for the tag, but I’ve been trying to fix this for sometime and would appreciate if you could help me out. :frowning: )

What do you see in the browser’s developer console (check the JavaScript errors but also the network activity) when this happens?

1 Like

It says

Uncaught ReferenceError: downloadUtils is not defined
https://ee.<domain>/js/build/enketo-webform-bundle.min.js:92

Try going into your enketo_express container and running grunt. It should look something like this:

kobo-install$ ./run.py -cf exec enketo_express bash
root@15ed07dfbb75:/srv/src/enketo_express# grunt
Running "shell:clean-locales" (shell) task

Running "i18next:locales" (i18next) task

Running "widgets" task
File public/js/build/widgets.js created
File app/views/styles/component/_widgets.scss created

Running "shell:clean-css" (shell) task

Running "system-sass-variables:create" (system-sass-variables) task
File app/views/styles/component/_system_variables.scss created

Running "sass:compile" (sass) task

Running "shell:clean-js" (shell) task

Running "widgets" task
File public/js/build/widgets.js created
File app/views/styles/component/_widgets.scss created

Running "shell:rollup" (shell) task
>> public/js/src/enketo-webform.js → public/js/build/enketo-webform-bundle.js...
>> (!) Circular dependency: public/js/src/module/gui.js -> node_modules/enketo-core/src/js/print.js -> public/js/src/module/gui.js
>> (!) 'default' is not exported by 'node_modules/i18next-http-backend/esm/getFetch.cjs'
>> created public/js/build/enketo-webform-bundle.js in 12.8s
>> public/js/src/enketo-webform-edit.js → public/js/build/enketo-webform-edit-bundle.js...
>> (!) Circular dependency: public/js/src/module/gui.js -> node_modules/enketo-core/src/js/print.js -> public/js/src/module/gui.js
>> (!) 'default' is not exported by 'node_modules/i18next-http-backend/esm/getFetch.cjs'
>> created public/js/build/enketo-webform-edit-bundle.js in 10.5s
>> public/js/src/enketo-webform-view.js → public/js/build/enketo-webform-view-bundle.js...
>> (!) Circular dependency: public/js/src/module/gui.js -> node_modules/enketo-core/src/js/print.js -> public/js/src/module/gui.js
>> (!) 'default' is not exported by 'node_modules/i18next-http-backend/esm/getFetch.cjs'
>> created public/js/build/enketo-webform-view-bundle.js in 11.6s
>> public/js/src/enketo-offline-fallback.js → public/js/build/enketo-offline-fallback-bundle.js...
>> created public/js/build/enketo-offline-fallback-bundle.js in 186ms

Running "terser:all" (terser) task
>> 4 grunt.util.pluralize(createdFiles, 'file/files') created.

Done.


Execution Time (2021-03-29 19:47:44 UTC-0)
loading tasks    1.2s  ▇▇▇▇ 2%
shell:rollup    35.6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 46%
terser:all      39.2s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 51%
Total 1m 16.8s
2 Likes

Tried that, still facing the same issue.

Here are the steps I tried:

grunt, then restart container: didn’t work

rm -R node_modules
npm install --production
then restart container: didn’t work

I’m getting the same error image

What Enketo image do you have? (from the output of docker ps). Mine shows

CONTAINER ID   IMAGE                                            COMMAND                  CREATED      STATUS      PORTS                  NAMES
15ed07dfbb75   kobotoolbox/enketo-express-extra-widgets:2.5.6   "docker-entrypoint.s…"   3 days ago   Up 3 days   8005/tcp               kobofe_enketo_express_1

Also, do your customizations include modifying Enketo?

1 Like

This is my image: kobotoolbox/enketo-express-extra-widgets:2.3.5
Yes there are modifications, but only cosmetic.

How do you apply the modifications?

Git pull from within the container.

(The method you suggested last time to modify the YML files and add the build folder from localhost wasn’t working because the containers kept restarting due to a permission error in the start.sh file.)

Okay. Do you remember if your modifications were working with Enketo 2.3.5 previously? I’m wondering if your image got upgraded automatically (by kobo-install or pulling kobo-docker).

1 Like

Everything was working normally, all I did was to shut down the VM, increase the disk size, and restart the VM.

There may have been some issue in the code previously that wasn’t translating to the website, but I’m thinking the act of restarting the VM caused it to show up somehow.

Ideas:

  • Go into the kobo-docker directory and run git reflog --date=iso. Look for changes that coincide with you rebooting the VM.
  • Try running vanilla Enketo 2.3.5 without any modifications. Do you still get the JavaScript error?
  • (Unlikely to work given your time crunch) Try updating to 2.5.6 and applying your modifications on top of that.
1 Like

Thanks for the suggestions.

I would like to try running the latest vanilla version without any modifications for tomorrow’s work… How do I build the latest version of only the enketo container without touching the others?

Change your docker-compose.frontend.yml file so that line starting with image: kobotoolbox/enketo-express-extra-widgets ends in 2.5.6. Here’s a snippet from the latest version of kobo-docker:

  enketo_express:
    image: kobotoolbox/enketo-express-extra-widgets:2.5.6
    env_file:
      - ../kobo-env/envfile.txt

Once you’ve done that, use Docker Compose to pull the new enketo-express-extra-widgets image. I use kobo-install/run.py for this, i.e. ./run.py -cf pull enketo_express, but you may have a custom docker-compose command.

Once the image has been pulled, use Docker Compose to recreate the enketo_express container. Again, I use kobo-install, but you may be invoking docker-compose directly. I would do ./run.py -cf up -d enketo_express. Sometimes it’s necessary to restart NGINX afterwards, i.e. ./run.py -cf restart nginx.

1 Like

@jnm. Thanks to you, I got Enketo up and running, finally.
But I guess I made some mistake with the docker-compose, because kc.domain now gives me this:

Will this get resolved if I update the kobocat container?

1 Like

Did you restart NGINX? (If not, make sure to try that first. That error is there to avoid accidentally serving the KPI content to the KoBoCAT domain and vice versa. That can happen when container IPs change but NGINX has not reloaded.)

1 Like

I’m so sorry for all this bother, but I seem to be out of one problem and into another… :frowning_face:

I tried restarting nginx, that didn’t work. Then I tried rebuilding kobocat from the public image (2.021.09) then restarting nginx. That didn’t work either.

Next, I rebuilt it using public image v 2.020.28 (which was commented out in my YML file). Now I get this when I go to kc.domain

but in enketo forms I get this:

OK, let’s continue. I don’t think you’ll be able to go back KoBoCAT 2.020.28 because there have been changes to the database schema since then. Switch again to 2.021.09. Can you get back at least to the “System configuration error” (port 8000 vs. 8001) message? We can work with that.

1 Like

Yes I’m back to that error now. And Enketo also shows the “Request failed” error.

Edit: Do you think I should update the docker-compose folder too?

Right. Enketo won’t be able to load forms if KoBoCAT isn’t working. One moment please…