[Home]

Summary:ASTERISK-25424: asterisk.conf syntax error causes inscrutable crash
Reporter:Norman Henderson (nhenderson)Labels:
Date Opened:2015-09-26 05:47:14Date Closed:2015-10-01 09:40:35
Priority:MinorRegression?
Status:Closed/CompleteComponents:Core/Sorcery
Versions:13.5.0 Frequency of
Occurrence
Related
Issues:
Environment:Ubuntu 14.04. Freepbx 2.11.0.43. Previous system had been 12.04 and Asterisk 1.8. Attachments:
Description:After upgrade, I installed Asterisk 13.5.0 from source. I ended up with the following first line in asterisk.conf:
{noformat}
[directories];(!) ; remove the (!) to enable this

This appears to have caused Asterisk to crash during startup with:
== Parsing '/etc/asterisk/asterisk.conf': Found
 == Sorcery registered wizard 'bucket'
 == Sorcery registered wizard 'bucket_file'
Cannot update type 'bucket' in module 'core' because it has no existing documentation!
Failed to register 'bucket' object type in Bucket sorcery
Failed: ast_bucket_init
{noformat}

Apparently the correct syntax from 13.5.0 asterisk.conf.dpkg-dist is
{noformat}
[directories](!)
{noformat}

(1) This syntax and its meaning or effect does not appear to be documented. Nor is there much relevant to the Sorcery / bucket issue in extensive searching - eventually I found one IRC comment in which an unrelated asterisk.conf error caused a similar crash.
(2) Config file syntax errors should provide a meaningful error message; this is a basic principle of system design.
Comments:By: Asterisk Team (asteriskteam) 2015-09-26 05:47:15.750-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Rusty Newton (rnewton) 2015-09-30 17:46:17.726-0500

{quote}
(1) This syntax and its meaning or effect does not appear to be documented. Nor is there much relevant to the Sorcery / bucket issue in extensive searching - eventually I found one IRC comment in which an unrelated asterisk.conf error caused a similar crash.
{quote}
Template syntax is documented here: https://wiki.asterisk.org/wiki/display/AST/Templates

I believe it also documented in a few sample configuration files.

{quote}
(2) Config file syntax errors should provide a meaningful error message; this is a basic principle of system design.
{quote}

For sure and typically they do. Obviously a crash like the one you encountered was not by design.


Unfortunately I cannot reproduce your crash and I don't understand the report exactly.

In the Asterisk 13.5.0 source the asterisk.conf sample file first line shows as:
{noformat}
[directories](!)
{noformat}

I cannot reproduce a crash with this line or by using the line you describe having after your installation.

Do you have any further detail on how the crash can be reproduced?



By: Norman Henderson (nhenderson) 2015-10-01 01:04:25.339-0500

Unfortunately I can't reproduce it now either, sorry. There may have been something else I changed in asterisk.conf at the same time, but it was 5 AM and my notes aren't that comprehensive :) The rest of the config files are managed by FreePBX so I can't really get back to the exact state at time of failure.

I guess the only further question is whether it's appropriate to use the template syntax for [directories]. Certainly it confused me - but then again I didn't know Asterisk had added a template feature and didn't recognize what it was. I don't see how such a template would be "applied" in some later section. If for some strange reason you wanted to omit the [directories] section, comment markers would be a better way to do that IMHO.

By: Rusty Newton (rnewton) 2015-10-01 09:40:35.742-0500

bq. Unfortunately I can't reproduce it now either, sorry. There may have been something else I changed in asterisk.conf at the same time, but it was 5 AM and my notes aren't that comprehensive The rest of the config files are managed by FreePBX so I can't really get back to the exact state at time of failure.

No worries!

bq. I guess the only further question is whether it's appropriate to use the template syntax for [directories]. Certainly it confused me - but then again I didn't know Asterisk had added a template feature and didn't recognize what it was.

It wasn't added recently. Templates go way back to Asterisk's early days.

bq. I don't see how such a template would be "applied" in some later section. If for some strange reason you wanted to omit the [directories] section, comment markers would be a better way to do that IMHO.

The directories template has been that way for ages. I'm not opposed to changing it. You are right it could be confusing to people (though this is the only report we have had, others may not report it). If you feel strongly about it you can create a new issue, submit a patch to change the .conf file and submit it to Gerrit for review.

There is always a lot to improve and as an open source project we depend on the community for these sorts of little improvements.

Thanks!


By: Boris Rybalkin (cyberbob) 2016-03-27 06:50:34.691-0500

Hello,

I am having the same issue (probably because I am new to the project).
I have compiled 13.7.2. (I had working setup using debian package v11)

Asterisk was compiled only with --prefix /opt/app/talk/asterisk, but I thought I can override everything in asterisk.conf
 
Took this config:
https://github.com/asterisk/asterisk/blob/13.7/configs/basic-pbx/asterisk.conf

{code}
[directories]
astetcdir = /opt/app/talk/config/asterisk
astmoddir = /opt/app/talk/asterisk/lib/asterisk/modules
astvarlibdir = /opt/app/talk/asterisk/var/lib/asterisk
astdbdir = /opt/app/talk/asterisk/var/lib/asterisk
astkeydir = /opt/app/talk/asterisk/var/lib/asterisk
astdatadir = /opt/data/talk/asterisk
astagidir = /opt/app/talk/asterisk/var/lib/asterisk/agi-bin
astspooldir = /opt/data/talk/asterisk/spool
astrundir = /opt/data/talk/asterisk/run
astlogdir = /opt/data/talk/log
astsbindir = /opt/app/talk/asterisk/sbin
...
{code}

Started:

{code}
/opt/app/talk/asterisk/sbin/asterisk -vvcf -C /opt/app/talk/config/asterisk/asterisk.conf
{code}

Now I get the error:
{code}
Parsing '/opt/app/talk/config/asterisk/asterisk.conf': Found
 == Sorcery registered wizard 'bucket'
 == Sorcery registered wizard 'bucket_file'
Cannot update type 'bucket' in module 'core' because it has no existing documentation!
Failed to register 'bucket' object type in Bucket sorcery
Failed: ast_bucket_init
{code}

At the same time I see that this sample has template format (which is confusing, not sure what is the right ):
https://github.com/asterisk/asterisk/blob/13.7/configs/samples/asterisk.conf.sample

{code}
[directories](!)
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /var/lib/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
...
{code}

So I believe I have several questions:

1. How can I debug the error?
2. Is this the right format of overriding directories?
3. Is it possible to override directories in run time as opposed to compile time flags?

Thank you.

By: Boris Rybalkin (cyberbob) 2016-03-27 14:40:50.372-0500

OK, found a problem.

After running 'make basic-pbx' and checking what config it generates, I have found that the right format is to use arrows (=>).

{code}
[directories]
astetcdir => /opt/app/talk/config/asterisk
...
{code}

And the other problem was that astdatadir was pointing to wrong dir.

After fixing that everything worked as expected.

By: Brian Wilson (bwilson) 2016-05-15 19:03:30.830-0500

I was getting this error when the documentation folder was missing with 13.9.1

cd /var/lib/asterisk
mv documentation foo
/usr/sbin/asterisk -f -C /etc/asterisk.conf
Asterisk 13.9.1, Copyright (C) 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Parsing /etc/asterisk/extconfig.conf
 == Parsing '/etc/asterisk/extconfig.conf': Found
 == Binding queue_members to odbc/asterisk/queue_members
 == Binding sippeers to odbc/asterisk/sippeers
 == Binding voicemail to odbc/asterisk/voicemail
Resetting translation matrix
UUID system initiated
 == Registered 'audio' codec 'g723' at sample rate '8000' with id '1'
 == Created cached format with name 'g723'
 == Registered 'audio' codec 'ulaw' at sample rate '8000' with id '2'
 == Created cached format with name 'ulaw'
 == Registered 'audio' codec 'alaw' at sample rate '8000' with id '3'
 == Created cached format with name 'alaw'
 == Registered 'audio' codec 'gsm' at sample rate '8000' with id '4'
 == Created cached format with name 'gsm'
 == Registered 'audio' codec 'g726' at sample rate '8000' with id '5'
 == Created cached format with name 'g726'
 == Registered 'audio' codec 'g726aal2' at sample rate '8000' with id '6'
 == Created cached format with name 'g726aal2'
 == Registered 'audio' codec 'adpcm' at sample rate '8000' with id '7'
 == Created cached format with name 'adpcm'
 == Registered 'audio' codec 'slin' at sample rate '8000' with id '8'
 == Created cached format with name 'slin'
 == Registered 'audio' codec 'slin' at sample rate '12000' with id '9'
 == Created cached format with name 'slin12'
 == Registered 'audio' codec 'slin' at sample rate '16000' with id '10'
 == Created cached format with name 'slin16'
 == Registered 'audio' codec 'slin' at sample rate '24000' with id '11'
 == Created cached format with name 'slin24'
 == Registered 'audio' codec 'slin' at sample rate '32000' with id '12'
 == Created cached format with name 'slin32'
 == Registered 'audio' codec 'slin' at sample rate '44100' with id '13'
 == Created cached format with name 'slin44'
 == Registered 'audio' codec 'slin' at sample rate '48000' with id '14'
 == Created cached format with name 'slin48'
 == Registered 'audio' codec 'slin' at sample rate '96000' with id '15'
 == Created cached format with name 'slin96'
 == Registered 'audio' codec 'slin' at sample rate '192000' with id '16'
 == Created cached format with name 'slin192'
 == Registered 'audio' codec 'lpc10' at sample rate '8000' with id '17'
 == Created cached format with name 'lpc10'
 == Registered 'audio' codec 'g729' at sample rate '8000' with id '18'
 == Created cached format with name 'g729'
 == Registered 'audio' codec 'speex' at sample rate '8000' with id '19'
 == Created cached format with name 'speex'
 == Registered 'audio' codec 'speex' at sample rate '16000' with id '20'
 == Created cached format with name 'speex16'
 == Registered 'audio' codec 'speex' at sample rate '32000' with id '21'
 == Created cached format with name 'speex32'
 == Registered 'audio' codec 'ilbc' at sample rate '8000' with id '22'
 == Created cached format with name 'ilbc'
 == Registered 'audio' codec 'g722' at sample rate '16000' with id '23'
 == Created cached format with name 'g722'
 == Registered 'audio' codec 'siren7' at sample rate '16000' with id '24'
 == Created cached format with name 'siren7'
 == Registered 'audio' codec 'siren14' at sample rate '32000' with id '25'
 == Created cached format with name 'siren14'
 == Registered 'audio' codec 'testlaw' at sample rate '8000' with id '26'
 == Created cached format with name 'testlaw'
 == Registered 'audio' codec 'g719' at sample rate '48000' with id '27'
 == Created cached format with name 'g719'
 == Registered 'audio' codec 'opus' at sample rate '48000' with id '28'
 == Created cached format with name 'opus'
 == Registered 'image' codec 'jpeg' at sample rate '0' with id '29'
 == Created cached format with name 'jpeg'
 == Registered 'image' codec 'png' at sample rate '0' with id '30'
 == Created cached format with name 'png'
 == Registered 'video' codec 'h261' at sample rate '0' with id '31'
 == Created cached format with name 'h261'
 == Registered 'video' codec 'h263' at sample rate '0' with id '32'
 == Created cached format with name 'h263'
 == Registered 'video' codec 'h263p' at sample rate '0' with id '33'
 == Created cached format with name 'h263p'
 == Registered 'video' codec 'h264' at sample rate '0' with id '34'
 == Created cached format with name 'h264'
 == Registered 'video' codec 'mpeg4' at sample rate '0' with id '35'
 == Created cached format with name 'mpeg4'
 == Registered 'video' codec 'vp8' at sample rate '0' with id '36'
 == Created cached format with name 'vp8'
 == Registered 'text' codec 'red' at sample rate '0' with id '37'
 == Created cached format with name 'red'
 == Registered 'text' codec 't140' at sample rate '0' with id '38'
 == Created cached format with name 't140'
 == Registered 'audio' codec 'none' at sample rate '8000' with id '39'
 == Created cached format with name 'none'
Parsing /etc/asterisk/asterisk.conf
 == Parsing '/etc/asterisk/asterisk.conf': Found
gl_pathc 0
 == Sorcery registered wizard 'bucket'
 == Sorcery registered wizard 'bucket_file'
Cannot update type 'bucket' in module 'core' because it has no existing documentation!
Failed to register 'bucket' object type in Bucket sorcery
Failed: ast_bucket_init