Ad Widget

Collapse

Bug in frontend 1.1alpha12

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elkor
    Senior Member
    • Jul 2005
    • 299

    #1

    Bug in frontend 1.1alpha12

    Update media functionality has syntax error in SQL (looks like a missing space and backquotes instead of single pops).

    version still reads 1.1alpha11.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Originally posted by elkor
    Update media functionality has syntax error in SQL (looks like a missing space and backquotes instead of single pops).

    version still reads 1.1alpha11.
    Please, give me the actual error message. Thanks.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • elkor
      Senior Member
      • Jul 2005
      • 299

      #3
      text in black appears in grey area beneath the menubar, text in blue appears in the white area below that is bordered by the dashed line.

      exact message encountered while updating media for a user:

      Code:
      [ERROR:Cannot update media]
      [COLOR=Blue]SQL error: Unknown column '1-7,00:00-23:59' in 'field list'
      Query: update media set userid=6, mediatypeid=1, sendto='[email protected]', active=0,severity=62,period=`1-7,00:00-23:59` where mediaid=7[/COLOR]
      Here is another (this one encountered while adding acitons to a trigger with scope="all triggers of this host":

      Code:
      Error in query [select triggerid,expression,description,status,priority,lastchange,dep_level,comments,url,value from triggers where triggerid=] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]Error in query [select distinct h.hostid from hosts h,functions f, items i where i.itemid=f.itemid and h.hostid=i.hostid and f.triggerid=] [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
      
      [Action added]
      [COLOR=Blue]No action with actionid=[1]
      No trigger with triggerid=[][/COLOR]
      This may just be cosmetic as the action appears to have been added, I haven't been able to set it off though even though the trigger has been tripped to true, so there may be a problem there or it could just be my config, I'm investigating and will update when I find out what's going on.

      Comment

      • James Wells
        Senior Member
        • Jun 2005
        • 664

        #4
        Originally posted by elkor
        Code:
        [ERROR:Cannot update media]
        [COLOR=Blue]SQL error: Unknown column '1-7,00:00-23:59' in 'field list'
        Query: update media set userid=6, mediatypeid=1, sendto='[email protected]', active=0,severity=62,period=`1-7,00:00-23:59` where mediaid=7[/COLOR]
        This is a typo on line 2010, in php/include/config.inc.php. Yes, the typo is the back ticks (`) actually need to be replaced with single quotes (').
        Unofficial Zabbix Developer

        Comment

        • James Wells
          Senior Member
          • Jun 2005
          • 664

          #5
          Here is a patch to fix the media update issue;
          Code:
          Index: config.inc.php
          ===================================================================
          RCS file: /cvsroot/zabbix/zabbix/frontends/php/include/config.inc.php,v
          retrieving revision 1.261
          diff -r1.261 config.inc.php
          2010c2010
          <               $sql="update media set userid=$userid, mediatypeid=$mediatypeid, sendto='$sendto', active=$active,severity=$s,period=`$period` where mediaid=$mediaid";
          ---
          >               $sql="update media set userid=$userid, mediatypeid=$mediatypeid, sendto='$sendto', active=$active,severity=$s,period='$period' where mediaid=$mediaid";
          Unofficial Zabbix Developer

          Comment

          • elkor
            Senior Member
            • Jul 2005
            • 299

            #6
            Yeah, was on line 1998 in my file but that may be the difference between the cvs version and mine. Here's another:
            Code:
            [ERROR:Cannot update trigger]
            
            SQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's volume /prn',priority=4,status=0,comments='',url='',value=2 where triggerid=12' at line 1
            Query: update triggers set expression='{11670}<10000',description='Low free disk space on {HOSTNAME}'s volume /prn',priority=4,status=0,comments='',url='',value=2 where triggerid=12543
            this one appears to be a non-escaped single pop {HOSTNAME}'s. It occurs when updating a trigger.

            EDIT: OK, didn't realize that the description was supplied in the form, easy enough to escape it and continue on adding hosts. There should either be a sanity check on this data or the single pop should not be in the default description though in order to cut down on newbie error reports (such as mine ). At the very least a mention in the manual (which may be there, I haven't checked. But based on the last time I flipped through it I doubt it is.)
            Last edited by elkor; 31-08-2005, 20:28.

            Comment

            Working...