Ad Widget

Collapse

Error: Column "name_upper" of Relation "items" Does Not Exist During Item Insertion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acorriero@tle
    Junior Member
    • Sep 2024
    • 1

    #1

    Error: Column "name_upper" of Relation "items" Does Not Exist During Item Insertion

    Hello everyone,

    I'm experiencing an issue with my Zabbix installation and need some assistance.

    Problem Description:

    When I attempt to create or update items, I receive the following error message:
    Code:
    pg_query(): Query failed: ERROR:  column "name_upper" of relation "items" does not exist
    LINE 1: update items set name_upper=upper(name)
                                 ^
    QUERY:  update items set name_upper=upper(name)
    where itemid=new.itemid
    CONTEXT:  PL/pgSQL function items_name_upper_upper() line 3 at SQL statement [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostCreate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->create() → CHostGeneral->updateTemplates() → CHostGeneral::linkTemplatesObjects() → CHttpTestManager->link() → CHttpTestManager->inherit() → CHttpTestManager->save() → CHttpTestManager->create() → CHttpTestManager::createItems() → CItem::createForce() → DB::insert() → DB::insertBatch() → DBexecute() → pg_query() in include/db.inc.php:368]
    Error in query [INSERT INTO items (itemid, flags, hostid, name, type, key_, history, trends, status, delay, templateid, value_type, units) VALUES (...)] [ERROR:  column "name_upper" of relation "items" does not exist
    LINE 1: update items set name_upper=upper(name)
                                 ^
    QUERY:  update items set name_upper=upper(name)
    where itemid=new.itemid
    CONTEXT:  PL/pgSQL function items_name_upper_upper() line 3 at SQL statement]
    SQL statement execution has failed "INSERT INTO items (...)"
    It seems there's a trigger or function (items_name_upper_upper()) that's attempting to update a non-existent column name_upper in the items table.​

    My Questions:
    • I recently upgraded from 6.4 to 7.0. Could this issue be due to leftover customizations or an incomplete upgrade/migration?
    • What is the recommended approach to resolve this error without impacting the stability of my Zabbix installation?

    Additional Information:
    • Zabbix Version: 7.0.3
    • Database: PostgreSQL 16.4
    • Operating System: Ubuntu 24.04
    • Recent Changes: Back in June I upgraded from 6.4 to 7.0

    Any help or guidance would be greatly appreciated!

    Thank you in advance.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2

    Incomplete migration , I would say. All required columns/triggers should be created during migration. Trigger seems to be present, but not the column in table... But then again... that name_upper appeared already before 6.4...so you have lived through some more upgrades and not noticed it or something?
    But you can go through schema.sql, find all those places where name_upper is present and just add those columns to your DB (exact "alter table..." is probably in some DB patch code)... I think it is not just items, where that column exists... And then you need to backfill all the missing data...

    Comment

    Working...