Ad Widget

Collapse

Problem starting server: Query failed:Unknown column 'nextcheck' in 'field list'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carnivoris
    Junior Member
    • May 2010
    • 4

    #1

    Problem starting server: Query failed:Unknown column 'nextcheck' in 'field list'

    I just compiled Zabbix 1.8 from source on a Debian box and I can't get the service to start from the init script. I get a bunch of SQL errors in /var/log/zabbix-server/zabbix-server.log. All of them mention the same unknown column. I've followed the install instructions and have added the schema to my DB (MySQL). What am I missing? Here is an excerpt of the log.

    Code:
    16767:20100517:104825 Query::select count(*),min(nextcheck) from items i,hosts h where h.status=0 and h.disable_until<1274111305 and h.errors_from=0 and h.hostid=i.hostid and i.status in (0,3) and i.type not in (2,7,9) and mod(i.itemid,5)=1 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)
     16767:20100517:104825 Query failed:Unknown column 'nextcheck' in 'field list' [1054]
     16768:20100517:104825 Query::select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.errors_from,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status,i.trapper_hosts,i.logtimefmt,i.valuemapid,i.delay_flex,h.dns from hosts h, items i where i.nextcheck<=1274111305 and i.status in (0,3) and i.type not in (2,7,9) and h.status=0 and h.disable_until<=1274111305 and h.errors_from=0 and h.hostid=i.hostid and mod(i.itemid,5)=2 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and  h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)  order by i.nextcheck
     16768:20100517:104825 Query failed:Unknown column 'i.nextcheck' in 'field list' [1054]
     16768:20100517:104825 Query::select count(*),min(nextcheck) from items i,hosts h where h.status=0 and h.disable_until<1274111305 and h.errors_from=0 and h.hostid=i.hostid and i.status in (0,3) and i.type not in (2,7,9) and mod(i.itemid,5)=2 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)
     16768:20100517:104825 Query failed:Unknown column 'nextcheck' in 'field list' [1054]
     16766:20100517:104825 Query::select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.errors_from,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status,i.trapper_hosts,i.logtimefmt,i.valuemapid,i.delay_flex,h.dns from hosts h, items i where i.nextcheck<=1274111305 and i.status in (0,3) and i.type not in (2,7,9) and h.status=0 and h.disable_until<=1274111305 and h.errors_from=0 and h.hostid=i.hostid and mod(i.itemid,5)=0 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and  h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)  order by i.nextcheck
     16766:20100517:104825 Query failed:Unknown column 'i.nextcheck' in 'field list' [1054]
     16766:20100517:104825 Query::select count(*),min(nextcheck) from items i,hosts h where h.status=0 and h.disable_until<1274111305 and h.errors_from=0 and h.hostid=i.hostid and i.status in (0,3) and i.type not in (2,7,9) and mod(i.itemid,5)=0 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)
     16766:20100517:104825 Query failed:Unknown column 'nextcheck' in 'field list' [1054]
     16769:20100517:104825 Query::select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.errors_from,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status,i.trapper_hosts,i.logtimefmt,i.valuemapid,i.delay_flex,h.dns from hosts h, items i where i.nextcheck<=1274111305 and i.status in (0,3) and i.type not in (2,7,9) and h.status=0 and h.disable_until<=1274111305 and h.errors_from=0 and h.hostid=i.hostid and mod(i.itemid,5)=3 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and  h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)  order by i.nextcheck
     16769:20100517:104825 Query failed:Unknown column 'i.nextcheck' in 'field list' [1054]
     16769:20100517:104825 Query::select count(*),min(nextcheck) from items i,hosts h where h.status=0 and h.disable_until<1274111305 and h.errors_from=0 and h.hostid=i.hostid and i.status in (0,3) and i.type not in (2,7,9) and mod(i.itemid,5)=3 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)
     16769:20100517:104825 Query failed:Unknown column 'nextcheck' in 'field list' [1054]
     16770:20100517:104825 Query::select i.itemid,i.key_,h.host,h.port,i.delay,i.description,i.nextcheck,i.type,i.snmp_community,i.snmp_oid,h.useip,h.ip,i.history,i.lastvalue,i.prevvalue,i.hostid,h.status,i.value_type,h.errors_from,i.snmp_port,i.delta,i.prevorgvalue,i.lastclock,i.units,i.multiplier,i.snmpv3_securityname,i.snmpv3_securitylevel,i.snmpv3_authpassphrase,i.snmpv3_privpassphrase,i.formula,h.available,i.status,i.trapper_hosts,i.logtimefmt,i.valuemapid,i.delay_flex,h.dns from hosts h, items i where i.nextcheck<=1274111305 and i.status in (0,3) and i.type not in (2,7,9) and h.status=0 and h.disable_until<=1274111305 and h.errors_from=0 and h.hostid=i.hostid and mod(i.itemid,5)=4 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and  h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)  order by i.nextcheck
     16770:20100517:104825 Query failed:Unknown column 'i.nextcheck' in 'field list' [1054]
     16770:20100517:104825 Query::select count(*),min(nextcheck) from items i,hosts h where h.status=0 and h.disable_until<1274111305 and h.errors_from=0 and h.hostid=i.hostid and i.status in (0,3) and i.type not in (2,7,9) and mod(i.itemid,5)=4 and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)
     16770:20100517:104825 Query failed:Unknown column 'nextcheck' in 'field list' [1054]
     16782:20100517:104825 Query::select h.hostid,min(i.itemid) from hosts h,items i where mod(h.hostid,1)=0 and i.nextcheck<=1274111305 and i.status in (0) and i.type not in (2,7,9) and h.status=0 and h.disable_until<=1274111305 and h.errors_from!=0 and h.hostid=i.hostid and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and  h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999)  group by h.hostid
     16782:20100517:104825 Query failed:Unknown column 'i.nextcheck' in 'where clause' [1054]
     16782:20100517:104825 Query::select count(*),min(nextcheck) as nextcheck from items i,hosts h where mod(h.hostid,1)=0 and i.nextcheck<=1274111305 and i.status in (0) and i.type not in (2,7,9) and h.status=0 and h.disable_until<=1274111305 and h.errors_from!=0 and h.hostid=i.hostid and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') and  h.hostid>=100000000000000*0 and h.hostid<=(100000000000000*0+99999999999999) order by nextcheck
     16782:20100517:104825 Query failed:Unknown column 'nextcheck' in 'field list' [1054]
  • sYB-tyumen
    Junior Member
    • May 2010
    • 4

    #2
    The same error

    Got the same error migrating from 1.6.6 to 1.8.2

    While database patching it shows no errors. Server daemon complied and installed with no errors too.
    But only web checks working and "Query failed:Unknown column 'nextcheck'" in Zabbix log.

    System: Ubuntu 10.04 LTS
    Mysql: 5.1.37-1ubuntu5.1

    Comment

    • Carnivoris
      Junior Member
      • May 2010
      • 4

      #3
      I went digging around this morning. The query that's generating this error is looking for the nextcheck column in the items table and that column does not exist. That's fairly perplexing since this should be happening with anyone who installs 1.8 from source.

      Comment

      • Palmertree
        Senior Member
        • Sep 2005
        • 746

        #4
        Zabbix 1.8 installs the binaries into /usr/local/sbin and i believe 1.6 is different. Make sure you are not running the older version of zabbix_server still. Try "zabbix_server -V" to see which version is actually running or do a "find / -name zabbix_server" to see if you have two copies.

        Comment

        • Carnivoris
          Junior Member
          • May 2010
          • 4

          #5
          I know that's not the case for me, here's the proof.

          # zabbix_server -V
          Zabbix Server v1.8.2 (revision 11211) (29 March 2010)
          Compilation time: May 19 2010 08:01:55

          # which zabbix_server
          /usr/local/sbin/zabbix_server

          The error refers to a database object that doesn't exist. I wonder if anyone else has installed from src and been successful. From what I'm looking at, no one that installs from 1.8.2 source would be able to start the server.

          Comment

          • Carnivoris
            Junior Member
            • May 2010
            • 4

            #6
            bump

            bump. anyone else? any ideas?

            Comment

            • richlv
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Oct 2005
              • 3112

              #7
              if it looks for nextcheck, it's 1.6.
              try
              Code:
              whereis zabbix_server
              if that finds multiple files, there's your problem. if not, try
              Code:
              find / -type f -name zabbix_server
              that should find multiple files.
              Zabbix 3.0 Network Monitoring book

              Comment

              • tighep
                Senior Member
                • Dec 2007
                • 124

                #8
                It is definitely still there, I just updated a 1.6.4 server to 1.8.2 from source, and it's got that issue. I altered the table to put nextcheck BACK into the database, from the 1.6 patch.sql and it starts now. Is this an issue in the patch.sql script?

                Comment

                • richlv
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Oct 2005
                  • 3112

                  #9
                  stop starting 1.6 server, remove it from your system and start 1.8 server.
                  and remove that database field.
                  Zabbix 3.0 Network Monitoring book

                  Comment

                  • tighep
                    Senior Member
                    • Dec 2007
                    • 124

                    #10
                    Now where's the fun in that. I swear I kept starting Zabbix 1.8.2, and I was.. on my dev box, and then looking at logs from the production box where I forgot to swap out binaries.

                    Now I feel like a dolt.

                    Comment

                    • eDonkey
                      Junior Member
                      • Jun 2022
                      • 4

                      #11
                      I'm encountering a similar problem just with the column 'd.templateid'. I installed Zabbix 6.0 from scratch (on a new Ubuntu 20.04 machine) and imported hosts, maps and templates.
                      This went smoothly and without any problems.

                      I've now opened the Zabbix frontend and when I go to "Monitoring > Dashboard" I encounter the following two errors:

                      Code:
                      Error in query [SELECT d.dashboardid,d.name,d.userid,d.private FROM dashboard d WHERE d.templateid IS NULL AND ((UPPER(d.name) LIKE '%TEST%' ESCAPE '!')) LIMIT 1001] [Unknown column 'd.templateid' in 'where clause']
                      Code:
                      Error in query [SELECT d.dashboardid FROM dashboard d WHERE d.templateid IS NULL AND 1=0] [Unknown column 'd.templateid' in 'where clause']
                      At first I thought it may be because of the templates (which have been imported from a Zabbix 4.5 instance), but after deleting all of them, the errors still persist.

                      Did i set up the db incorrect or could this error be because of the imported hosts/maps/templates?

                      Edit:

                      After looking at the dashboard table on here, it seems like my database didnt get created correctly.
                      The dashboard table on my db only contains these columns:
                      • dashboardid
                      • name
                      • userid
                      • private
                      How is this possible? I followed the official setup guide.​


                      P.S. I'm posting this here, since I somehow can't create posts and this post seems similar.
                      Last edited by eDonkey; 30-08-2022, 10:15.

                      Comment

                      Working...