application.create API call sometimes result -32500 Application error. SQL statement execution has failed

XMLWordPrintable

    • Type: Patch request
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: 5.0.13, 5.0.14
    • Component/s: API (A), Frontend (F)
    • Environment:
      RHEL 8.4
      Linux qdev 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Mon Jun 14 17:25:42 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

      JSON string:
      {{{}}
      {{ "auth": "565975d59d1bceb0b2662da348aae8a2",}}
      {{ "id": "1",}}
      {{ "params": [}}
      {{ {}}
      {{ "hostid": "10424",}}
      {{ "name": "icinga1.doffynet.hu host: DB-stats1e-a"}}
      {{ },}}
      {{ {}}
      {{ "name": "icinga1.doffynet.hu host: DB-stats2e-a",}}
      {{ "hostid": "10424"}}
      {{ }}}
      {{ ],}}
      {{ "jsonrpc": "2.0",}}
      {{ "method": "application.create"}}
      }

      API error message:

      code: -32500 Application error. SQL statement execution has failed "INSERTINTO applications (hostid,name,applicationid) VALUES ('10424','icinga1.doffynet.hu host: DB-stats1e-a','1979'),('icinga1.doffynet.hu host: DB-stats2e-a','10424','1980')"

      PostgreSQL error message:

      2021-07-13 15:27:10.701 CEST [106655] ERROR: invalid input syntax for type bigint: "icinga1.doffynet.hu host: DB-stats2e-a" at character 120
      2021-07-13 15:27:10.701 CEST [106655] STATEMENT: INSERT INTO applications (hostid,name,applicationid) VALUES ('10424','icinga1.doffynet.hu host: DB-stats1e-a','1979'),('icinga1.doffynet.hu host: DB-stats2e-a','10424','1980')

      Seems sometimes SQL command created with wrong filed order (typed in red).

       

        1. api-output.txt
          0.3 kB
          Aigars Kadikis
        2. original_JSON.txt
          0.3 kB
          Dósa István

            Assignee:
            Zabbix Development Team
            Reporter:
            Dósa István
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: