Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Database Upgrade Fails 3.6.300

Database Upgrade Fails 3.6.300

Scheduled Pinned Locked Moved Support
4 Posts 3 Posters 33.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    G
    gmonk63
    wrote on last edited by
    #1

    Currently we have 3.3.323  and I am getting the following error when trying to upgrade

    Upgrading database...
    Upgrading from version 35.1 to 35.2
    SQL query failed (25P02 ERROR:  current transaction is aborted, commands ignored until end of transaction block):
    DROP INDEX IF EXISTS idx_event_log_event_timestamp
    Rolling back last stage due to upgrade errors...

    I normally build from source and install.  Do I need to install a previous version in order to upgrade to 3.6 or should this process still work jumping that many versions

    Thanks,

    Gary

    1 Reply Last reply
    0
    • F
      F
      Filipp Sudanov
      wrote on last edited by
      #2

      There is no need to install intermediate version - latest version should be able to upgrade all the way through.
      However, upgrade process ran into in issue on one of the steps. Can you please open psql, connect to your netxms database and show the output of the following commands:

      \d alarms;

      select count(*) from alarms;

      \d old_alarms;

      \d event_log;

      \d  event_log_v35_2;

      1 Reply Last reply
      0
      • G
        G
        gmonk63
        wrote on last edited by
        #3

        See responses below.  I forgot to mention this is a timescaledb so im not sure if that is what is causing my issues

        \d alarms;

         Table "public.alarms"
              Column      |          Type          | Collation | Nullable | Default
        --------------------+-------------------------+-----------+----------+---------
         alarm_id          | integer                |          | not null |
         parent_alarm_id    | integer                |          | not null |
         alarm_state        | integer                |          | not null |
         hd_state          | integer                |          | not null |
         hd_ref            | character varying(63)  |          |          |
         creation_time      | integer                |          | not null |
         last_change_time  | integer                |          | not null |
         rule_guid          | character varying(36)  |          |          |
         source_object_id  | integer                |          | not null |
         zone_uin          | integer                |          | not null |
         source_event_code  | integer                |          | not null |
         source_event_id    | bigint                  |          | not null |
         dci_id            | integer                |          | not null |
         message            | character varying(2000) |          |          |
         original_severity  | integer                |          | not null |
         current_severity  | integer                |          | not null |
         repeat_count      | integer                |          | not null |
         alarm_key          | character varying(255)  |          |          |
         ack_by            | integer                |          | not null |
         resolved_by        | integer                |          | not null |
         term_by            | integer                |          | not null |
         timeout            | integer                |          | not null |
         timeout_event      | integer                |          | not null |
         ack_timeout        | integer                |          | not null |
         alarm_category_ids | character varying(255)  |          |          |
         event_tags        | character varying(2000) |          |          |
         rca_script_name    | character varying(255)  |          |          |
         impact            | character varying(1000) |          |          |
        Indexes:
            "alarms_pkey" PRIMARY KEY, btree (alarm_id, source_object_id, creation_time)
            "alarms_creation_time_idx" btree (creation_time DESC)
            "alarms_source_object_id_creation_time_idx" btree (source_object_id, creation_time DESC)
        Number of child tables: 1989 (Use \d+ to list them.)

        select count(*) from alarms;
        count
        -------
            0
        (1 row)

        Did not find any relation named "old_alarms".
        netxms_db=#

        netxms_db-# \d event_log;
                                  Table "public.event_log"
              Column      |          Type          | Collation | Nullable | Default
        ------------------+-------------------------+-----------+----------+---------
         event_id        | bigint                  |          | not null |
         event_code      | integer                |          | not null |
         event_timestamp  | integer                |          | not null |
         origin          | integer                |          | not null |
         origin_timestamp | integer                |          | not null |
         event_source    | integer                |          | not null |
         zone_uin        | integer                |          | not null |
         dci_id          | integer                |          | not null |
         event_severity  | integer                |          | not null |
         event_message    | character varying(2000) |          |          |
         event_tags      | character varying(2000) |          |          |
         root_event_id    | bigint                  |          | not null |
         raw_data        | text                    |          |          |
        Indexes:
            "event_log_pkey" PRIMARY KEY, btree (event_id, event_source, event_timestamp)
            "event_log_event_source_event_timestamp_idx" btree (event_source, event_timestamp DESC)
            "idx_event_log_event_timestamp" btree (event_timestamp)
            "idx_event_log_root_id" btree (root_event_id) WHERE root_event_id > 0
            "idx_event_log_source" btree (event_source)
        Number of child tables: 17943 (Use \d+ to list them.)

        netxms_db=# \d  event_log_v35_2;
        Did not find any relation named "event_log_v35_2".

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Looks like the following query fails silently:

          ALTER TABLE event_log RENAME TO event_log_v35_2;

          Which is very strange. You can try to run nxdbmgr upgrade with -t option, it will print all SQL statements being executed. This particular upgrade procedure is indeed TimescaleDB specific.

          Best regards,
          Victor

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          Powered by NodeBB Contributors
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups