crowdsecurity/cs-haproxy-bouncer

CRowdsec haproxy has error that prevents it from pulling decisions

Closed this issue · 7 comments

What happened?

Error after setup:

error: /usr/lib/crowdsec/lua/haproxy/crowdsec.lua:199: attempt to call a nil value (field 'httpclient') from /usr/lib/crowdsec/lua/haproxy/crowdsec.lua:199: in upvalue 'refresh_decisions', /usr/lib/crowdsec/lua/haproxy/crowdsec.lua:271: in function line 260.

[30/Jun/2024:20:28:04.631] -/- 2/0/0/15/15 200 153 - - ---- 6/0/0/0/0 0/0 {} "GET http://10.100.20.25:8080/v1/decisions/stream?startup=false HTTP/1.1"
Jun 30 20:28:04 tltsysproxy haproxy[6149]: Decisions fetched: startup=false

What did you expect to happen?

For ban decisions to load

How can we reproduce it (as minimally and precisely as possible)?

setup the crowdsec haproxy bouncer

Anything else we need to know?

No response

Crowdsec version

$ cscli version
# paste output here

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Enabled collections and parsers

$ cscli hub list -o raw
# paste output here

Acquisition config

No response

Config show

$ cscli config show
# paste output here

Prometheus metrics

$ cscli metrics
# paste output here

Related custom configs versions (if applicable) : notification plugins, custom scenarios, parsers etc.

@geek2gether: Thanks for opening an issue, it is currently awaiting triage.

In the meantime, you can:

  1. Check Crowdsec Documentation to see if your issue can be self resolved.
  2. You can also join our Discord.
  3. Check Releases to make sure your agent is on the latest version.
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

Thank you for your report, to ensure this get handled on the appropriate repository I will transfer to the HAProxy repo

Not sure if this issue has been resolved. But I'm getting a similar error in my haproxy setup:
Lua task: [state-id 0] runtime error: /usr/lib/crowdsec/lua/haproxy/crowdsec.lua:199: attempt to call a nil value (field 'httpclient') from /usr/lib/crowdsec/lua/haproxy/crowdsec.lua:199: in upvalue 'refresh_decisions', /usr/lib/crowdsec/lua/haproxy/crowdsec.lua:271: in function line 260.

Could you post your haproxy versions?

Haproxy version: 2.4.24 on Ubuntu 22.04

2.4.24 on Ubuntu 22.04

This remediation only support version 2.5 and upwards https://docs.crowdsec.net/u/bouncers/haproxy

Classing issue as stale, please reopen when you have more information and confirmed you are a supported version