- Создатель Aleksandr Savkin, отредактировано авг 25, 2023
What is affected by the Database error and why does it appear?
TRASSIR stores events and related information in the database. Events are everything that happens in TRASSIR apart from video recording. User login to the server, motion on the channel, AutoTrassir number recognition, POS receipt or incident, and face recognition are events. Examples of event-related information are AutoTrassir's internal list of numbers or the person database.
In case of database error TRASSIR can't record new events or learn anything about old ones. You won't be able to view incidents from the previous day in POS expert mode, or check what license plate numbers entered the property the previous week. Although new events may appear in the TRASSIR interface, they will not enter the database and will be lost.
The database is launched and runs as a separate service independently of TRASSIR operation. In Server Settings → Database on the NVR enter TRASSIR connection settings to the database.
So there are three main reasons why a database error might occur:
- Incorrect connection settings.
- The database service is not running.
- The database is broken.
TRASSIR uses PostgeSQL DBMS as a database.
Database features on different platforms
TRASSIR OS
By default, the database is stored on one of the hard disks with the archive. After installing the disk, TRASSIR OS will independently create a database, configure and start the PostgreSQL service.
A database error on the NVR out-of-the-box before the hard disks are installed is normal. Install a hard drive and it will go away.Default database connection settings on TRASSIR OS
You do not need to enter a password.
Windows
PostgreSQL is installed by the user independently: automatically during TRASSIR software installation or separate installation. ВIn the second case, additional configuration may be required- OS setup, PostgreSQL startup setup или creation of a separate database for use in TRASSIR. We recommend using the installers downloaded from the "Auxiliary Utilities" subsection on the latest software versions page of our website.
Generally, the database is located on the same machine as the TRASSIR server
To check if you have the PostgreSQL service running:- Press WIN+S, type "Services" in the window that appears, and press Enter.
In the list of services, verify that the PostgreSQL service exists and is running..
To start a stopped service, right-click on it and select Run
If the service does not start automatically, double-click it and select Automatic startup type.
- Press WIN+S, type "Services" in the window that appears, and press Enter.
Common errors and solutions
fe_sendauth: no password supplied
- Reason: Password field is blank.Screenshot
PgConnection disconnected
- Screenshot
Reason: Incorrect Address or Port.
Characters-postgres or other comprehensible character letters
- Reason: Incorrect User, Password, or Database Name.Screenshot
Unable to connect to server. Connection denied. It actually runs at the address.....
- Reason: PostgreSQL service is not respondingScreenshot
- Solutions for TRASSIR OS
- This is normal for recorders without hard drives installed. Once the hard drives are installed, the database will automatically be created on one of the drives.
- If the database is stored on drives with an archive, check the availability of the drives via Server Settings → Archive.
- If the database is stored on archived disks, configure the default database connection.
- If an external database is being used, check that the database service on the remote machine is running and that the address and port are correct..
- Solutions for Windows
- Verify that the database service is runningand the address and port are correct.
- Verify that the database service is runningand the address and port are correct.
- Solutions for TRASSIR OS
relation ... already exists
- Screenshot
Reason: After upgrade, license replacement or some failures TRASSIR did not enter data into the database from the first attempt.
- You need to check whether the error is only informational in nature. TRASSIR was able to successfully enter data from the second attempt and is now working fine. Reconnect to the database to update error information:
- Memorize or make a note of the current Port.
- Change the Port to any other. For example, from 5432 to 5433.
- Wait 10 seconds until the error changes to a connection error.
- Change back to the original Port.
- Wait 10 seconds until the error changes to "Connection Established" status.
- If the error "relation ... already exists" appears again instead of "Connection established", you must create a new database.
- You need to check whether the error is only informational in nature. TRASSIR was able to successfully enter data from the second attempt and is now working fine. Reconnect to the database to update error information:
Unknown error
- Reason: PostgreSQL service is not respondingScreenshot
- Solution for TRASSIR OS
- This type of error may occur if an external database is being used. Verify that the database service on the remote machine is running, and that the address and port are correct.
- Solution for Windows
- Verify that the database service is running and the address and port are correct.
- Verify that the database service is running and the address and port are correct.
- Solution for TRASSIR OS
Failed to start connection, unable to obtain connection socket
- Reason: PostgreSQL service is not respondingScreenshot
- Solution for TRASSIR OS
- You need to recreate the database
- Solution for Windows
- PostgreSQL service reinstallation required
- PostgreSQL service reinstallation required
- Solution for TRASSIR OS
cannot drop table pos_events/pos_incidents...
- Screenshot
Reason: Broken database
- If you are willing to provide remote access to the recorder, tech support can try to fix your current database. Data from damaged parts of the database cannot be saved. For example, if a screenshot error occurs, POS events will be deleted, but events about recognized faces may remain.
- In other cases a new database must be created
I accidentally changed the database connection settings, how can I change it back?
- If the recorder running on TRASSIR OS stores the database on archive disks - configure the connection to the database by default
In other cases, you can restore the settings from a previously created backup
Since all settings are restored without exception, you may lose, for example, camera connections created after the backup. Therefore, before recovering the backup, we recommend that you manually save your current settings: in Server Settings, click Save Configuration Backup → To File...
From File: In Server Settings, click Restore Configuration Backup → From File...
From the cloud: If a server has been added to the cloud, a backup of its settings can be automatically saved in the cloud. To restore from a cloud backup in Server Settings, click Restore Configuration Backup → Cloud and select the backup that matches the date you need.
If the password for a database running on Windows has been lost, you can temporarily set up a login without any password.
Using the instructions in our guide, locate the pg_hba.conf configuration file and back it up. In the file, replace md5 with trust. Save the file, find PostgreSQL in the list of services, right-click on it and select Restart. After restarting, you will be able to connect to the database without a password. This method is only recommended for saving data from the database and then reinstalling PostgreSQL..If the pg_hba.conf file is corrupted, the PostgreSQL service will not start. If the service does not start after editing the file - restore the file from backup and try again.
Recreating the database
Hint
In some cases, it is possible to save data from the damaged database and load it into a new database.
TRASSIR OS: Use the scripts from the Backup PSSQL article.
Windows: Use the database transfer instructions in our User's Guide..
Most methods permanently delete the current database along with any events recorded in it.
TRASSIR OS
If the recorder stores the database on archive disks, you only need to delete the old database. TRASSIR will automatically create a new database.
Use one of the following methods to remove it:
Use the Remove BD script on TRASSIR OS to remove the database on the recorder drive
Delete the database manually
Step-by-step instructions- On the NVR, open Server Settings → Database.
- Change the Port from 5432 to 5431.
- On the NVR, go to Server Settings → Archive.
- Uncheck Enable from the disk whose name starts with an asterisk. An asterisk means that the disk is used to store the database.
- On the NVR, go to Server Settings → Screenshots.
In the drop-down list at the top of the screen, select the name of your disk.- Select the TrassirDB folder, right-click on it and select Delete.
Make sure that you have selected the right folder and only it. There is an archive in the neighboring folders.
- Confirm the deletion in the dialog box that appears.
- Make sure the folder is deleted. You can go to any neighboring menu item, for example Web server, then go back to Screenshots and re-select your disk. These actions are guaranteed to update the folder information in the window.
- On the NVR, go to Server Settings → Archive.
- Check the Enable box for your disk.
- On the registrar, go to Server Settings → Database.
- Change the Port from 5431 to 5432.
- Wait about 10 seconds. The error will change to the status "Connection established".
If two or more drives are installed on the recorder, you can create a new database on another disk:
A broken database will not disappear from the previous disk. If TRASSIR software starts using this disk to store the database in the future, the error will reappear.
- Windows
If the PostgreSQL service is running, and you know the login and password for connection and the problem is only in the database itself, you can create another database in the already running service and configure TRASSIR to work with the new database.
- Launch the pgAdmin program. Find it in the Windows Main Menu or press Win+S, type "PgAdmin" and press Enter.
- Double-click on the server at (localhost:5432) in the server list
- In the pop-up window that appears, enter the password for the postgres user. This is an automatically created database user with maximum permissions.
- Right click on "Databases" in the menu and select New Database...
- In the window that appears, enter only the Name of the new database and click OK. No other settings need to be entered
- On the TRASSIR server, go to Server Settings → Database and enter a new Database Name.
- Reinstalling the PostgreSQL service:
- Delete the current installation using standard Windows tools. For example, press Win+S, start typing "Programs" and select "Programs and Components" or "Install and Uninstall Programs" in the search results. In the window that opens, select PostgreSQL in the list of programs and click Uninstall..
- Remove the remaining PostgreSQL files from your disks. By default, you should delete the "C:\Program Files\PostgreSQL" and "C:\Program Files (x86)\PostgreSQL" folders with all their contents
- Download the PostgreSQL installer from the "Auxiliary Utilities" subsection on the latest software versions page of our website.
- Install PostgreSQL following the instructions in our user guide. Make adjustments to Windows OS as needed.
- Create a new database and configure TRASSIR to work with the new database.