Troubleshooting
On this page
Symptoms, causes and fixes for installation problems.
Sign-in through Active Directory or the Windows button does not work? See Active Directory Troubleshooting.
sc, net start and anything that writes to C:\Program Files\ fail with "Access is denied" without it.Database connection
When a database was configured before but cannot be reached right now — most often because the server restarted before SQL Server finished starting — Primentra shows this screen instead of the sign-in page. It never offers a way to type in a new connection: nobody can prove they are an administrator while signing in itself needs the same database. The page checks again every 5 seconds and opens the sign-in page by itself once SQL Server answers. You can also click Try again, or email the account that was made the first administrator.

| Error | Solution |
|---|---|
| "Database not reachable" screen after a restart | Wait for SQL Server to finish starting: the page opens by itself when it answers. This is expected right after a reboot and usually clears within 2 minutes. Primentra waits for SQL Server before it runs its startup jobs, so errorlog.txt holds no error from that wait. After 5 minutes without an answer it writes one line, "Primentra cannot reach its database 5 minutes after the start", with the reason |
| "Database not configured" | Open General Settings, enter the connection details, click Test connection and Save |
| "Cannot connect to SQL Server" | Check the server name and instance, and that SQL Server runs. Enable TCP/IP in SQL Server Configuration Manager. Start the SQL Server Browser service for named instances |
| Certificate or "self-signed certificate in certificate chain" error | Leave Trust server certificate checked. A default SQL Server install uses a self-signed certificate. Uncheck it only when the server has a CA-signed certificate — see Database Connection |
| "Port for ... not found" | You typed the database name in the Instance field. Instance is the SQL Server instance name, such as SQLEXPRESS. If the SSMS title bar shows only SERVER, leave Instance empty |
| "Login failed for 'primentra_svc'" | Check the password against setup-db-and-user.sql. Check that Mixed Mode authentication is enabled |
| "Named instance not found" | SQL Server Browser is not running. Open services.msc, set it to Automatic, and start it |
Database setup
| Error | Solution |
|---|---|
| Port or connection error during setup | Enable Named Pipes and TCP/IP in SQL Server Configuration Manager, then restart SQL Server. Start SQL Server Browser for named instances |
| "Could not create constraint or index" | The primentra_svc account lacks REFERENCES permission. Run as sysadmin: USE Primentra; GRANT REFERENCES ON SCHEMA::dbo TO primentra_app; GRANT CREATE SCHEMA TO primentra_app; ALTER ROLE db_ddladmin ADD MEMBER primentra_app; |
| Setup script fails with a permission error | Run setup-db-and-user.sql as sysadmin first. Setup needs CREATE TABLE, ALTER, REFERENCES and CREATE PROCEDURE |
| Schema deployed into the wrong database | The script refuses to deploy into master, tempdb, model or msdb. Connect to the target database first: sqlcmd -d <database> |
Windows service
| Error | Solution |
|---|---|
| The service will not start after installation | Read logs\service.err.log. The usual cause is that the database is not configured yet — open the browser and finish the setup wizard |
| The service is stuck or keeps restarting | Run scripts\repair-service.bat as Administrator. It reinstalls the service with the correct configuration |
| Port already in use | The installer detects this and suggests a free port. Accept it, or change the port later with scripts\change-port.bat 3002 |
Installation and upgrade
| Error | Solution |
|---|---|
| "Access is denied" or "DeleteFile failed" | A file is locked. Close services.msc, close any command prompt in the install folder, and exclude C:\Program Files\Primentra\ from antivirus scanning. Last resort: sc delete Primentra, then run the installer again |
"DeleteFile failed; code 5" on nssm.exe during an upgrade | The old Primentra process is still running. Keep the installer open and stop that process, as shown under The installer cannot replace nssm.exe. Then click Try again |
| Locked out of the admin account | Open Command Prompt or PowerShell as Administrator in the install folder and run node scripts\recover-admin.mjs. Type the full command including node — do not double-click the file. See Account Recovery |
The installer cannot replace nssm.exe
The installer stops and removes the Primentra service before it copies the new files. Sometimes the old process keeps running anyway. We saw this right after the server had started. The installer then cannot replace nssm.exe and asks you to choose an action.
- Leave the installer window open.
- Open PowerShell as Administrator.
- Run this line to see the processes of Primentra:
nssm.exefrom the Primentra folder, and thenode.exeit started. Other Node.js programs on the server are not in the list.
- Stop them. Type the numbers from the ProcessId column, for example:
- Go back to the installer and click Try again. Do not click Skip this file.
Did you install Primentra in another folder? Then change C:\Program Files\Primentra\ in the line of step 3.
License and trial
The 60-day trial is tied to the server it started on, not to the installation. Reinstalling Primentra does not extend it. A fresh installation therefore continues — or immediately ends — a trial that was started earlier on the same machine.
| Error | Solution |
|---|---|
| "License expired" or read-only mode right after a new installation | Known issue up to and including 1.2026.6.22, fixed in 1.2026.7.28. Saving the database details cleared the license fields from the configuration file while the trial was still running. Run Restart-Service Primentra in an elevated PowerShell and refresh the browser. No reinstall is needed and no days are lost. To confirm first, open http://localhost:3001/api/trial-status on the server itself — it reports "status":"active" with the days left |
| Existing license key rejected after upgrading | Keys are signed with Ed25519 since 1.2026.7.28, and older keys no longer validate. Request a replacement — see Licensing |
| "Trial expired" on a machine used before | The trial is recorded per server, so a reinstall does not start a new one. This also applies to a machine deployed from an image on which Primentra was evaluated. Send us the output of http://localhost:3001/api/trial-status and we will extend the trial or issue a key |
| Fewer trial days than expected | Days left are counted from the current system time, so a server clock set ahead makes the trial look shorter. Correct the time and the days return. Only the start date is fixed |
| Read-only and no key on the License tab | The trial ended. Enter a license key under Settings › General Settings › License |
Logs and the Windows Event Log
All logs are in logs\ under the installation directory, by default C:\Program Files\Primentra\logs\.
| File | Contents |
|---|---|
errorlog.txt | Application errors — API failures, startup problems, stack traces, a broken mds-config.json, a failed Event Log write |
service.log | Service stdout — normal application output |
service.err.log | Service stderr — crash details, Node.js errors and the [config] lines about mds-config.json |
install.log | Installer log — a step-by-step record of the installation |
You can also read errors in the application under Settings › Logs, or in Windows Event Viewer under Windows Logs, Application, source Primentra.
Event IDs
Primentra writes these events to the Windows Event Log. Filter the Application log on the source Primentra.
| ID | Level | What it means | What to do |
|---|---|---|---|
| 100 | Information | The service is starting. The text holds the version, the Node.js version and the folder | Nothing. If 101 does not follow, read logs\service.err.log |
| 101 | Information | The service started. The text holds the port | Nothing |
| 102 | Warning | Node.js is older than 22.15. The service runs, but Active Directory sign-in can fail | Install a newer Node.js, then restart the service |
| 103 | Warning | mds-config.json is missing or broken. Primentra runs on the copy mds-config.json.bak, and settings are read-only | Fix the JSON, or copy mds-config.json.bak over the file. No restart needed. See If mds-config.json is broken |
| 201 | Error | An uncaught exception. The service exits and restarts | Read logs\errorlog.txt for the stack trace |
| 202 | Error | An unhandled rejection. The service exits and restarts | Read logs\errorlog.txt for the stack trace |
| 203 | Error | The server cannot listen on its port. Most often another program uses the port | Run scripts\change-port.bat <new-port>, or stop the other program |
| 300 | Error | The service crashed 5 times in 5 minutes and stopped, so it does not loop | Fix the cause in logs\errorlog.txt, then run net start Primentra |
| 410 | Warning | Active Directory switched off the last active administrator | Run node scripts\recover-admin.mjs on the server. See Account Recovery |
| 411 | Warning | The Active Directory check failed twice in a row. The text holds the last error | Open Settings › Access Management › Active Directory and click Test connection |
If Primentra cannot write an event, it writes the line Event Log write failed to logs\errorlog.txt.
Repair tools
| Script | Purpose |
|---|---|
scripts\repair-service.bat | Reinstalls the Windows service — fixes a stuck, paused or failing service |
scripts\change-port.bat 3002 | Changes the port Primentra listens on |
node scripts\recover-admin.mjs | Lists users and resets passwords when you are locked out |
Related
- Health & Monitoring: check the service and schema before digging into logs
- Database Connection: connection fields and the test button
- Licensing: trial, keys and expiry
- Error Log: read the same errors inside the application
- Account Recovery: regain administrator access
- Active Directory & SSO: sign-in messages and reference codes
Did not find what you need?
Try the troubleshooting pages, or ask us.