Hi,
I have had problems installing nav 57.1-2 on a Debian 11 from NAV repository with 'apt install nav'.
The installation give the following warning, you have the choice to click OK.
Database initialization failed
│
│ Script output:
│
│ Traceback (most recent call last):
│ File "/usr/sbin/navsyncdb", line 2, in <module>
│ from nav.pgsync import main
│ ModuleNotFoundError: No module named 'nav'
<Ok>
It is not possible to run "sudo -u postgres navsyncdb" after the installation either, same error message, for the same reason as above.
I found that the symlinks are setup somehow wrong for nav binaries installed. I'm not a good python programmer but probably the virtual env is not setup or configured as it should.
/opt/venvs/nav/bin# ls -l python*
lrwxrwxrwx 1 root root 16 Sep 18 14:09 python -> /usr/bin/python3
lrwxrwxrwx 1 root root 6 Sep 18 14:09 python3 -> python
lrwxrwxrwx 1 root root 6 Sep 18 14:09 python3.9 -> python
because in my case:
/usr/bin/python3 -> python3.11
And
### /opt/venvs/nav/pyvenv.cfg
home = /usr
implementation = CPython
version_info = 3.9.2.final.0
virtualenv = 20.4.0+ds
include-system-site-packages = false
base-prefix = /usr
base-exec-prefix = /usr
base-executable = /usr/bin/python3
So I chnged base-executable to /usr/bin/python3.9
And the links to
/opt/venvs/nav/bin# rm python
/opt/venvs/nav/bin# ln -s /usr/bin/python3.9 python
So everything points to Python 3.9.2.
Now with every attempt for installation of any package I get:
Configuring nav
│
│ Attempt to modify config file /etc/nav/db.conf failed │
│
│ Script output:
│
│ <Ok>
It seems that dpkg wants to run post installations and something goes wrong.
And this output:
Configuring nav
│
│ Database initialization failed
│
│ Script output:
│
│ connection to server at "localhost" (::1), port 5432 failed: FATAL:
│ password authentication failed for user "nav"
│ connection to server at "localhost" (::1), port 5432 failed: FATAL:
│ password authentication failed for user "nav"
│
│ Creating database nav owned by nav
│
│ <Ok>
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have tried to drop the database, creating new database, changing the password, set the password other ways, uninstall nav and reinstall but without any results.
I am out of ideas and any help is appreciated. Fixing the instalation scripts or Python venvs is it possible to do?
Kind Regards,
Kejvan