Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors starting up the default andrius/asterisk image. #7

Open
gurumark opened this issue Sep 30, 2019 · 8 comments
Open

Errors starting up the default andrius/asterisk image. #7

gurumark opened this issue Sep 30, 2019 · 8 comments

Comments

@gurumark
Copy link

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!

@andrius
Copy link
Owner

andrius commented Sep 30, 2019

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

@gurumark
Copy link
Author

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.

@andrius
Copy link
Owner

andrius commented Sep 30, 2019

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)

@gurumark
Copy link
Author

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.

@andrius
Copy link
Owner

andrius commented Oct 7, 2019

Soon will send a fix :)

Sent with GitHawk

@creativeguitar
Copy link

I have the same issue, any updates ?

@koshshk
Copy link

koshshk commented May 2, 2021

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

@jfernandz
Copy link

@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 😉)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants