Panic: lib-sql: Too many bind args
From /etc/dovecot/dovecot.conf:
mail_attribute_dict = proxy::attr
dict { attr = pgsql:/etc/dovecot/dovecot-attr-sql.conf.ext }
From /etc/dovecot/dovecot-attr-sql.conf.ext:
map { pattern = $key table = attributes fields { attr_name = $key } username_field = username value_field = attr_value }
From /var/log/maillog:
dovecot[51153]: dict(51395): Panic: lib-sql: Too many bind args (2) for statement: SELECT attr_name FROM attributes WHERE attr_name LIKE AND username = ? dovecot[51153]: dict(51395): Error: Raw backtrace: /usr/lib64/dovecot/libdovecot.so.0(+0xf8cab) [0x7f4c92274cab] -> /usr/lib64/dovecot/libdovecot.so.0(+0xf8d47) [0x7f4c92274d47] -> /usr/lib64/dovecot/libdovecot.so.0(+0x55c1d) [0x7f4c921d1c1d] -> dovecot/dict(+0x649a) [0x55921892349a] -> dovecot/dict(sql_statement_query+0x3e) [0x55921892a14e] -> dovecot/dict(+0xa296) [0x559218927296] -> /usr/lib64/dovecot/libdovecot.so.0(dict_iterate+0x23) [0x7f4c92238a23] -> dovecot/dict(+0x7860) [0x559218924860] -> dovecot/dict(+0x808c) [0x55921892508c] -> dovecot/dict(+0x8200) [0x559218925200] -> dovecot/dict(dict_command_input+0xee) [0x55921892534e] -> dovecot/dict(+0x6b9b) [0x559218923b9b] -> /usr/lib64/dovecot/libdovecot.so.0(connection_input_default+0x1b2) [0x7f4c9226fd42] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x73) [0x7f4c9228c413] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0x135) [0x7f4c9228dac5] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x50) [0x7f4c9228c4c0] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_run+0x48) [0x7f4c9228c628] -> /usr/lib64/dovecot/libdovecot.so.0(master_service_run+0x17) [0x7f4c92203fd7] -> dovecot/dict(main+0x185) [0x559218923895] -> /lib64/libc.so.6(__libc_start_main+0xf3) [0x7f4c91dda493] -> dovecot/dict(_start+0x2e) [0x5592189238ee]
Joseph D Wagner
On 08-11-2021 5:39 pm, Joseph D Wagner wrote: dovecot[51153]: dict(51395): Panic: lib-sql: Too many bind args (2) for statement: SELECT attr_name FROM attributes WHERE attr_name LIKE AND username = ?
No idea if this is the only problem, but the sql query has invalid syntax.
SELECT attr_name FROM attributes WHERE attr_name LIKE AND username
= ?
Did you replace the "?" or is that the real query? That is invalid. And there is nothing after "LIKE", should at minimum have 'quotes'.
SELECT attr_name FROM attributes WHERE attr_name LIKE 'something%'
AND username = '?'
Would be at least syntax valid.
On 8/11/21 2:48 PM, dovecot@ptld.com wrote:
On 08-11-2021 5:39 pm, Joseph D Wagner wrote: dovecot[51153]: dict(51395): Panic: lib-sql: Too many bind args (2) for statement: SELECT attr_name FROM attributes WHERE attr_name LIKE AND username = ?
No idea if this is the only problem, but the sql query has invalid syntax.
SELECT attr_name FROM attributes WHERE attr_name LIKE AND username = ?
Did you replace the "?" or is that the real query? That is invalid. And there is nothing after "LIKE", should at minimum have 'quotes'.
SELECT attr_name FROM attributes WHERE attr_name LIKE 'something%' AND username = '?'
Would be at least syntax valid.
Dovecot generated the syntax.
Maybe there's something wrong with my "map" configuration, which led to the improper syntax (see original email), but it's Dovecot that generated the syntax.
Joseph D. Wagner
Maybe there's something wrong with my "map" configuration, which led to the improper syntax (see original email), but it's Dovecot that generated the syntax.
I have not used dictionaries and do not have first hand working knowledge. Until someone else more knowledgeable chimes in, this is my educated guess...
On the Dictionary manual page (https://wiki.dovecot.org/Dictionary) it talks about using fields{}, or not, having different requirements and syntax. It looks like you are mixing the two which might be leading to the issue.
If you are using fields{} it looks like you shouldn't have username_field defined. It also says that value_field should be "dummy" which i don't understand how that works. The fields{} is for using multiple primary key columns. If you are using only one column (attr_name) then maybe you should try doing the non fields{} example.
If you have not looked at this manual page before it might give you more hints on trouble shooting.
participants (2)
-
dovecot@ptld.com
-
Joseph D Wagner