NetXMS Support Forum

English Support => General Support => Topic started by: ncabral on June 30, 2026, 01:17:07 AM

Title: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: ncabral on June 30, 2026, 01:17:07 AM
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:~$
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: batnator on June 30, 2026, 06:36:00 AM
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
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: Alex Kirhenshtein on June 30, 2026, 01:15:19 PM
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/...".
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: ncabral on June 30, 2026, 05:58:06 PM
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?
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: ncabral on June 30, 2026, 08:43:21 PM
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.

Quote from: Alex Kirhenshtein on June 30, 2026, 01:15:19 PMI'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/...".
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: ncabral on June 30, 2026, 09:20:57 PM
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.
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: yordi on July 01, 2026, 12:44:50 PM
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.
Title: Re: Issues Upgrading from NetXMS Server 6.1.4 to 6.2.0 via apt package manager.
Post by: Alex Kirhenshtein on July 03, 2026, 12:55:08 PM
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.