Skip to the content.

Troubleshooting technical issues with Trustroots development

Expect problems and eat them for breakfast.

Installed via Docker

Getting ENOTFOUND NPM install errors when doing Docker installation.

If you’re not really offline, your VirtualMachine might be confused because of your DNS setting, a proxy or changed wifi. Restarting the VM picks up the updated network configuration: docker-machine restart. Follow instructions it might give you.

Getting flooded by Received event die for container XYZ messages

If they’re coming from Nginx it might mean that NodeJS app either crashed or isn’t running yet. Wait for “Trustroots is up and running now.” message.

See this comment.

No space left on device

Running this might help (via):

# remove stopped containers
docker rm $(docker ps -a -q)

# remove dangling images
docker rmi $(docker images -q --filter "dangling=true")

Couldn’t connect to Docker daemon

Getting this error?

ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.

Is your machine running? Try:

docker-machine start default

If it is (and you can see it with docker-machine ls, and its name really is “default”), try connecting your shell to the machine:

eval "$(docker-machine env default)"

Installed locally

MongoError: connect ECONNREFUSED

Seeing this?

{ [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
  name: 'MongoError',
  message: 'connect ECONNREFUSED 127.0.0.1:27017' }
[17:05:51] [nodemon] clean exit - waiting for changes before restart

Make sure your MongoDB is running at localhost at default port (27017).

If you are running Mongo somewhere else and/or it requires authentication, open ./config/env/development.js and copy whole db block to ./config/env/local.js. Make required changes there and restart the app.

Command to run MongoDB is usually mongod.

If you get errors about node-gyp when doing npm install/update, check you have build tools installed.

This is most likely required by lwip package, basically a library handling image processing.

Assuming you have the above installed and are still having issues, the next step is verifying that you are pointing at the correct version of build tools. In some cases, package managers can cause incompatibilities (brew, nvm, etc.) and similarly with manual installs of various tools. It maybe helpful to:

ImportError: No module named site

If you see error ImportError: No module named site when doing npm install/update, unsetting these python variables might help:

unset PYTHONPATH
unset PYTHONHOME

NPM giving EACCESS errors

You probably have an issue with directory permissions. Read this documentation page for how to fix it. You shouldn’t run scripts with sudo anyway.

Other

Error at signup page

Make sure you’ve set mailer settings as described at install instructions.

My database is not up to date with model

Try to run migration script by typing npm run migrate. You can also just empty your development database and possibly refill it with seed data (see INSTALL.md for more). If you’re running the app inside docker, remember to run these inside containers, e.g.: docker-compose run trustroots npm run migrate

Migration script says “SyntaxError: Unexpected end of input”

Might be caused by migrations/.migrate file. Try removing/renaming it.

Tests

Can’t run Selenium tests (test.py)