unit icon indicating copy to clipboard operation
unit copied to clipboard

Coredump if port 443 is occupied by another process ( Almalinux 9 )

Open phpclub opened this issue 1 year ago • 4 comments

Coredump if port 443 is busy another process

unitd --version unit version: 1.32.1 configured as ./configure --prefix=/usr --statedir=/var/lib/unit --control=unix:/var/run/unit/control.sock --runstatedir=/var/run --pid=/var/run/unit/unit.pid --logdir=/var/log --log=/var/log/unit/unit.log --tmpdir=/var/tmp --user=unit --group=unit --tests --openssl --njs --modulesdir=/usr/lib64/unit/modules --libdir=/usr/lib64 --cc-opt='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC' --ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

2024/07/19 08:42:01 [alert] 16509#16511 *40 SSL_do_handshake(18) failed (258: unsupported protocol) (OpenSSL: error:0A000102:SSL routines::unsupported protoco l) 2024/07/19 08:42:02 [alert] 16509#16511 *41 SSL_do_handshake(18) failed (396: version too low) (OpenSSL: error:0A00018C:SSL routines::version too low) 2024/07/19 09:32:51 [notice] 11531#11531 process 16509 exited with code 0 2024/07/19 09:32:51 [notice] 11531#11531 process 11533 exited with code 0 2024/07/19 09:34:39 [info] 796#796 discovery started 2024/07/19 09:34:39 [notice] 796#796 module: php 8.0.27 "/usr/lib64/unit/modules/php.unit.so" 2024/07/19 09:34:39 [info] 795#795 controller started 2024/07/19 09:34:39 [notice] 795#795 process 796 exited with code 0 2024/07/19 09:34:39 [info] 798#798 router started 2024/07/19 09:34:39 [info] 798#798 OpenSSL 3.0.7 1 Nov 2022, 30000070 2024/07/19 09:34:39 [alert] 795#795 bind("0.0.0.0:443") failed (98: Address already in use) 2024/07/19 09:34:39 [alert] 798#798 failed to apply new conf 2024/07/19 09:34:39 [alert] 797#797 failed to apply previous configuration 2024/07/19 09:34:39 [alert] 795#795 process 797 exited on signal 11 (core dumped) 2024/07/19 09:34:39 [info] 795#795 controller started 2024/07/19 09:34:39 [alert] 795#795 bind("0.0.0.0:443") failed (98: Address already in use) 2024/07/19 09:34:39 [alert] 798#798 failed to apply new conf 2024/07/19 09:34:39 [alert] 804#804 failed to apply previous configuration 2024/07/19 09:34:39 [alert] 795#795 process 804 exited on signal 11 (core dumped) 2024/07/19 09:34:39 [info] 795#795 controller started 2024/07/19 09:34:39 [alert] 795#795 bind("0.0.0.0:443") failed (98: Address already in use) 2024/07/19 09:34:39 [alert] 798#798 failed to apply new conf 2024/07/19 09:34:39 [alert] 810#810 failed to apply previous configuration 2024/07/19 09:34:39 [alert] 795#795 process 810 exited on signal 11 (core dumped) 2024/07/19 09:34:39 [info] 795#795 controller started 2024/07/19 09:34:39 [alert] 795#795 bind("0.0.0.0:443") failed (98: Address already in use) 2024/07/19 09:34:39 [alert] 798#798 failed to apply new conf 2024/07/19 09:34:39 [alert] 816#816 failed to apply previous configuration

phpclub avatar Jul 19 '24 07:07 phpclub

Can't reproduce here...

{
    "listeners": {
        "[::]:80": {
            "pass": "routes"
        },
        "[::]:443": {
            "pass": "routes",
            "tls": {
                "certificate": "bundle"
            }
        }
     },

    "routes": [
        {
            "action": {
                "share": "/srv/unit$uri"
            }
        }
    ]
}
2024/07/25 15:57:12 [info] 12590#12590 discovery started
2024/07/25 15:57:12 [info] 12589#12589 controller started
2024/07/25 15:57:12 [info] 12592#12592 router started
2024/07/25 15:57:12 [info] 12592#12592 OpenSSL 3.2.1 30 Jan 2024, 30200010
2024/07/25 15:57:12 [notice] 12589#12589 process 12590 exited with code 0
2024/07/25 15:57:12 [alert] 12589#12589 bind(\"[::]:443\") failed (98: Address already in use)
2024/07/25 15:57:12 [alert] 12592#12592 failed to apply new conf
2024/07/25 15:57:12 [alert] 12591#12591 failed to apply previous configuration

Could you provide your Unit config and a clean unit log from when you start unit?

I'm curious what's generating these mesaages

2024/07/19 08:42:01 [alert] 16509#16511 *40 SSL_do_handshake(18) failed (258: unsupported protocol) (OpenSSL: error:0A000102:SSL routines::unsupported protoco
l)
2024/07/19 08:42:02 [alert] 16509#16511 *41 SSL_do_handshake(18) failed (396: version too low) (OpenSSL: error:0A00018C:SSL routines::version too low)

ac000 avatar Jul 25 '24 15:07 ac000

I'm curious what's generating these messages

The *40 and *41 entries look suspiciously like the connection ID value in a github.com/nginx/nginx error log.

Makes me wonder if this is the stderr dump from a Docker container with both nginx and unit installed and running???

lcrilly avatar Jul 25 '24 15:07 lcrilly

There was an application running acme-dns that listened to port 443. The bug is that unit should not crash but exit with an error in this case. https://github.com/kohanaworld/acme-dns

phpclub avatar Aug 01 '24 10:08 phpclub

There was an application running acme-dns that listened to port 443. The bug is that unit should not crash but exit with

Correct, Unit shouldn't crash, but I was unable to reproduce this.

If you can get a backtrace from a core dump that may help... or at the very least a clean log from starting Unit and it crashing, with nothing else going on like those other messages that appeared.

ac000 avatar Aug 01 '24 12:08 ac000