uw-ictd / colte

Community LTE Project
MIT License
59 stars 27 forks source link

psycopg2 dependency not installed with colte-cn-4g #112

Closed infrared0 closed 2 years ago

infrared0 commented 2 years ago

After a fresh apt install of package colte-cn-4g on Ubuntu 20.04 without postgres already installed, coltedb script fails with the following error:

Traceback (most recent call last):
  File "/usr/bin/coltedb", line 7, in <module>
    import psycopg2
ModuleNotFoundError: No module named 'psycopg2' 

Colte config.yml file initially did not have metering turned on.

Solved initially by also installing colte-prepaid package, which resulted in the following :

The following additional packages will be installed:
  haulage libllvm10 libnode64 libpq5 nodejs nodejs-doc postgresql postgresql-12 postgresql-client-12
  postgresql-client-common postgresql-common python3-mysqldb python3-psycopg2 sysstat
Suggested packages:
  npm postgresql-doc postgresql-doc-12 libjson-perl default-mysql-server | virtual-mysql-server
  python3-mysqldb-dbg python-psycopg2-doc isag
The following NEW packages will be installed:
  colte-prepaid haulage libllvm10 libnode64 libpq5 nodejs nodejs-doc postgresql postgresql-12
  postgresql-client-12 postgresql-client-common postgresql-common python3-mysqldb python3-psycopg2
  sysstat

Next ran colteconf update with metering set to true in config.yml file to trigger database migrations and haulage install. Finally ran colteconf update with metering set to false to ultimately turn off metering. After that coltedb worked fine.

I believe we either want to include psycopg2 as a dependency to colte-cn-4g, or remove the dependency if the postgres database is not needed without haulage?

matt9j commented 2 years ago

Hmm, sorry I didn't catch this earlier! I definitely tested if coltedb worked without colte-prepaid installed, but maybe psycopg2 was installed for some other reason on my test machine. Removing the dependency is straightforward! I'll open a pull request in a moment. Could you take a look and see if it makes sense?

matt9j commented 2 years ago

This should be resolved by https://github.com/uw-ictd/colte/pull/113 . I've tested locally on a completely fresh debian Buster vm, and am able to add a user with coltedb when only colte-cn-4g is installed.