asterisk icon indicating copy to clipboard operation
asterisk copied to clipboard

Errors starting up the default andrius/asterisk image.

Open gurumark opened this issue 6 years ago • 8 comments

I get the following in the logs after running andrius/asterisk image: [Sep 30 01:02:36] == Registered application 'MSet' [Sep 30 01:02:36] == Registered channel type 'Local' (Local Proxy Channel Driver) [Sep 30 01:02:36] == Manager registered action LocalOptimizeAway [Sep 30 01:02:36] Asterisk Dynamic Loader Starting: [Sep 30 01:02:36] WARNING[1]: loader.c:2222 loader_config_init: 'modules.conf' invalid or missing. [Sep 30 01:02:36] ERROR[1]: asterisk.c:3926 check_init: Module initialization failed. ASTERISK EXITING! [Sep 30 01:02:36] == Manager unregistered action DBGet [Sep 30 01:02:36] == Manager unregistered action DBPut [Sep 30 01:02:36] == Manager unregistered action DBDel [Sep 30 01:02:36] == Manager unregistered action DBDelTree Huh? Child handler, but nobody there?

thanks!

gurumark avatar Sep 30 '19 01:09 gurumark

Please paste your docker startup command or docker-compose config section for this asterisk instance; there is many images with various asterisk versions and I shall know which one you did use and of course try to replicate issue

andrius avatar Sep 30 '19 09:09 andrius

Thanks for your quick response! The errors on my issue are for: docker run -ti --rm
-e ASTERISK_UID=id -u
-e ASTERISK_GID=id -g
-v ${PWD}/logs:/var/log/asterisk
andrius/asterisk

After that I ran the debian-stretch-slim-17-current edition, I got the following:

[Sep 30 01:56:55] WARNING[1]: loader.c:2381 load_modules: Some non-required modules failed to load. [Sep 30 01:56:55] ERROR[1]: loader.c:2396 load_modules: cel_sqlite3_custom declined to load. [Sep 30 01:56:55] ERROR[1]: loader.c:2396 load_modules: cdr_sqlite3_custom declined to load.

gurumark avatar Sep 30 '19 11:09 gurumark

Regarding alpine version (andrius/asterisk), first I suggest as for now to use tag edge, so andrius/asterisk:edge. As for today it provide latest stable 16.x Asterisk version, after upcoming release of Alpine Linux it will be in official stable repository;

The problem you had is linux permissions, it did not load modules.conf file because of environment variables ASTERISK_UID and ASTERISK_GID.

Just don't use it now and start this way:

docker run -ti --rm andrius/asterisk

Regarding second part, because you don't have CEL and CDR sqlite3 configs, it was failed. That's normal and generally it is better to use ODBC and postgresql or mariadb (mysql)

andrius avatar Sep 30 '19 12:09 andrius

I tested the image using andrius/asterisk:edge but ended up with the same error. How can I fix the permission issue so Asterisk starts? What should I put in the env variables? I'd rather not use root.

gurumark avatar Sep 30 '19 14:09 gurumark

Soon will send a fix :)

Sent with GitHawk

andrius avatar Oct 07 '19 18:10 andrius

I have the same issue, any updates ?

creativeguitar avatar Apr 09 '20 22:04 creativeguitar

@andrius, you seems to forgot to "chown" /etc/asterisk, so asterisk unable to read it's configuration when running under custom UID and GID.

koshshk avatar May 02 '21 21:05 koshshk

@koshshk sure! but if you are going to run asterisk in a docker container ... you don't need to have your config files at /etc, you can just create a folder called config and a folder for logs and then run the image like:

docker run -ti -d --rm \
	--name=asterisk_new \
	-e ASTERISK_UID=`id -u` \
	-e ASTERISK_GID=`id -g` \
	-v ${PWD}/config:/etc/asterisk \
	-v ${PWD}/logs:/var/log/asterisk \
	andrius/asterisk

you may of course drop -d and --rm if you want (that way you'll be able to tune your config files as your regular user and read logs :wink:)

jfernandz avatar Nov 09 '22 17:11 jfernandz