tempesta icon indicating copy to clipboard operation
tempesta copied to clipboard

Configuration parsing error: mmap_log_buffer_size

Open symstu-tempesta opened this issue 11 months ago • 2 comments

Describe the issue I cannot set the configuration value for mmap_log_buffer_size.

Expected Behavior Tempesta FW starts correctly but currently crashes when the mmap_log_buffer_size configuration parameter is set.

To Reproduce Add the following line to your Tempesta configuration and start the application:

mmap_log_buffer_size 4096;

Configuration file

            listen 80;
            server localhost:8000;

            access_log dmesg mmap mmap_host=localhost mmap_log=/tmp/access.log;
            mmap_log_buffer_size 4096;

Version or commit hash 80598c97099132d383426ae45dd45f8bf1bd675d

Stacktrace or debug log

[23215.774224] Start test: t_clickhouse.test_clickhouse_logs.TestClickhouseLogsBaseTest2.test_missing_log
[23215.933958] [tdb] Start Tempesta DB
[23215.952773] [tempesta fw] Initializing Tempesta FW kernel module...
[23216.038606] [tempesta fw] ERROR: the first character is not a letter: '4'
[23216.038609] [tempesta fw] ERROR: syntax error
[23216.038611] [tempesta fw] ERROR: configuration parsing error:
                  5:             4096;
                     ^^^^^^^^^^^^^^^^^
[23216.038613] [tempesta fw] Warning: Configuration parsing has failed. Clean up...
[23216.086674] [tempesta fw] exiting...
[23216.180309] [tdb] Shutdown Tempesta DB

symstu-tempesta avatar Jan 06 '25 19:01 symstu-tempesta

I think we should implement additional configuration file for this daemon (in JSON format) and use boost to parse it. Daemon should be started in two modes as a daemon or in a handle mode for debug purpose

EvgeniiMekhanik avatar Mar 07 '25 15:03 EvgeniiMekhanik

Please create a new wiki page for tfw_logger and document mmap_log_buffer_size there (we don't have anything about this option in our wiki). The mmap part must be moved from https://tempesta-tech.com/knowledge-base/Handling-clients/ to the new wiki page.

Now access_log must just accept two options, which can be used together: tfw_logger and dmesg. E.g.

access_log dmesg tfw_logger=/path/to/config.json

See https://github.com/tempesta-tech/tempesta/issues/2421 for the configuration changes: make the transition to the separate JSON configuration and leave the ML configuration part for #2421.

Please also rename utils to log or logger - "utils" is to generic and contains the logging daemon only, which is going to grow in the next few issues.

krizhanovsky avatar May 07 '25 12:05 krizhanovsky