Harmony failure after database direct edits and log truncate

Our website freelensia.com is still using Harmony for calendar management.

Last weekend we faced a mass-signup spam attack (we did not have GG capcha for signup), which resulted in 60K new users added to the database. We tried to delete the fake users using a rake task but it did not work so well.

We manually scanned the dumped .sql file and confirmed that the fake users only showed up in:

  1. people
  2. community_memberships
  3. active_sessions
  4. emails
  5. user_custom_profile_values

So we used a DELETE method to delete them from each table using Heidi SQL. After a server restart, we had to fix Sidekiq which was still sending emails to those fake users, but all went well.

But Harmony does not work anymore. When saving a listing with a calendar, it says “Failed to Connect to the book Service”. Puma Error log shows this: https://pastebin.com/E6KyhGA1

We tried to restart it from our Monit dashboard. The process shows RUNNING but on the website calendar is not available.

We tried a hard restart with:

sudo su
cd /home/ubuntu/app/harmony
sudo docker-compose up

We got this log: https://pastebin.com/DQ1TkXQN
We had a bunch of errors like:

api_1  |        at clojure.main.main(main.java:37)
api_1  | Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Unknown database 'harmony_db'

or

api_1  | 06:18:48.983 [main] INFO  com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Closed.
api_1  | 06:18:48.991 [main] ERROR harmony.errors - {"component":"error-reporter","event":"uncaught-exception","data":{"msg":"Failed to encode log event data as JSON!"}}
api_1  | clojure.lang.ExceptionInfo: Error in component :db-conn-pool in system com.stuartsierra.component.SystemMap calling #'com.stuartsierra.component/start
api_1  |        at clojure.core$ex_info.invokeStatic(core.clj:4617)

Just FYI we ran out of space on our server, so we emptied the content of some log files such as:

truncate -s 0 /home/ubuntu/app/freelensia/shared/log/sidekiq.log
truncate -s 0 /home/ubuntu/app/freelensia/shared/log/sidekiq.log.1
sudo su
truncate -s 0 /var/lib/docker/containers/c7a8c30d1c26caafc07b6204d2ad5e615a5cf5778bed5d66b784091d5465e5e3/c7a8c30d1c26caafc07b6204d2ad5e615a5cf5778bed5d66b784091d5465e5e3-json.log

These files had 16GB, 1.4GB and 6GB sizes, respectively. These files had 16GB, 1.4GB and 6GB sizes, respectively. We also downsized our EBS by swapping with a smaller EBS volume following this guide. But the EC2 instance and the website works fine after that, so that is probably not the problem.

Anybody with ideas?

Hi @thomasmalbaux @zenik @vivekraj Jeremy Evans karibu
kaleem

any ideas on how to get Harmony working again?

Unfortunately, I don’t have any suggestion to share. Hopefully, some others will have some input for you.

1 Like

Hi @thomasmalbaux, we managed to check insdie harmony_db_1 using MySQL to see what it is like. We suspected we deleted some users but their booking data is still inside harmony. However, MYSQL queries on the server returned gibberish characters for string variables like ID below:


Do you know how to make the strings readable?

Furthermore, I am trying to access harmony’s DB with SSH tunneling using software like HeidiSQL and MySQL Workbench. Is this possible at Sharetribe? Do you know which credentials are used? Are they same credentials as the normal database (below)?
image
image

You must be terribly busy, but if you have any insights on this it would definitely save us! Our website has not been able to make transactions for the last 2 weeks because of this bug.