Skip to content

[nil] utils.item_to_string #128

@LaurenceJJones

Description

@LaurenceJJones

function above can return nil if the value is not an ip address this causes a nil concatenation in some cases.

2025/10/02 20:47:47 [info] 68873#68873: *1 [lua] crowdsec_nginx.conf:28):5: Initializing stream mode for worker 0, context: init_worker_by_lua*
2025/10/02 20:47:47 [info] 68873#68873: *1 [lua] crowdsec_nginx.conf:28):10: Initializing metrics for worker 0, context: init_worker_by_lua*
2025/10/02 20:47:47 [info] 68876#68876: *2 [lua] crowdsec_nginx.conf:28):5: Initializing stream mode for worker 3, context: init_worker_by_lua*
2025/10/02 20:47:47 [info] 68874#68874: *3 [lua] crowdsec_nginx.conf:28):5: Initializing stream mode for worker 1, context: init_worker_by_lua*
2025/10/02 20:47:47 [info] 68875#68875: *4 [lua] crowdsec_nginx.conf:28):5: Initializing stream mode for worker 2, context: init_worker_by_lua*
2025/10/02 20:47:53 [error] 68873#68873: *20 lua entry thread aborted: runtime error: /usr/lib/crowdsec/lua/plugins/crowdsec/stream.lua:221: attempt to concatenate local 'ip_type' (a nil value)
stack traceback:
coroutine 0:
        /usr/lib/crowdsec/lua/plugins/crowdsec/stream.lua: in function 'stream_query'
        /usr/lib/crowdsec/lua/crowdsec.lua:332: in function </usr/lib/crowdsec/lua/crowdsec.lua:314>, context: ngx.timer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions