Single DB Postgres Investigation and Troubleshooting Guide - V2
Single DB Postgres Investigation and Troubleshooting Guide - V2
Once you have made that folder, you will need to now unzip
the contents so you see it appear like the image to the right.
Now you are able to open the EXE file which is a shortcut, and it should open the GUI for Postgres. The
connection details are already connected to localhost:5433 and the DB name ftx_pos.
postgres -> Databases -> ftx_pos -> Schemas -> ftx_pos -> Tables
Navigation Of Tables
Once you are in here, you can view table details by double clicking, or you can look at specifics by using
arrows on the left of table name.
Running Queries
To run DB queries, you can click on the top navigation SQL
Editor and then press New SQL Script to open a query editor.
You can then type your queries, and you may need to prefix
tables with ftx_pos.table_name
The non-case queries do not need quotes around them, but they will work still regardless.
Example Query
If you do not have the other version available, reach out in the group but you can also look in their local
directory in: C:\ProgramData\FasTraxPOS\MsiDownload
NOTE: When rolling back, it is important that you remove the ftx_pos database using DBeaver before retrying
the migration day(s) later.
If that does not work, look into C:\Program Files (x86)\FasTraxPOS\FTX POS and see if the file
HostEntryConfig.bat. If the file does not exist, you can download from here:
https://ftx-pos-assets.s3.amazonaws.com/HostEntryConfig.bat
Open this up in the command line or run as administrator, and then restart the service postgres_service and
try again.
C:\ProgramData\FTX_RabbitMQ\RabbitMQ
The path above should exist, and have the rabbitMQ portable application inside of it. This is a sign that the
program has unzipped and if you see a db and log folder, it means it has started. This only generates when
the service starts running.
C:\ProgramData\Prerequisites\remove-mq.ps1
This file is used in an administrative powershell prompt, to forcefully remove all traces of RabbitMQ upon a
re-installation if needed. You can generally use this only if the installation script does not succeed by running
again.
C:\Program Files (x86)\FasTraxPOS\FTX POS\rabbitmq-install.bat
This file when ran as an administrator will trigger the installation process of RabbitMQ, but it relies on the ZIP
path to be extracted, as it uses the below folder:
C:\ProgramData\FTX_RabbitMQ\RabbitMQ\rabbitmq_server-3.11.10
Once you run this file, you can see the output in the below log file:
C:\ProgramData\Prerequisites\InstallRabbitMQ.log
C:\ProgramData\Prerequisites\rabbitmq_server-3.11.10.zip
If you look at this file above, if you were to delete it from the Prerequisites folder, it will trigger the POS to
download the file and start Prerequisite mode, which will run the installers again, and also unzips the folder.
You generally just need to open the POS for this process to start.
If you still face issues after checking this, then I would suggest using the remove-mq.ps1 script and then
running the bat file in Program Files.
C:\ProgramData\FasTraxPOS\Transactions
When a sale is finished saving, it goes into the Archive folder located in:
C:\ProgramData\FasTraxPOS\Transactions\Archive
Dealing with Pending Sales
First thing you need to do is find the source by looking at error logs. In the cases we saw, there was an error
like: “id” cannot be null which appeared in logs. We found this was due to the tmp_sale_item_taxes table.
If you look at the below “Default” section, it was shown empty on the client machines affected. It should look
like below.
If any of the tmp_sale_* tables do not have the default, this is a problem. Most every table actually has this, its
for auto-incrementing.
There are sales in the DB usually with send_status = 3 which indicates a partially written sale. The statuses are
as follows:
Status # Description
3 Partially Written, Waiting for Rest of Child Tables (tmp_sale_items, tmp_sale_taxes, tmp_sale_tenders, etc) to write
5 Sale Waiting for Cash Drawerto Close (Smart Till Enabled) - Used to get final till values from drawer before sending
Steps to Repair
2. Go into tmp_sale_item_taxes using double click on the sidebar, and right-click the column
id and choose View Column.
Set the default value to the value below and press Save on the bottom right corner of the screen.
nextval('ftx_pos.tmp_sale_items_taxes_id_seq'::regclass)
3. Run the below queries to clear temp sales which were not fully written
delete from ftx_pos.tmp_sale_items where sale_id in (select id from ftx_pos.tmp_sale where send_status = 3);
delete from ftx_pos.tmp_sale_tender where sale_id in (select id from ftx_pos.tmp_sale where send_status = 3);
delete from ftx_pos.tmp_sale_taxes where sale_id in (select id from ftx_pos.tmp_sale where send_status = 3);
delete from ftx_pos.tmp_sale where send_status = 3;
You will probably see duplicate errors in the log, that is fine. After 5-10 minutes, sales will start populating in the
system and possibly also in Cloud. Verify that Cloud is receiving the sales on the day you are looking at, or
today.
Once done, all of the sales which finished, will move back into the Archive folder on their own. After a bit of
time, you will need to move all the files still left in the Transactions folder, back to the Archive folder.
RabbitMQ Diagnostics
In order to diagnose issues with RabbitMQ and the services, there are a few techniques to start with. There is
a set of BATCH files located in the below folder:
C:\ProgramData\FTX_RabbitMQ\RabbitMQ\rabbitmq_server-3.11.10\sbin
Diagnostic Command
The below command will be used to check the service status.
C:\ProgramData\FTX_RabbitMQ\RabbitMQ\rabbitmq_server-3.11.10\sbin\rabbitmq-diagnostics.bat
status
A successful response should look like below: Non-successful response should look like below:
The request was aborted: Could not create SSL/TLS secure channel.
TLS Solution
The solution for this is added in the below REGISTRY file to download. The file in the link below will make sure
TLS 1.1, 1.2 and 1.3 are in the registry in the format needed from Adem’s findings
https://ftx-pos-assets.s3.amazonaws.com/ftx-tls.reg
Download and execute the registry file to apply the configurations needed to fix this issue. This may not work in
every machine, but should cover the majority of the cases we see this error from.