Ubuntu Install Issues

Status
Not open for further replies.

dandickson

New Member
Jan 15, 2020
8
1
3
Looks like the freeswitch database module isn't loading correctly on a fresh Ubuntu 20.04 install:


Code:
2021-10-04 18:45:45.584687 [ERR] switch_core_db.c:241 SQL ERR [unable to open database file]
2021-10-04 18:45:45.584687 [CRIT] switch_core_sqldb.c:646 Failure to connect to CORE_DB pgsql://hostaddr=127.0.0.1 port=5432 dbname=fusionpbx user=fusionpbx password=removed options=''!
2021-10-04 18:45:45.584687 [ERR] freeswitch_lua.cpp:374 Connection failed. DBH NOT Connected.
2021-10-04 18:45:45.584687 [ERR] mod_lua.cpp:202 ...eeswitch/scripts/resources/functions/database/native.lua:27: assertion failed!
stack traceback:
[C]: in function 'assert'
...eeswitch/scripts/resources/functions/database/native.lua:27: in function 'new'
...hare/freeswitch/scripts/resources/functions/database.lua:87: in function <...hare/freeswitch/scripts/resources/functions/database.lua:86>
(...tail calls...)
...xml_handler/resources/scripts/configuration/acl.conf.lua:55: in main chunk
[C]: in function 'dofile'
/usr/share/freeswitch/scripts/app/xml_handler/index.lua:95: in main chunk
/usr/share/freeswitch/scripts/app.lua:48: in main chunk
2021-10-04 18:45:45.584687 [ERR] mod_lua.cpp:270 LUA script parse/execute error!
2021-10-04 18:45:45.584687 [INFO] mod_enum.c:884 ENUM Reloaded
2021-10-04 18:45:45.584687 [INFO] switch_time.c:1430 Timezone reloaded 530 definitions
 

Neoscopio

New Member
Oct 6, 2021
12
1
3
54
Looks like the freeswitch database module isn't loading correctly on a fresh Ubuntu 20.04 install:


Code:
2021-10-04 18:45:45.584687 [ERR] switch_core_db.c:241 SQL ERR [unable to open database file]
2021-10-04 18:45:45.584687 [CRIT] switch_core_sqldb.c:646 Failure to connect to CORE_DB pgsql://hostaddr=127.0.0.1 port=5432 dbname=fusionpbx user=fusionpbx password=removed options=''!
2021-10-04 18:45:45.584687 [ERR] freeswitch_lua.cpp:374 Connection failed. DBH NOT Connected.
2021-10-04 18:45:45.584687 [ERR] mod_lua.cpp:202 ...eeswitch/scripts/resources/functions/database/native.lua:27: assertion failed!
stack traceback:
[C]: in function 'assert'
...eeswitch/scripts/resources/functions/database/native.lua:27: in function 'new'
...hare/freeswitch/scripts/resources/functions/database.lua:87: in function <...hare/freeswitch/scripts/resources/functions/database.lua:86>
(...tail calls...)
...xml_handler/resources/scripts/configuration/acl.conf.lua:55: in main chunk
[C]: in function 'dofile'
/usr/share/freeswitch/scripts/app/xml_handler/index.lua:95: in main chunk
/usr/share/freeswitch/scripts/app.lua:48: in main chunk
2021-10-04 18:45:45.584687 [ERR] mod_lua.cpp:270 LUA script parse/execute error!
2021-10-04 18:45:45.584687 [INFO] mod_enum.c:884 ENUM Reloaded
2021-10-04 18:45:45.584687 [INFO] switch_time.c:1430 Timezone reloaded 530 definitions

I can confirm this. There are some compilation failures on switch when installing fusionpbx but it still gets installed.

There's a bug opened in switch related to this:

Maybe downgrading and locking postgres version, and reinstalling can solve the problem.

I've opened a ticket in fusionpbx and it's confirmed.
 

dandickson

New Member
Jan 15, 2020
8
1
3
I figured it was a postgres version issue and just pulled a base image from a system I already have deployed so I could move forward faster.

Looking at the code, it looks like https://github.com/fusionpbx/fusionpbx-install.sh/blob/master/ubuntu/resources/postgresql.sh on line 22 needs to be locked to a version:

Code:
apt-get install -y sudo postgresql

changes to:

Code:
apt-get install -y sudo postgresql-13

Initially I thought this might cause a negative issue where live systems are held at old versions of postgres however I looked over a few live systems and it seems that postgres just stacks versions on the same system and older systems can end up running several versions at the same time (although only the original version installed is active).
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
Yep, I noticed it the other day, Ubuntu is pulling the latest postgresql 14 which seems to bring problems.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
It was brought to my attention a few days ago. Also noticed the mod_pgsql compile issue. Thanks for the idea I'll give it a try.

On a side note I fixed the CentOS 7 install script yesterday. Its working with PostgreSQL 14 but that uses a pre-compiled package from FreeSWITCH.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
First attempt failed. It did install PostgreSQL 13 but may have dependencies like libpq that might be 14. So will be trying again as time permits.
 

Neoscopio

New Member
Oct 6, 2021
12
1
3
54
I was able to get it working:

I removed postrgres repositories and changed the install script to just apt install posrgresql from ubuntu repositories (ver 12)

Now I can check in fs_cli:

freeswitch@pbx> module_exists mod_pgsql true freeswitch@pbx> module_exists mod_sofia true

I've installed on a local network, so I cant test any real sip configuration for now, but it seems to be working
 
  • Like
Reactions: markjcrane

markjcrane

Active Member
Staff member
Jul 22, 2018
499
177
43
49
I've updated the install script to use the operating system default repo for PostgreSQL. Running a new install to confirm it is working.

UPDATE: confirmed the Ubuntu Install script is Working again. Sending a virtual high five to Neoscopio for the idea.
 
Last edited:
  • Like
Reactions: Neoscopio
Status
Not open for further replies.