Hello all,
In my journey of writing a rc.d script to start up an instance of Odoo ERP 18 Server on FreeBSD 14.2 Jail, when the Odoo jail starts up in order to connect to a postgreSQL database, the odoo service crashes with an error : Network is unreachable Is the server running on that host and accepting TCP/IP connections?.
And that is because the assignment of the address net default gateway of the jail is after the start-up of the Odoo rc.d script
The script works well when I execute it while being logged in on the Odoo jail, but at boot time or restarting the jail, I get the message described bellow.
So my question is how to make the assignment of the default gateway of the jail happen before the starting of the Odoo rc.d script
( Jail Boot ------> assignment of the default gateway ------> Starting-up Odoo rc.d script)
In my journey of writing a rc.d script to start up an instance of Odoo ERP 18 Server on FreeBSD 14.2 Jail, when the Odoo jail starts up in order to connect to a postgreSQL database, the odoo service crashes with an error : Network is unreachable Is the server running on that host and accepting TCP/IP connections?.
And that is because the assignment of the address net default gateway of the jail is after the start-up of the Odoo rc.d script
The script works well when I execute it while being logged in on the Odoo jail, but at boot time or restarting the jail, I get the message described bellow.
So my question is how to make the assignment of the default gateway of the jail happen before the starting of the Odoo rc.d script
( Jail Boot ------> assignment of the default gateway ------> Starting-up Odoo rc.d script)
Code:
ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/lib/compat/pkg /usr/local/lib/perl5/5.36/mach/CORE
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair233b.
lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x9
groups: lo
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair233b: flags=1008842<BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:7f:2d:60:7e:0b
groups: epair
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Clearing /tmp (X related).
Recovering vi editor sessions:.
Updating motd:.
Updating /var/run/os-release done.
Creating and/or trimming log files.
Starting syslogd.
odoo18ce configuration files are :
odoo18ce_config : /usr/local/etc/odoo_erp/odoo18ce-server.conf
odoo18ce_binfile : /usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo18ce-bin
odoo18ce_python : /usr/local/bin/odoo18ce
Starting odoo18ce in 2 seconds.
Traceback (most recent call last):
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo18ce-bin", line 8, in <module>
odoo.cli.main()
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/cli/command.py", line 66, in main
o.run(args)
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/cli/server.py", line 180, in run
main(args)
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/cli/server.py", line 151, in main
odoo.service.db._create_empty_database(db_name)
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/service/db.py", line 107, in _create_empty_database
with closing(db.cursor()) as cr:
^^^^^^^^^^^
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/sql_db.py", line 784, in cursor
return Cursor(self.__pool, self.__dbname, self.__dsn)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/sql_db.py", line 288, in __init__
self._cnx = pool.borrow(dsn)
^^^^^^^^^^^^^^^^
File "/usr/local/odoo_erp/odoo18ce/.local/lib/python3.11/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/tools/func.py", line 97, in locked
return func(inst, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/odoo_erp/odoo18ce/odoo18ce_server/odoo/sql_db.py", line 712, in borrow
result = psycopg2.connect(
^^^^^^^^^^^^^^^^^
File "/usr/local/odoo_erp/odoo18ce/.local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: connection to server at "pg17db01.itlinker.local" (192.168.20.232), port 5432 failed: Network is unreachable
Is the server running on that host and accepting TCP/IP connections?
Tried to start odoo18ce but could not obtain pid.
Starting cron.
Sun Jan 26 15:11:40 CET 2025
add net default: gateway 192.168.20.1
root@desktopfreebsd:~ #
root@desktopfreebsd:~ #
root@desktopfreebsd:~ # jls
JID IP Address Hostname Path
11 pg17db01.itlinker.local /usr/local/jails/containers/pg17db01
13 apache24web01.itlinker.local /usr/local/jails/containers/apache24web01
21 odoo18erp01.itlinker.local /usr/local/jails/containers/odoo18erp01
root@desktopfreebsd:~ #