[ZBX-4857] pollers hang when processing SSH checks if "public key" field is empty Created: 2012 Apr 10 Updated: 2017 May 30 Resolved: 2012 May 02 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F), Server (S) |
Affects Version/s: | None |
Fix Version/s: | 1.8.13rc1, 2.0.0rc4 |
Type: | Incident report | Priority: | Blocker |
Reporter: | Oleksii Zagorskyi | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | ssh | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() |
Description |
First of all - I'm almost sure it's a new libssh2's bug (which will be reported to libssh2 devs). But it observed because of not very good behavior of the zabbix frontend and zabbix server. Zabbix frontend allows to create an "SSH agent" item with empty values of: User name, Public key file, Private key file. That was frontend related part. Next is server's part. I know that to connect to a remote server by ssh client (not the libssh2 library) I need just a private key. (Note: public key actually is stored in the private one and can be extracted, And when server starting process this ssh item - a poller hangs ! and consumes 100% of cpu/core.
I'm attaching two outputs of "ltrace -tt -n2 -s 80 -T -S -p <PID>" ltrace_12507_empty_pub_key_ssh2-141ssl.out - with the empty *public* key in zabbix configuration Actually it's bad zabbix_server behavior as well, but if frontend will be fixed as described above - it will be suitable solution, IMO ltrace_12741_empty_priv_key_ssh2-141ssl.out - with the empty *private* key in zabbix configuration I used latest release 1.4.1 of libssh2 (from April 4, 2012) compiled from sources. I suppose the problem in a libssh2's function "file_read_publickey" while (!feof(fd) && (c = fgetc(fd)) != '\r' && c != '\n') That's all for now, later I'll add some comments bellow. |
Comments |
Comment by Oleksii Zagorskyi [ 2012 Apr 11 ] |
Posted to libssh2 developers here: <zalex> that bug has been fixed here: I suppose libssh2 version 1.4.2 will be without this bug. |
Comment by dimir [ 2012 Apr 18 ] |
Confirmed, libssh hangs if pubkey is a directory. Reproducible with libssh 1.3.0 too. |
Comment by dimir [ 2012 Apr 18 ] |
Fix for 1.8 is available in development branch: svn://svn.zabbix.com/branches/dev/ZBX-4857 . Until bug in libssh2 is fixed we do a regular file check before doing a libssh2 call. Symbolic links as key files are supported. Added more error information when libssh2 call fails. |
Comment by dimir [ 2012 Apr 18 ] |
There will be a separate branch for 2.0 . |
Comment by dimir [ 2012 Apr 26 ] |
Fix "Fix Version/s" |
Comment by dimir [ 2012 Apr 26 ] |
(1) For 2.0 we decided to fix "ssh check" item form to not allow empty key files and username in case of public key authentication method. <zalex> I do not see it implemented here <dimir> We will fix it in a separate branch. <zalex> Thanks, but would be great to know that separate branch/issue <sasha> GUI will be fixed in a new development branch svn://svn.zabbix.com/branches/dev/ZBX-4857 |
Comment by Alexander Vladishev [ 2012 Apr 27 ] |
Tested! Please review my changes in r27165. |
Comment by dimir [ 2012 Apr 28 ] |
Fixed in pre-1.8.13 r27192, pre-2.0.0 r27194. |
Comment by Alexander Vladishev [ 2012 May 02 ] |
Validation of username, private and public key has been added in the development branch svn://svn.zabbix.com/branches/dev/ZBX-4857 r27211. <zalex> successfully TESTED. |
Comment by Eduards Samersovs (Inactive) [ 2012 May 07 ] |
Frontend tested. |
Comment by dimir [ 2012 May 07 ] |
Fixed in pre-2.0.0 r27307. |
Comment by Sandis Neilands (Inactive) [ 2015 Jul 14 ] |
The correction for this issue has introduced a minor memory leak. See |