dOpensource / dsiprouter

UI Interface for implementing Kamailio to provide PBX Hosting and SIP Trunking Services
https://dsiprouter.org
Apache License 2.0
184 stars 99 forks source link

Unable to install new debian 12 virtual machine minimal install #562

Open arsenieciprian opened 3 months ago

arsenieciprian commented 3 months ago

root@sbc-b1:/opt/dsiprouter# ./dsiprouter.sh install -all dsip-init service already exists dSIPRouter CLI is already installed SipSak is already installed cron is already installed Attempting to install DNSmasq... Created symlink /etc/systemd/system/dnsmasq.service → /dev/null. Reading package lists... Done Building dependency tree... Done Reading state information... Done dnsmasq is already the newest version (2.89-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Removed "/etc/systemd/system/dnsmasq.service". Synchronizing state of dnsmasq.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable dnsmasq Failed to restart systemd-resolved.service: Unit systemd-resolved.service not found. failed loading new systemd network configurations.. reverting network changes and aborting dnsmasq install Failed to restart systemd-resolved.service: Unit systemd-resolved.service not found. DNSmasq install failed - OS install script failure root@sbc-b1:/opt/dsiprouter# uname -a Linux sbc-b1 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux root@sbc-b1:/opt/dsiprouter#

devopsec commented 3 months ago

this should be fixed in 8bd961101b57c5fa7254c6be4f81dc49977a3555

arsenieciprian commented 2 months ago

it does not work . same issue installing on clean debian

Bifur1 commented 2 months ago

There are still issues with debian 12 using netinstaller.

Before install: install systemd-resolved and dnsmasq (testing) first.

./dsiprouter install

Goes through checks and gets hung here:

Attempting to install DNSmasq... Created symlink /etc/systemd/system/dnsmasq.service → /dev/null. Reading package lists... Done Building dependency tree... Done Reading state information... Done dnsmasq is already the newest version (2.89-1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Removed "/etc/systemd/system/dnsmasq.service". Synchronizing state of dnsmasq.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable dnsmasq

Reboot server and run dsiprouter install. It finishes. Go to https://test.domain:5000 and get a 502 Bad Gateway response.

Look at nginx logs and it can't find the *.sock files. Look at /run/dsiprouter/ and it is empty.

systemctl status dsiprouer:

× dsiprouter.service - dSIPRouter Service Loaded: loaded (/lib/systemd/system/dsiprouter.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Fri 2024-04-19 15:41:25 EDT; 11s ago Duration: 608ms Process: 17532 ExecStartPre=/usr/bin/dsiprouter chown -dsiprouter (code=exited, status=0/SUCCESS) Process: 17553 ExecStart=/usr/bin/dsiprouter exec (code=exited, status=1/FAILURE) Main PID: 17553 (code=exited, status=1/FAILURE) CPU: 628ms

Apr 19 15:41:25 test.domain.com systemd[1]: dsiprouter.service: Scheduled restart job, restart counter is at 5. Apr 19 15:41:25 test.domain.com systemd[1]: Stopped dsiprouter.service - dSIPRouter Service. Apr 19 15:41:25 test.domain.com systemd[1]: dsiprouter.service: Start request repeated too quickly. Apr 19 15:41:25 test.domain.com systemd[1]: dsiprouter.service: Failed with result 'exit-code'. Apr 19 15:41:25 test.domain.com systemd[1]: Failed to start dsiprouter.service - dSIPRouter Service.

arsenieciprian commented 2 months ago

the issue persist but as observation the install stop after changing ip address of machine to dhcp . The machine have static ip but somehow the dnsmasq requests dhcp to router and change ip adress and after that ssh disconects and thats it

make[1]: Leaving directory '/usr/local/src/sipsak' SipSak was installed Attempting to install cron Reading package lists... Done Building dependency tree... Done Reading state information... Done cron is already the newest version (3.0pl1-162). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. cron was installed Attempting to install DNSmasq... Unit dnsmasq.service does not exist, proceeding anyway. Created symlink /etc/systemd/system/dnsmasq.service → /dev/null. Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: dns-root-data dnsmasq-base libnetfilter-conntrack3 libnfnetlink0 Suggested packages: resolvconf The following NEW packages will be installed: dns-root-data dnsmasq dnsmasq-base libnetfilter-conntrack3 libnfnetlink0 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 593 kB of archives. After this operation, 1,455 kB of additional disk space will be used. Get:1 https://deb.debian.org/debian bookworm/main amd64 dns-root-data all 2023010101 [4,124 B] Get:2 https://deb.debian.org/debian bookworm/main amd64 libnfnetlink0 amd64 1.0.2-2 [15.1 kB] Get:3 https://deb.debian.org/debian bookworm/main amd64 libnetfilter-conntrack3 amd64 1.0.9-3 [40.7 kB] Get:4 https://deb.debian.org/debian bookworm/main amd64 dnsmasq-base amd64 2.89-1 [501 kB] Get:5 https://deb.debian.org/debian bookworm/main amd64 dnsmasq all 2.89-1 [32.4 kB] Fetched 593 kB in 0s (1,538 kB/s) Selecting previously unselected package dns-root-data. (Reading database ... 38155 files and directories currently installed.) Preparing to unpack .../dns-root-data_2023010101_all.deb ... Unpacking dns-root-data (2023010101) ... Selecting previously unselected package libnfnetlink0:amd64. Preparing to unpack .../libnfnetlink0_1.0.2-2_amd64.deb ... Unpacking libnfnetlink0:amd64 (1.0.2-2) ... Selecting previously unselected package libnetfilter-conntrack3:amd64. Preparing to unpack .../libnetfilter-conntrack3_1.0.9-3_amd64.deb ... Unpacking libnetfilter-conntrack3:amd64 (1.0.9-3) ... Selecting previously unselected package dnsmasq-base. Preparing to unpack .../dnsmasq-base_2.89-1_amd64.deb ... Unpacking dnsmasq-base (2.89-1) ... Selecting previously unselected package dnsmasq. Preparing to unpack .../dnsmasq_2.89-1_all.deb ... Unpacking dnsmasq (2.89-1) ... Setting up dns-root-data (2023010101) ... Setting up libnfnetlink0:amd64 (1.0.2-2) ... Setting up libnetfilter-conntrack3:amd64 (1.0.9-3) ... Setting up dnsmasq-base (2.89-1) ... Setting up dnsmasq (2.89-1) ... Failed to preset unit, unit /etc/systemd/system/dnsmasq.service is masked. /usr/bin/deb-systemd-helper: error: systemctl preset failed on dnsmasq.service: No such file or directory Processing triggers for libc-bin (2.36-9+deb12u4) ... Processing triggers for man-db (2.11.2-2) ... Processing triggers for dbus (1.14.10-1~deb12u1) ... Removed "/etc/systemd/system/dnsmasq.service". Synchronizing state of dnsmasq.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable dnsmasq Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service. client_loop: send disconnect: Broken pipe ciprian@Ciprians-MacBook-Pro ~ %

devopsec commented 2 months ago

Fixed in 9e9daed667dc53b43d2d4e2b28ecc8f01d4371ab on v0.75 branch

Just tested this with Debian12 NetIso on virtualbox.

su -
apt install -y git
git clone -b v0.75 https://github.com/dOpensource/dsiprouter.git /opt/dsiprouter
/opt/dsiprouter/dsiprouter.sh install -all
arsenieciprian commented 2 months ago

for me ends here

patching file kamdbctl.base patching file kamdbctl.mysql -e \E[37;33mINFO: creating database kamailio ... -e \E[37;33mINFO: granting privileges to database kamailio ... -e \E[37;33mINFO: creating standard tables into kamailio ... -e \E[37;33mINFO: Core Kamailio tables successfully created. -e \E[37;33mINFO: creating presence tables into kamailio ... -e \E[37;33mINFO: Presence tables successfully created. -e \E[37;33mINFO: creating extra tables into kamailio ... -e \E[37;33mINFO: Extra tables successfully created. -e \E[37;33mINFO: creating uid tables into kamailio ... -e \E[37;33mINFO: UID tables successfully created. success success success success success success Synchronizing state of kamailio.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable kamailio Cloning into '/usr/local/src/libjwt'... fatal: unable to access 'https://github.com/benmcollins/libjwt.git/': Failed to connect to github.com port 443 after 33 ms: Couldn't connect to server /opt/dsiprouter/kamailio/debian/12.sh: line 168: cd: /usr/local/src/libjwt: No such file or directory Failed to compile and install libjwt kamailio install failed @.***:~#

On 22 Apr 2024, at 23:02, Tyler Moore @.***> wrote:

Fixed in 9e9daed https://github.com/dOpensource/dsiprouter/commit/9e9daed667dc53b43d2d4e2b28ecc8f01d4371ab on v0.75 branch

Just tested this with Debian12 NetIso on virtualbox.

su - apt install -y git git clone -b v0.75 https://github.com/dOpensource/dsiprouter.git /opt/dsiprouter /opt/dsiprouter/dsiprouter.sh install -all — Reply to this email directly, view it on GitHub https://github.com/dOpensource/dsiprouter/issues/562#issuecomment-2070854870, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3ENNK6FZ6QRUWCDUD2VIZ3Y6VUFXAVCNFSM6AAAAABEUGETDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZQHA2TIOBXGA. You are receiving this because you authored the thread.

devopsec commented 2 months ago

@arsenieciprian That looks like a separate issue. Looks like your network connection caused git to fail cloning a dependency repo.

Since we do have extensive git dependencies in the install scripts that may be something to look into (try / timeouts for git commands in the install scripts). Something like this:

tryGit() {
    local TIMEOUT=5

    timeout "TIMEOUT" bash <<EOF 2>/dev/null
while true; do
    git "$@" && break
    sleep 1
done
EOF
    return $?
}

tryGit https://github.com/benmcollins/libjwt.git /usr/local/src/libjwt

Not sure if any other users are running into issues with install scripts due to network stability issues though.. If others are experiencing this as well then we can look further into it..

NNYGitHub commented 2 months ago

the issue persist but as observation the install stop after changing ip address of machine to dhcp . The machine have static ip but somehow the dnsmasq requests dhcp to router and change ip adress and after that ssh disconects and thats it

You have to define the static ip using systemd-networkd in /etc/systemd/network starting with a number below 99 (for instance: 11-wan.network ) - then the installation works.

devopsec commented 2 months ago

@NNYGitHub has a good point here, we can not support every legacy network configuration on the newer network stack, otherwise we would have too many use cases and the complexity would be too high..
We are sticking with the upstream's network stack (debian) as defined in their flagship ISO (full dvd install).
So when you are installing on a different ISO (such as net installer) expect the same network stack as the DVD ISO to be installed, i.e. for Debian 12 that would be systemd-resolved/libnss-resolve.
If the ISO you are deploying on is a fork of the upstream ISO (such as a cloud provider's VM image) it may contain a different default stack, which will be replaced by the standard network stack from the upstream OS maintainers.

I hope that explanation helps.

Do note that when GNOME is installed in the calamares installer or via package manager network-manager is also installed.
This integration in particular is handled by giving priority to the network resolver instead of network-manager.
If you find a better way to integrate with network-manager I am all ears, but we are trying to reduce complexity, not increase it.

Cheers