[Rspamd-Users] Ok another one...
Michelle Sullivan
michelle at isux.com
Sun Sep 14 12:39:52 UTC 2025
Ok answering my own question for the record.
> On 14 Sep 2025, at 09:08, Michelle Sullivan <michelle at isux.com> wrote:
>
>
>
>> On 14 Sep 2025, at 07:44, Michelle Sullivan <michelle at isux.com> wrote:
>>
>>
>>
>>> On 14 Sep 2025, at 01:29, Vsevolod Stakhov <vsevolod at rspamd.com> wrote:
>>>
>>> On 13/09/2025 15:30, Michelle Sullivan wrote:
>>>> PD_FROM_CHECK is my module.. but there is also the issue with the bayes module so I am leaning it’s a config issue…
>>>
>>> Yes, you can fuck up all other modules in your own module easily - that's how Lua stack works. But please don't blame those modules - it's not their fault.
>>
>>
>> Wasn’t trying to blame the other modules… was thinking it was me screwing up the Redis config somehow… and sure enough disabling my module and the bayes error goes away.. That’s a tad troubling for me… seems fragile.
>>
>
>
> FWIW latest round of errors is:
>
> Sep 14 09:01:11 thunderhawk rspamd[57571]: <cm83dz>; lua; pd_from_check.lua:63: pd_from_check setting key: rs_frmchk-a4uyknxd81yp185mm5j9
> Sep 14 09:01:11 thunderhawk rspamd[57571]: <cm83dz>; lua; pd_from_check.lua:74: pd_from_check redis_params: {[hash] = w7i56pp8ok4fg3dwniwwsn87dcnqdm7esmmdj1pmde41ta5ssho4cgyy57sf18as949qgd1hmsfam3xj7a65hrckotidosjnm6pjyqb, [expand_keys] = false, [write_servers] = rspamd{upstream_list}(00000008B5B3F138), [read_only] = false, [read_servers_str] = 192.168.250.2, [db] = 0, [timeout] = 1, [write_servers_str] = 192.168.250.2, [read_servers] = rspamd{upstream_list}(00000008B5B08748)}
> Sep 14 09:01:11 thunderhawk rspamd[57571]: <c954d9>; csession; lua_metric_symbol_callback: call to (PD_FROM_CHECK) failed (2): /usr/local/share/rspamd/lualib/lua_redis.lua:973: bad argument #1 to 'get_upstream_by_hash' (string expected, got table); trace: [1]:{[C]:-1 - get_upstream_by_hash [C]}; [2]:{/usr/local/share/rspamd/lualib/lua_redis.lua:973 - redis_make_request [Lua]}; [3]:{/etc/rspamd/lua.local.d/pd_from_check.lua:75 - pd_check_redis [Lua]}; [4]:{/etc/rspamd/lua.local.d/pd_from_check.lua:123 - <unknown> [Lua]};
>
>
> rspamd_logger.warnx(rspamd_config, '%s redis_params: %s', N, redis_params)
> ret = lua_redis.redis_make_request(task,
> redis_params, -- connect params
> {redis_key},
> true, -- is write
The issue is the {redis_key} which I lifted from internal code and it’s wrong (possibly version changes, but haven’t looked)..
The error was deceptive, ‘Programming Lua’ suggest arguments start from #1 not #0 like other languages, likewise the error reports bad argument #1 to ‘get_upstream_by_hash’ which suggests that the argument in question is ‘redis_params’ especially after initially defining it incorrectly and getting a ’nil’ error instead).. The actual issue you’ll only get by reading (and understanding) the actual code, which I didn’t do like some sort of newbie moron. ChatGTP (Code Pilot) eventually pointed out the error, Grok is completely oblivious and hallucinations are rife.
Therefore for readers and subsequent newbs.. correct code is:
> ret = lua_redis.redis_make_request(task,
> redis_params, -- connect params
> redis_key,
> true, -- is write
Sorry for wasting peoples’ time.
Regards,
Michelle
More information about the Users
mailing list