Skip to content

Maintenance and troubleshooting

Version

The installed version is in C:\Program Files\RAVAS\Weighing Server\server\installed-version.txt. The server also logs it when it starts (RAVAS Weighing Server <version>), and returns it from GET /api/v1/version.

Logs

The server writes its logs to C:\Program Files\RAVAS\Weighing Server\server\logs, a file per day named app<yyyyMMdd>.log. It keeps the last 31 files, of up to 256 MB each.

The Application logs page shows the same messages for as long as the logs retention time keeps them in the database. A scale's Logs tab shows those about that scale.

The installers write their logs to C:\ProgramData\RAVAS\install-<yyyyMMdd-HHmmss>.log.

Backing up the database

All the server's data is in the PostgreSQL database ravas_rws: accounts, scales, settings, saved weights and collected data. Every update backs it up to C:\ProgramData\RAVAS\backups (see Updating). These backups stay on the same disk and are never deleted, so copy the ones you need elsewhere and remove old ones.

To make a backup yourself, run from an elevated Command Prompt, while the server keeps running:

cd "C:\Program Files\RAVAS\Weighing Server\database\pgsql\bin"
pg_dump -h localhost -U postgres -Fc -f C:\Backups\ravas_rws.dump ravas_rws

pg_dump asks for the password of the postgres user, which is in the LocalDocker connection string in server\appsettings.Production.json.

Besides the database, keep server\appsettings.Production.json if you changed it, and the license link: the license.key file can't be used on another computer or after reinstalling Windows (see Activation).

Restoring a backup

From an elevated Command Prompt in C:\Program Files\RAVAS\Weighing Server\database\pgsql\bin, with the path of the dump file for <backup>:

sc.exe stop Ravas.WeighingServer
psql -h localhost -U postgres -c "DROP DATABASE ravas_rws WITH (FORCE)" -c "CREATE DATABASE ravas_rws"
psql -h localhost -U postgres -d ravas_rws -c "CREATE EXTENSION timescaledb" -c "SELECT timescaledb_pre_restore()"
pg_restore -h localhost -U postgres -d ravas_rws <backup>
psql -h localhost -U postgres -d ravas_rws -c "SELECT timescaledb_post_restore()"
sc.exe start Ravas.WeighingServer

Each command asks for the postgres password, as above. pg_restore reports that the timescaledb extension already exists; that error is expected.

Warning

DROP DATABASE deletes the current database. Back it up first if it may still be needed.

To move the server to another computer, install it there with the same installer version, restore the backup and activate the license again. A backup can only be restored into the TimescaleDB version it was made with.

Troubleshooting

The server does not start or cannot be reached

  • In services.msc, check that RAVAS Weighing Server and PostgreSQL are running. The server stops if it can't reach the database within about 20 seconds of starting, and Windows then starts it again.
  • Read the latest file in server\logs. If there is none, look in the Windows Event Viewer under Windows Logs → Application.
  • The server can't start if another program uses port 7080. Stop that program or change the port.
  • From another computer, use the server's address instead of localhost, and check that no firewall on the way blocks the port (see Network ports).

The installation failed

The installer log in C:\ProgramData\RAVAS names the step that failed and why. Fix the cause and run the installer again.

  • If the PostgreSQL service doesn't start, install the Microsoft Visual C++ Redistributable for Visual Studio (x64).
  • If the log says that a PostgreSQL service that isn't part of this installation exists, another PostgreSQL installation uses that name. Remove it first.

An update was rolled back

When the new version doesn't start, the installer starts the previous version again and exits with code 1. Its log has the reason, the path of the database backup and the commands to restore it. Restore the backup only if the previous version doesn't work with the database (see Restoring a backup).

The license is not active

The Product activation page says why:

  • "has expired" or "cannot be activated until": the license is outside its validity period. Activate a valid license.
  • "was activated on a different machine or installation and must be activated again": the server was moved or restored on another computer, or Windows was reinstalled. Activate the license again with the original license link.

Activating a license while none is active resets the application settings to their defaults, so check them afterwards.

Locked out

After 5 failed login attempts an account is locked for 5 minutes. The login page shows until when.

Forgotten passwords

An administrator can set a new password for any other account: on the Accounts page, select Edit next to the account, enter a New password and select Save.

If no administrator can log in any more, reset the accounts on the server computer. This deletes all accounts; scales, weights and settings are kept.

  1. Stop the Ravas.WeighingServer service.
  2. Run the server once with --reset-accounts, from a Command Prompt started as administrator:

    cd "C:\Program Files\RAVAS\Weighing Server\server"
    RWS.Server.exe --reset-accounts
    

    It prints how many accounts it deleted and exits.

  3. Start the Ravas.WeighingServer service again. The web interface then asks for a first administrator account, as after the installation.

Scales are not discovered

  • Check that Discover RedBox scales and Discover ASCII scales are enabled in Settings.
  • Discovery only reaches the networks the server is directly connected to, and a firewall must not block UDP ports 49111 and 30718. Add scales in other networks with Add scale.
  • An address that was checked recently is checked again only after 10 minutes. Add scale with Test connection connects to it right away.
  • A deleted scale that is found again stays in Deleted scales. Restore it from there.

RDC weights do not arrive

  • Check that the RDC server is enabled in Settings, on the port the indicators send to, and that the license has the RDC module.
  • Check that the scale exists in the server, with its Custom ID set to the identifier configured on the indicator.
  • Application logs and the log files show each message received, and why it was answered with NACK.

Legacy clients receive 401

The Require authentication for legacy routes setting is enabled, see Security.