[ZBX-19912] After upgrading to Zabbix 5.0.15, item "mysql.db.size" is not available. Created: 2021 Sep 03  Updated: 2024 Apr 10  Resolved: 2021 Nov 08

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent2 plugin (G)
Affects Version/s: 5.0.15
Fix Version/s: 5.0.18rc1, 5.4.8rc1, 6.0.0alpha6, 6.0 (plan)

Type: Problem report Priority: Blocker
Reporter: Yasumi Assignee: Eriks Sneiders
Resolution: Fixed Votes: 17
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File zabbix-agent2_yasumi.txt     XML File zbx_export_templates.xml    
Issue Links:
Duplicate
Team: Team INT
Sprint: Sprint 80 (Sep 2021), Sprint 81 (Oct 2021), Sprint 82 (Nov 2021)
Story Points: 1

 Description   

I got the following message in server.log, but I don't know how to deal with it.

========================
item "mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","zabbix"]" became not supported: Invalid parameters: "TLSConnect" cannot be passed as a key parameter.
========================



 Comments   
Comment by Oleg Gawriloff [ 2021 Sep 05 ]

Same for me. Other mysql items works perfectly.

Comment by user-e65a8 (Inactive) [ 2021 Sep 06 ]

Hello, 
 
Thank you for reporting the issue, but we will need some extra details to eliminate the root cause of the problem. 
From which version did you update the zabbix-system and please tell me do you use encryption (PSK or certificate) between the server and the agent?

Comment by Oleg Gawriloff [ 2021 Sep 06 ]

zabbix-proxy/agent/server upgraded from 5.0.14 to 5.0.15.
In 1st case: zabbix server->zabbix proxy using PSK->zabbix agent not using PSK
In 2nd case: zabbix-server->zabbix agent not using PSK

Comment by user-e65a8 (Inactive) [ 2021 Sep 06 ]

Oleg,
 
To reproduce the problem, please send me the template and the configuration of the agent (please delete the sensitive information from the configuration file)

Comment by Yasumi [ 2021 Sep 06 ]

I'm not using PSK or certificate. I upgraded from 5.0.14 to 5.0.15.
zbx_export_templates.xml zabbix-agent2_yasumi.txt

Comment by user-e65a8 (Inactive) [ 2021 Sep 06 ]

 

Thank you for providing the requested information. We will need a bit of time to analyze and reproduce the issue, but will get back to you with an update at the earliest.

Comment by Atsushi Tanaka [ 2021 Sep 08 ]

Even with a clean installation of Zabbix 5.4.4, the same error is output and it cannot be monitored. I am connecting to my local MySQL server using "unix: /var/lib/mysql/mysql.sock".

9208:20210908:230907.972 item "Zabbix server:mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","zabbix"]" became not supported: Invalid parameters: "TLSConnect" cannot be passed as a key parameter.
Comment by Shawn Heisey [ 2021 Sep 08 ]

I am seeing this on 6.0.0 alpha, installed from the zabbix repo on Ubuntu 20.  Both server and agent are running that version.

Comment by Zac Gomez [ 2021 Sep 09 ]

I have the same problem with postgreql, I was checking directly from the agent with "zabbix_get" and apparently the problem is directly from the interaction between agent2 and the endpoint

root@pc:~# zabbix_get -s 127.0.0.1 -p 10050 -k "pgsql.custom.query["tcp://127.0.0.1:5432","user","password","DBname","personalquery"]"
ZBX_NOTSUPPORTED: Invalid parameters: "TLSConnect" cannot be passed as a key parameter.
root@pc:~#

 

I leave all in plain text but with the same result, as the other ones. this is the only item with problems

I am running zabbix 5.4

Comment by Khatsayuk Alexander [ 2021 Sep 10 ]

Zabbix Agent 2 version 5.0.15, the same issue with PostgreSQL.

Comment by Shawn Heisey [ 2021 Sep 14 ]

Nice, resolved.  Any idea how long before 6.0.0alpha3 will be available on the repo?  If this project is anything like Apache Solr, you may have no idea when that will happen.  Solr releases are not planned in advance, they happen when somebody volunteers to be release manager and works their way through the release process.  Is there a link to the commit(s) that fixed this issue?

I tried to pull down the git repo and it fails every time.

root@smeagol:/usr/local/src# git clone https://git.zabbix.com/scm/zbx/zabbix.git
Cloning into 'zabbix'...
remote: Counting objects: 950395, done.
remote: Compressing objects: 100% (205930/205930), done.
fatal: the remote end hung up unexpectedly.00 GiB | 9.08 MiB/s
fatal: early EOF
fatal: index-pack failed

Comment by Shawn Heisey [ 2021 Sep 14 ]

git for windows provided slightly more information, but I do not know enough about git to have any idea what this means:

git.exe clone --progress -v "https://git.zabbix.com/scm/zbx/zabbix.git" "C:\Users\elyograg\git\zabbix"
Cloning into 'C:\Users\elyograg\git\zabbix'...
POST git-upload-pack (gzip 59075 to 29543 bytes)
remote: Counting objects: 950395, done.
remote: Compressing objects: 100% (205930/205930), done.
fatal: early EOF
fatal: The remote end hung up unexpectedly
fatal: index-pack failed
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
git did not exit cleanly (exit code 128) (170907 ms @ 9/14/2021 12:02:36 PM)

Comment by Vadym Kalsin [ 2021 Sep 21 ]

I have the same problem with the following items:

  • mysql.replication.get_slave_status
  • mysql.db.size

Error: "Invalid parameters: "TLSConnect" cannot be passed as a key parameter.".

It started after upgrading zabbix-agent2 to the latest version - 5.4.4.

Downgrading zabbix-agent2 to the 5.4.3 solved this issue.

Comment by Shawn Heisey [ 2021 Sep 22 ]

Version 6.0.0alpha3 dropped on your ubuntu repo.,  This problem still exists with both server and agent2 upgraded to that version.

Using zabbix_get, I can get mysql.version but mysql.db.size and mysql.replication.get_slave_status don't work.  My database is not doing replication, so I wouldn't expect that key to work anyway, but it fails with that TLSConnect problem, which I am thinking happens before it even tries to get slave status.  I have not done an exhaustive check of all the mysql keys, only the three I mentioned.

 

Comment by Shawn Heisey [ 2021 Oct 06 ]

I think this may be relevant for the "git clone" problem:

https://confluence.atlassian.com/bitbucketserverkb/git-clone-fails-fatal-the-remote-end-hung-up-unexpectedly-fatal-early-eof-fatal-index-pack-failed-779171803.html

This ticket probably isn't the right place to discuss that problem.  Where should I bring this up?

Comment by Shawn Heisey [ 2021 Oct 07 ]

Status request.

Does anyone know why the problem is happening?   Is the problem on the agent side or in the config that we all downloaded and added to the server?  Has anyone created a patch that fixes it?

Comment by Vlad [ 2021 Oct 08 ]

Here is a patch request for the issue: https://support.zabbix.com/browse/ZBX-20062
To fix it manually you need to make the following changes in your "Template DB MySQL by agent 2" template:
Replace items' keys':

mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#DATABASE}"]
mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]

with:

mysql.db.size["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","","","","","{#DATABASE}"]
mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","","","","","{#MASTER_HOST}"]

The problem exists since this commit. It changes the keys' parameter list, but only in zabbix-agent2 source code, not in the template.

Comment by Oleg Gawriloff [ 2021 Oct 08 ]

I confirm that Vlad solution is working. Many kudos for this.

Comment by Shawn Heisey [ 2021 Oct 08 ]

I deleted the template, downloaded the template file from the web-based repo browser, applied the patch, and the import fails.

Incorrect value for field "master_itemid": value "mysql.replication.get_slave_status["{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"]" not found.

My server is running 6.0.0alpha4.

Because I do not need the replication status, I undid  the change to that line, and it imported successfully.  I can now get database sizes, which means that for me, the problem is solved.

Anyone wanting to monitor mysql/mariadb replication with this template might still have a problem.  The problem may be confined to the 6.0 alpha version, but I can't tell, as I do not have the older version installed any more.

Comment by cem ispir [ 2021 Oct 21 ]

@Shawn Heisey

Have you replaced all occurences of 
mysql.replication.get_slave_status"{$MYSQL.DSN}","{$MYSQL.USER}","{$MYSQL.PASSWORD}","{#MASTER_HOST}"

Comment by Khatsayuk Alexander [ 2021 Oct 21 ]

Vlad unfortunately the solution brokes compatibility by placing new parameters in the middle of item key. It's really shitty decision.

Comment by Shawn Heisey [ 2021 Oct 21 ]

I didn't even notice that mysql.replication.get_slave_status was in the template file more than once.  After updating all occurrences, the template imports with no problem.

Comment by Eriks Sneiders [ 2021 Nov 01 ]

Fixed in:

Comment by Elbandi [ 2022 Feb 10 ]

It looks like, this is still buggy on 5.4.10:

zabbix_agent2 -t 'pgsql.custom.query["tcp://192.168.200.100:5432","user","pass","database","query","param1"]' pgsql.custom.query["tcp://192.168.200.100:5432","user","pass","database","query","param1"][m|ZBX_NOTSUPPORTED] [Invalid parameters: "TLSConnect" cannot be passed as a key parameter.] 

i think, this is because the "param1" is still identified as tlsconnect session parameter.

Comment by Elbandi [ 2022 Feb 10 ]

i do some debuging, and i find strange. the value isnt added to params variable, if kind is SessionOnly. This is a possible fix:

--- a/src/go/pkg/metric/metric.go
+++ b/src/go/pkg/metric/metric.go
@@ -369,10 +369,6
                                val = p.defaultValue
                        }
                } else {
-                       if p.kind == kindSessionOnly {
-                               return nil, zbxerr.ErrorInvalidParams.Wrap(
-                                       fmt.Errorf("%q cannot be passed as a key parameter", p.name))
-                       }
                        val = &rawParams[i]
                }

@@ -395,6 +391,15
                        }
                }

+               if kind == kindSessionOnly {
+                       if session != nil {
+                               params[p.name] = *val
+                       } else if !m.varParam {
+                               return nil, zbxerr.ErrorInvalidParams.Wrap(
+                                       fmt.Errorf("%q cannot be passed as a key parameter", p.name))
+                       }
+               }
+
                if kind == kindGeneral {
                        params[p.name] = *val
                } 
Comment by Dennis Whitney [ 2022 May 02 ]

Using 5.4.11 and this is still an issue. Why is this ticket still closed?

Comment by Andris Zeila [ 2022 May 03 ]

The problem with custom query parameter parsing was fixed in ZBX-20528.

Generated at Sat Aug 02 09:20:05 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.