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

redis_cmd with more than two %s insertions creates parse errors #2456

Closed
dig12345 opened this issue Aug 25, 2020 · 2 comments
Closed

redis_cmd with more than two %s insertions creates parse errors #2456

dig12345 opened this issue Aug 25, 2020 · 2 comments

Comments

@dig12345
Copy link

Description

Add a redis_cmd() call with more than two %s insertions. Kamailio throws parse errors at startup. See below for example and log messages.

Troubleshooting

This line works fine:
redis_cmd("kam_redis", "SET %s %s-bar, "test_key", "foo" "r");

This one does not:
redis_cmd("kam_redis", "SET %s %s-%s, "test_key", "foo", "bar, "r");

Reproduction

Add a line like this:
redis_cmd("kam_redis", "SET %s %s-%s, "test_key", "foo", "bar, "r");

Log Messages

2020-08-13T16:39:05.468806+00:00,vagrant-ubuntu-xenial-64: CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 424, column 117: Too many arguments
2020-08-13T16:39:05.472800+00:00,vagrant-ubuntu-xenial-64: CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 424, column 117: '('')' expected (function call)
2020-08-13T16:39:05.473289+00:00,vagrant-ubuntu-xenial-64: CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 424, column 117: bad command: missing ';'?
2020-08-13T16:39:05.473927+00:00,vagrant-ubuntu-xenial-64: ERROR: <core> [core/cfg.y:3363]: yyparse(): function used inside params of another function: xlog
2020-08-13T16:39:05.475417+00:00,vagrant-ubuntu-xenial-64: CRITICAL: <core> [core/cfg.y:3517]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 426, column 9: use of function execution inside params not allowed`

Additional Information

  • Kamailio Version - output of kamailio -v
version: kamailio 5.2.7 (x86_64/linux)                                                                                                                                                                                          
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled with gcc 5.4.0

I have confirmed the issue with the available later version packages as well.

  • Operating System:

Ubuntu 16.04

@miconda
Copy link
Member

miconda commented Aug 25, 2020

You have syntax errors because of missing ending " (quotes) after the 2nd and the 5th parameters. Should still be a problem, reopen with new log messages -- for me worked to pass over the syntax errors.

@miconda miconda closed this as completed Aug 25, 2020
@dig12345
Copy link
Author

My bad, the example is a mistake. There is still an issue though. I will open new ticket. Thanks

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

2 participants