Troubleshooting

Having trouble installing or running eGon-data? Here’s a list of known issues including a solution.

Installation Errors

These are some errors you might encounter while trying to install egon.data.

importlib_metadata.PackageNotFoundError: No package metadata ...

It might happen that you have installed importlib-metadata=3.1.0 for some reason which will lead to this error. Make sure you have importlib-metadata>=3.1.1 installed. For more information read the discussion in issue #60.

Runtime Errors

These are some of the errors you might encounter while trying to run egon-data.

ERROR: Couldn't connect to Docker daemon ...

To verify, please execute docker-compose -f <(echo {"service": {"image": "hellow-world"}}) ps and you should see something like

ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment
variable.

This can have at least two possible reasons. First, the docker daemon might not be running. On Linux Systems, you can check for this by running ps -e | grep dockerd. If this generates no output, you have to start the docker daemon, which you can do via sudo systemctl start docker.service on recent Ubuntu systems.

Second, your current user might not be a member of the docker group. On Linux, you can check this by running groups $(whoami). If the output does not contain the word docker, you have to add your current user to the docker group. You can find more information on how to do this in the docker documentation. Read the initial discussion for more context.

[ERROR] Connection in use ...

This error might arise when running egon-data serve making it shut down early with ERROR - Shutting down webserver. The reason for this is that the local webserver from a previous egon-data serve run didn’t shut down properly and is still running. This can be fixed by running ps -eo pid,command  | grep "gunicorn: master" | grep -v grep which should lead to output like NUMBER gunicorn: master [airflow-webserver] where NUMBER is a varying number. Once you got this, run kill -s INT NUMBER, substituting NUMBER with what you got previously. After this, egon-data serve should run without errors again.

[ERROR] Cannot create container for service egon-data-local-database ...

During building the docker container for the Postgres database, you might encounter an error like

ERROR: for egon-data-local-database  Cannot create container for service
egon-data-local-database: Conflict. The container name
"/egon-data-local-database" is already in use by container
"1ff9aadef273a76a0acbf850c0da794d0fb28a30e9840f818cca1a47d1181b00".
You have to remove (or rename) that container to be able to reuse that name.

If you’re ok with deleting the data, stop and remove the container by

docker stop egon-data-local-database
docker rm -v egon-data-local-database

The container and its data can be kept by renaming the docker container.

docker rename egon-data-local-database NEW_CONTAINER_NAME

Working with multiple instances of egon-data

To make sure parallel installations of egon-data are not conflicting each other users have to set different values for the following options in the configuration:

--airflow-port
--compose-project-name
--database-port
--docker-container-name

Other import or incompatible package version errors

If you get an ImportError when trying to run egon-data, or the installation complains with something like

first-package a.b.c requires second-package>=q.r.r, but you'll have
second-package x.y.z which is incompatible.

you might have run into a problem of earlier pip versions. Either upgrade to a pip version >=20.3 and reinstall egon.data, or reinstall the package via pip install -U --use-feature=2020-resolver. The -U flag is important to actually force a reinstall. For more information read the discussions in issues #36 and #37.