[ZBX-24926] Telegram send failed with "Sending failed: Error: cannot set cURL option CURLOPT_INTERFACE: A libcurl function was given a bad argument.." Created: 2024 Jul 28  Updated: 2025 Jan 24  Resolved: 2024 Aug 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 7.0.1
Fix Version/s: 6.0.34rc1, 6.4.19rc1, 7.0.4rc1, 7.2.0alpha1

Type: Problem report Priority: Trivial
Reporter: wins Assignee: Vladislavs Sokurenko
Resolution: Fixed Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Archlinux kernel 6.6.42-1-lts
curl 8.9.0 (x86_64-pc-linux-gnu) libcurl/8.9.0 OpenSSL/3.3.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.6 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.0 nghttp2/1.62.1 nghttp3/1.4.0
zabbix 7.0.1 postgresql + timescaledb 2.15 fresh install


Attachments: JPEG File Screenshot 2024-07-28 124237.jpg     PNG File screenshot-1.png    
Issue Links:
Duplicate
duplicates ZBX-25058 Lastest ZABBIX PROXY 7.0.2 Error with... Closed
is duplicated by ZBX-24935 Curl v8.9 unsupported on server and p... Closed
is duplicated by ZBX-23702 Failed writing received data to disk/... Confirmed
Team: Team A
Sprint: S24-W34/35
Story Points: 0.25

 Description   

Steps to reproduce:

  1. Make clean install Zabbix 7.0.1 (postgresql timescaledb 2.15)
  2. Go to Media types
  3. Provide token, try "test media"
  4. Got error Telegram send failed with "Sending failed: Error: cannot set cURL option CURLOPT_INTERFACE: A libcurl function was given a bad argument.."

Result:
See screenshot



 Comments   
Comment by wins [ 2024 Jul 28 ]

downgrading package curl (8.9.0-1 => 8.8.0-1) solves problem

Comment by Alexey Pustovalov [ 2024 Jul 29 ]

do you use SouceIP for checks?

Comment by wins [ 2024 Jul 29 ]

I made a fresh installation of zabbix, I didn't configure any checks (except default for the zabbix server via zabbix agent).

Comment by Philipp Buehler [ 2024 Jul 30 ]

Same error with the 6.4.17-alpine-pgsql dockerimage (media Mattermost). Downgrade to 6.4.16 fixes this regression.

Comment by Vladislavs Sokurenko [ 2024 Jul 31 ]

Fixed in pull request feature/ZBX-24926-7.0

Comment by Mike [ 2024 Jul 31 ]

Will this issue be addressed in 6.4? (6.4.17 is definitely affected)

Comment by Curt Sahd [ 2024 Aug 01 ]

Kindly advise how to resolve? Apologies, I'm a new here, so not to sure of the procedure. I downgraded to zabbix/zabbix-web-nginx-mysql:alpine-6.4-latest but then i see the following error: Database error

  • The Zabbix database version does not match current requirements. Your database version: 7000000. Required version: 6040000. Please contact your system administrator.
Comment by Aleksejus Velutis [ 2024 Aug 02 ]

Hello Team! It seems like v7.0.2 is affected too. My case:
I was auto updated zbx containers to 7.0.2 by "watchtowerrr" by :latest docker tag and notifications to telegram stop working, then i rollback to 7.0.1 by specifying tag on compose.yaml to 7.0.1-alpine and notifications start works as expected.

Comment by Pomazan Bohdan [ 2024 Aug 02 ]

Return to zabbix-server-pgsql:7.0.1-alpine and zabbix-web-nginx-pgsql:7.0.1-alpine from 7.0-alpine-latest

Comment by Vladislavs Sokurenko [ 2024 Aug 02 ]

Issue occurs when SourceIP is not set and latest version of curl is used, as a workaround SourceIP can be set, this will be fixed in next release.

Comment by Mike [ 2024 Aug 02 ]

Will that be fixed for 6.4.* as well? (we are not there yet to switch to v7 and are forced to update libraries by company policies)

Setting source IP is not always an option - multiple IPs/IFs are there for a reason and can not always be routed equally. (does Zabbix support if!* syntax of libcurl in setting source ip? or it breaks other socket binding functionality in zabbix?)

When can the next release be expected?

 

P.S. Actually setting up SourceIP=0.0.0.0 in appropriate server/proxy configs saves the day (however it will depend on kernel/libc version and implementation of bind())

Comment by Aleksejus Velutis [ 2024 Aug 02 ]

Adding this env value (ZBX_SOURCEIP=) does not give a result, even though it is present in the variable environments:

zbxsrv:~# env | grep "ZBX_SOURCEIP"
ZBX_SOURCEIP=0.0.0.0
zbxsrv:~# 

failed message the same:

Sending failed: Error: cannot set cURL option CURLOPT_INTERFACE: A libcurl function was given a bad argument..

Rolled back to 7.0.1 again. Will wait for 7.0.3.

Also spotted a strange behavior when upgrading to 7.0.2 from 7.0.1 - parameter (Required server performance, new values per second) in system info increased from:

Required server performance, new values per second  8.48

to:

Required server performance, new values per second	26.71

when rolled back to 7.0.1 its back to first values:

Required server performance, new values per second  8.48

increased more than three times, Is this expected behavior?

Comment by Mike [ 2024 Aug 02 ]

If you are running Zabbix in a container - you have to add env variables to container launch (so that docker-entrypoint.sh can pick it up and update zabbix_server.conf). Otherwise you have to set it in the file explicitly abd restart daemon (cat /etc/zabbix/zabbix_server.conf | grep SourceIP to make sure )

Comment by Aleksejus Velutis [ 2024 Aug 02 ]

This variable is specified, but for some reason it is not included in zabbix_server.conf unlike the others, strange.

cat zbx.yml | grep "ZBX_SOURCEIP"
     - ZBX_SOURCEIP=0.0.0.0
cat zabbix_server.conf | grep SourceIP
### Option: SourceIP
# SourceIP=

for example:

cat zbx.yml | grep "DB_SERVER_HOST"
     - DB_SERVER_HOST=pgsrv
cat zabbix_server.conf | grep pgsrv
DBHost=pgsrv

Why? And the performance question is more interesting

Comment by Vladislavs Sokurenko [ 2024 Aug 02 ]

Increased NVPS metric is expected, please see ZBX-24524

Comment by Aleksejus Velutis [ 2024 Aug 02 ]

If I understand correctly, it turns out that now the counting is correct while the load has not increased.
Got it! Thank you vso!
 

Comment by Vladislavs Sokurenko [ 2024 Aug 08 ]

Fixed in:

Comment by Anton [ 2024 Aug 19 ]

Hi, i understand that changing curl  package version helps in this case.
My question. My official zabbix proxy docker image is unable to cURL my k8s nodes. Im using image with tag: Alpine-7.0.2
In here: https://hub.docker.com/layers/zabbix/zabbix-proxy-sqlite3/7.0-alpine-latest/images/sha256-5ccb5e77089d6be7d27ef3148036310fed61c67da71c4e9cb75a7986faa9d3bf?context=explore
on row 12, i see this (amongst other packages beeing installed) :
libcurl
 Do i understand correctly that i should rebuild this same image and specify the version there ?
Or is the official image latest version already using this workaround ?
Im not quite sure im solving the issue at the correct spot...

Preprocessing failed for: {"error":"Error: cannot set cURL option CURLOPT_INTERFACE: A libcurl function was given a bad arg...
1. Failed: cannot extract value from json by path "$.Pods[?(@.name == "<POD_NAME_REMOVED>")].first()": no data matches the specified path 

using zabbix helm chart. 
Thanks

Generated at Sat May 10 08:43:01 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.