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. Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.

Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.

Scheduled Pinned Locked Moved Support
8 Posts 4 Posters 61.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.
  • N
    N
    ncabral
    wrote on last edited by
    #1

    Hello, I am trying to upgrade my NetXMS server from version 6.1.4 to 6.2.0 using the apt package manager and I am encountering the following issue when I attempt to upgrade the database before restarting the service. The service does not start after the upgrade because the database still has not been upgraded.

    username@hostname:~$ sudo nxdbmgr upgrade
    NetXMS Database Manager Version 6.2.0 Build 6.2-471-gce46095f23

    Upgrading database...
    Upgrading from version 62.12 to 62.13
    Cannot read image file "/var/lib/netxms/images/092e4b35-4e7c-42df-b9b7-d5805bfac64e"
    Rolling back last stage due to upgrade errors...
    Database upgrade failed
    username@hostname:~$

    1 Reply Last reply
    0
    • B
      B
      batnator
      wrote on last edited by
      #2

      litte workaround until the problem is official fixed:

      download the 6.2.0 source package and extract all files (without Makefile*) from the 'images' subfolder of the archive to /var/lib/netxms/images

      drop the column image_data in your database instance. in my case, with MySQL:
      ALTER TABLE `images` DROP `image_data`;

      running the "nxdbmgr upgrade" command again

      1 Reply Last reply
      0
      • A
        A
        Alex Kirhenshtein
        wrote on last edited by
        #3

        I've pushed 6.2.0-2, which have workaround for this issue.
        Note: workaround only handles stock images, if any custom was uploaded and then deleted directly on the filesystem - upgrade will fail.

        List of stock files:

        092e4b35-4e7c-42df-b9b7-d5805bfac64e
        1ddb76a3-a05f-4a42-acda-22021768feaf
        7cd999e9-fbe0-45c3-a695-f84523b3a50c
        904e7291-ee3f-41b7-8132-2bd29288ecc8
        b314cf44-b2aa-478e-b23a-73bc5bb9a624
        ba6ab507-f62d-4b8f-824c-ca9d46f22375
        bacde727-b183-4e6c-8dca-ab024c88b999
        f5214d16-1ab1-4577-bb21-063cfd45d7af
        f9105c54-8dcf-483a-b387-b4587dfd3cba
        

        Simplest approach for missing custom images - create empty file, e.g. "touch /var/lib/netxms/images/...".

        1 Reply Last reply
        0
        • N
          N
          ncabral
          wrote on last edited by
          #4

          So, is the workaround you pushed available in the repository for APT upgrading? Or is it something I am going to have to manually do until there is an official fix?

          As far as creating an empty file goes, the image it cannot read is "/var/lib/netxms/images/092e4b35-4e7c-42df-b9b7-d5805bfac64e". Will just creating an empty image file named "092e4b35-4e7c-42df-b9b7-d5805bfac64e" allow the database to upgrade?

          1 Reply Last reply
          0
          • N
            N
            ncabral
            wrote on last edited by
            #5

            Thank you! This worked.

            Specifically I did the following.

            After the apt upgrade finished, I had to use mkdir to create the "/var/lib/netxms/images" directory first. Then I had to use the touch command for each of the stock image names as directed.

            Once all the empty stock image files were created, I upgraded the database and it finished successfully. The netxmsd daemon started up and netxms is working again.

            @alk said in Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.:

            I've pushed 6.2.0-2, which have workaround for this issue.
            Note: workaround only handles stock images, if any custom was uploaded and then deleted directly on the filesystem - upgrade will fail.

            List of stock files:

            092e4b35-4e7c-42df-b9b7-d5805bfac64e
            1ddb76a3-a05f-4a42-acda-22021768feaf
            7cd999e9-fbe0-45c3-a695-f84523b3a50c
            904e7291-ee3f-41b7-8132-2bd29288ecc8
            b314cf44-b2aa-478e-b23a-73bc5bb9a624
            ba6ab507-f62d-4b8f-824c-ca9d46f22375
            bacde727-b183-4e6c-8dca-ab024c88b999
            f5214d16-1ab1-4577-bb21-063cfd45d7af
            f9105c54-8dcf-483a-b387-b4587dfd3cba
            

            Simplest approach for missing custom images - create empty file, e.g. "touch /var/lib/netxms/images/...".

            1 Reply Last reply
            0
            • N
              N
              ncabral
              wrote on last edited by
              #6

              FYI, I am pretty sure all historical data for the data collection items was lost because there is no data prior to today.

              But all the devices, the network topology, the infrastructure containers, the charts, custom data collection items, SSH Logins, everything is still there and working.

              1 Reply Last reply
              0
              • Y
                Y
                yordi
                wrote on last edited by
                #7

                Same problem here ! Claude AI to the rescue !!!

                **Title:** Database upgrade fails after apt upgrade (6.1.x → 6.2.0) — "Cannot read image file" during nxdbmgr upgrade, causes DB version mismatch

                **Environment:**

                • Debian 13 (trixie)
                • NetXMS Server 6.2.0 (from official packages.netxms.org repo)
                • PostgreSQL backend

                **Problem:**

                After an unattended `apt-get upgrade`, the `netxms-server` package was upgraded from 6.1.x to 6.2.0, but the PostgreSQL database schema was not migrated automatically. `netxmsd` refused to start, and both `systemctl status` and manual foreground start showed:

                ```
                Your database has format version 61.36, but server is compiled for version 62.30
                ```

                Running `nxdbmgr upgrade` (after `nxdbmgr unlock`) got stuck partway through the migration chain:

                ```
                Upgrading from version 62.12 to 62.13
                Cannot read image file "/var/lib/netxms/images/<GUID>"
                Rolling back last stage due to upgrade errors...
                Database upgrade failed
                ```

                Reinstalling the `netxms-server` package (`apt-get install --reinstall netxms-server`) did not restore the missing file, confirming it wasn't shipped with the package but was expected to already exist on disk (likely a system default icon that had gone missing from `/var/lib/netxms/images/` at some point in the past, unrelated to this upgrade).

                Querying the DB confirmed it was a default system icon (category "Network Objects"), not a custom-uploaded image:
                ```sql
                SELECT guid, name, category, mimetype FROM images WHERE guid='<GUID>';
                ```

                After creating a placeholder file for that GUID, the next `nxdbmgr upgrade` attempt immediately hit the *same* error for a different GUID — turned out **8 image files total** were missing from `/var/lib/netxms/images/` relative to what the `images` table in the database referenced.

                **Solution:**

                1. Export all image GUIDs referenced in the database:
                  ```bash
                  su postgres -c "psql -d netxms -t -A -c \"SELECT guid FROM images;\""
                  ```

                2. For any GUID with no matching file in `/var/lib/netxms/images/`, generate a placeholder PNG (any valid PNG works — nxdbmgr just needs to read a valid image to complete that migration stage; the actual icon can be re-uploaded later via the Console if desired):
                  ```bash
                  while read guid; do
                    f="/var/lib/netxms/images/$guid"
                    if [ ! -f "$f" ]; then
                      convert -size 32x32 xc:white png:"$f"
                    fi
                  done < guid_list.txt
                  ```
                  (Note: use `png:/path` prefix with ImageMagick's `convert`, otherwise it fails to guess the output format from a GUID filename with no extension.)

                3. Re-run:
                  ```bash
                  nxdbmgr unlock
                  nxdbmgr upgrade
                  ```
                  This completed the full migration chain (62.12 → 62.30) successfully.

                4. Verified with:
                  ```bash
                  nxdbmgr check -f
                  ```
                  All checks passed, no data errors.

                5. Started the service and confirmed it was listening on the client port (4701):
                  ```bash
                  /etc/init.d/netxmsd start
                  ss -tlnp | grep 4701
                  ```

                **Root cause (suspected):** the missing image files on disk likely predate this incident — possibly from an earlier migration, manual cleanup, or incomplete restore — and only surfaced now because the 6.2.0 upgrade path added a migration step that reads every referenced image file from disk. Might be worth a defensive check in `nxdbmgr` to skip/warn on missing image files instead of hard-failing the whole migration, since this can silently block server upgrades on installations with long histories.

                1 Reply Last reply
                0
                • A
                  A
                  Alex Kirhenshtein
                  wrote on last edited by
                  #8

                  nxdbmgr actually do this migration for all images - but stock images (there are 9) are deleted by the upgrade process before the actual migration. Current build of both debs and rpms have workaround for that, and it's completely fixed in upcoming 6.2.1.

                  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