cs-haproxy-bouncer icon indicating copy to clipboard operation
cs-haproxy-bouncer copied to clipboard

CRowdsec haproxy has error that prevents it from pulling decisions

Open geek2gether opened this issue 1 year ago • 6 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] <HTTPCLIENT> -/- 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 avatar Jun 30 '24 23:06 geek2gether

@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.

github-actions[bot] avatar Jun 30 '24 23:06 github-actions[bot]

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

LaurenceJJones avatar Jul 01 '24 07:07 LaurenceJJones

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.

BCreativeS avatar Jul 17 '24 21:07 BCreativeS

Could you post your haproxy versions?

LaurenceJJones avatar Jul 18 '24 07:07 LaurenceJJones

Haproxy version: 2.4.24 on Ubuntu 22.04

BCreativeS avatar Jul 24 '24 23:07 BCreativeS

2.4.24 on Ubuntu 22.04

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

LaurenceJJones avatar Jul 25 '24 10:07 LaurenceJJones

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

LaurenceJJones avatar Aug 28 '24 13:08 LaurenceJJones