Asterisk 22 on docker not starting

Hi all, trying to install asterisk 22 on docker.
It always restart in loop.
What is wrong?
Here starting logs:

Running as user ‘asterisk’

UUID system initiated

PBX UUID: 6ecc4d67-99be-4fc4-9d33-b54f39dc7120

extract int from [5] in [0, 2147483647] gives 5

extract int from [50] in [0, 2147483647] gives 50

extract int from [20] in [0, 2147483647] gives 20

Parsing /etc/asterisk/stasis.conf

Resetting translation matrix

Increasing threadpool stasis/pool’s size by 5

Parsing /etc/asterisk/sorcery.conf

Creating topic. name: system:all, detail:

Topic ‘system:all’: 0x5612c1b375d0 created

Creating topic. name: endpoint:all, detail:

Topic ‘endpoint:all’: 0x5612c1b37d00 created

Creating topic. name: cache_pattern:0/endpoint:all, detail:

Topic ‘cache_pattern:0/endpoint:all’: 0x5612c1b37f70 created

Not changing threadpool size since new size 0 is the same as current 0

[Jan 29 12:18:47] Asterisk PBX Core Initializing

[Jan 29 12:18:47] Asterisk Dynamic Loader Starting:

[Jan 29 12:18:47] NOTICE[1]: loader.c:2559 load_modules: 347 modules will be loaded.

[Jan 29 12:18:48] NOTICE[1]: cdr.c:4585 cdr_toggle_runtime_options: CDR simple logging enabled.

[Jan 29 12:18:48] NOTICE[1]: indications.c:1100 load_indications: Default country for indication tones: us

[Jan 29 12:18:48] NOTICE[1]: indications.c:424 ast_set_indication_country: Setting default indication country to ‘us’

[Jan 29 12:18:48] – Local IPv4 address determined to be: 172.95.0.2

[Jan 29 12:18:48] – Local IPv6 address determined to be: ::1

[Jan 29 12:18:48] == ‘UDP+IPv4’ is an available SIP transport

[Jan 29 12:18:48] == ‘TCP+IPv4’ is not an available SIP transport, disabling resolver support for it

[Jan 29 12:18:48] == ‘TLS+IPv4’ is not an available SIP transport, disabling resolver support for it

[Jan 29 12:18:48] == ‘UDP+IPv6’ is not an available SIP transport, disabling resolver support for it

[Jan 29 12:18:48] == ‘TCP+IPv6’ is not an available SIP transport, disabling resolver support for it

[Jan 29 12:18:48] == ‘TLS+IPv6’ is not an available SIP transport, disabling resolver support for it

[Jan 29 12:18:48] == Endpoint my-provider is now Reachable

[Jan 29 12:18:48] == Endpoint 2002 is now Reachable

[Jan 29 12:18:48] == Endpoint 2001 is now Reachable

[Jan 29 12:18:48] == libsrtp2 2.4.2 initialized

[Jan 29 12:18:48] NOTICE[1]: res_smdi.c:1424 load_module: No SMDI interfaces are available to listen on, not starting SMDI listener.

[Jan 29 12:18:48] WARNING[1]: res_phoneprov.c:1249 get_defaults: Unable to find a valid server address or name.

[Jan 29 12:18:48] == RTP Allocating from port range 19000 → 19100

[Jan 29 12:18:48] == Binding IAX2 to default address 0.0.0.0:4569

[Jan 29 12:18:48] == 10 helper threads started

[Jan 29 12:18:48] == IAX Ready and Listening

[Jan 29 12:18:48] – Loaded provisioning template ‘default’

[Jan 29 12:18:48] NOTICE[1]: confbridge/conf_config_parser.c:2410 verify_default_profiles: Adding default_menu menu to app_confbridge

[Jan 29 12:18:48] NOTICE[1]: cel_custom.c:91 load_config: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.

[Jan 29 12:18:48] Added CEL CSV mapping for 0 files.

[Jan 29 12:18:48] == DUNDi Ready and Listening on 0.0.0.0:4520

[Jan 29 12:18:48] == UNISTIM Listening on 0.0.0.0:5000

[Jan 29 12:18:48] – Security Logging Enabled

[Jan 29 12:18:48] == Setting global variable ‘CONSOLE’ to ‘Console/dsp’

[Jan 29 12:18:48] == Setting global variable ‘TRUNK’ to ‘DAHDI/G2’

[Jan 29 12:18:48] == Setting global variable ‘TRUNKMSD’ to ‘1’

[Jan 29 12:18:48] – Including switch ‘DUNDi/e164’ in context ‘dundi-e164-switch’

[Jan 29 12:18:48] WARNING[1]: ael/pval.c:2451 check_pval_item: Warning: file /etc/asterisk/extensions.ael, line 196-196: macro call to ael-dundi-e164 cannot be found in the AEL code!

[Jan 29 12:18:48] WARNING[1]: ael/pval.c:2451 check_pval_item: Warning: file /etc/asterisk/extensions.ael, line 209-209: macro call to ael-dundi-e164 cannot be found in the AEL code!

[Jan 29 12:18:48] WARNING[1]: ael/pval.c:2451 check_pval_item: Warning: file /etc/asterisk/extensions.ael, line 328-328: macro call to ael-std-exten-ael cannot be found in the AEL code!

[Jan 29 12:18:48] == Setting global variable ‘CONSOLE-AEL’ to ‘“Console/dsp”’

[Jan 29 12:18:48] == Setting global variable ‘OUTBOUND-TRUNK’ to ‘“Zap/g2”’

[Jan 29 12:18:48] == Setting global variable ‘OUTBOUND-TRUNKMSD’ to ‘1’

[Jan 29 12:18:48] – Including switch ‘DUNDi/e164’ in context ‘ael-dundi-e164-switch’

[Jan 29 12:18:48] – Including switch ‘DUNDi/e164’ in context ‘dundi-e164-switch’

On Wednesday 29 January 2025 at 11:33:01, spady7 via Asterisk Community wrote:

Hi all, trying to install asterisk 22 on docker.
It always restart in loop.
What is wrong?

We don’t know - partly because you haven’t shown anything looping.

Antony.


“Remember: the S in IoT stands for Security.”

  • Jan-Piet Mens

I had lot of test and with asterisk 20.x it works perfectly. If I use asterisk 21.x or 22.x I always get a “Segmentation fault” on start up.
Nobody installed those versions on docker?

I found following error analyzing core dump:

#0 ast_str_hash (str=0x0) at /usr/src/asterisk-22.2.0-rc2/include/asterisk/strings.h:1263
1263 /usr/src/asterisk-22.2.0-rc2/include/asterisk/strings.h: No such file or directory.

Why still needs src files on asterisk startup?

It doesn’t need the source code at run time. It is trying to access it at debug time, to show the failing line. The actual string reference is null, which is the immediate cause of the crash. Such errors may be the result of corruption by another thread, but if not the full stack trace, not just the topmost frame, is needed for sensible debugging.

What I can do is post entire output of GDB. If not ehough, What do you need?

root@asterisk_22:/# gdb asterisk core
GNU gdb (Debian 13.1-3) 13.1
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type “show copying” and “show warranty” for details.
This GDB was configured as “x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type “help”.
Type “apropos word” to search for commands related to “word”…
Reading symbols from asterisk…
[New LWP 2997]
[New LWP 3024]
[New LWP 3025]
[New LWP 3026]
[New LWP 3027]
[New LWP 3028]
[New LWP 3032]
[New LWP 2998]
[New LWP 2999]
[New LWP 3000]
[New LWP 3001]
[New LWP 3002]
[New LWP 3003]
–Type for more, q to quit, c to continue without paging–
[New LWP 3004]
[New LWP 3005]
[New LWP 3006]
[New LWP 3007]
[New LWP 3008]
[New LWP 3009]
[New LWP 3010]
[New LWP 3011]
[New LWP 3012]
[New LWP 3013]
[New LWP 3014]
[New LWP 3015]
[New LWP 3016]
[New LWP 3017]
[New LWP 3018]
[New LWP 3019]
[New LWP 3020]
[New LWP 3021]
[New LWP 3022]
[New LWP 3023]
[New LWP 3029]
[New LWP 3030]
[New LWP 3031]
[New LWP 3033]
[New LWP 3034]
[New LWP 3035]
[New LWP 3036]
[New LWP 3037]
[New LWP 3038]
–Type for more, q to quit, c to continue without paging–
[New LWP 3039]
[New LWP 3040]
[New LWP 3041]
[New LWP 3042]
[New LWP 3043]
[New LWP 3044]
[New LWP 3045]
[New LWP 3046]
[New LWP 3047]
[New LWP 3048]
[New LWP 3049]
[New LWP 3050]
[New LWP 3051]
[New LWP 3052]
[New LWP 3053]
[New LWP 3054]
[New LWP 3055]
[New LWP 3056]
[New LWP 3057]
[New LWP 3058]
[New LWP 3059]
[New LWP 3060]
[New LWP 3061]
[New LWP 3062]
[New LWP 3063]
[New LWP 3064]
[New LWP 3065]
[New LWP 3066]
[New LWP 3067]
–Type for more, q to quit, c to continue without paging–
[New LWP 3068]
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
Core was generated by `asterisk -g’.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 ast_str_hash (str=0x0) at /usr/src/asterisk-22.2.0-rc2/include/asterisk/strings.h:1263
1263 while (*str) {
[Current thread is 1 (Thread 0x7f65a05ec7c0 (LWP 2997))]
(gdb) info frame
Stack level 0, frame at 0x7ffe73edcee0:
rip = 0x55e5019123ac in ast_str_hash (/usr/src/asterisk-22.2.0-rc2/include/asterisk/strings.h:1263); saved rip = 0x55e5018b4368
inlined into frame 1
source language c.
Arglist at unknown address.
Locals at unknown address, Previous frame’s sp in rsp

https://docs.asterisk.org/Development/Debugging/Getting-a-Backtrace/#running-ast_coredumper-for-crashes

root@asterisk_22:/# /var/lib/asterisk/scripts/ast_coredumper core
Examining core
/dev/fd/63: line 151: objdump: command not found
Doesn’t appear to be an asterisk coredump
No valid coredumps found

Very weird that I can compile and install asterisk 20.x without problems, and have to many issues with 21.x and 22.x
Something is changed in this two last releases.

Possibly another reason for not using Docker. You need to install the binutils package, assuming Debian, but if that is missing I suspect there is a lot of other things needed for debugging that are missing.

Here the full file. I cannot find error. But, for sure, because i cannot understand it :slight_smile: Can you help me?
full_.txt (293.6 KB)

You won’t be able to submit a bug report with this, as it is almost impossible to debug optimised code; you would need to rebuild without optimisation.

However, it seems to be trying to initialize the G.729 codec module, and is failing whilst trying to register because, for some reason, a null string is being passed, instead of the codec name. My guess is you are trying to use a G.729 codec module that is not compatible with your version of Asterisk.

There are generally no good technical reasons to use G.729, these days. The only reasons tend to be to interface with legacy systems, or simply inertia. As such, considering removing the module completely, and all references to g729.

You were right!!
Problem was related to g729.
I really appreciated your help.

Regards

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.