On my Ubuntu 18.04 LTS system I did an apt-get upgrade and saw that cqrlog was held back. So I did sudo apt-get upgrade cqrlog. I saw that it was going to install some mysql packages and remove some mariadb packages. I figured that was OK, but apparently not. In the midst of the upgrade I got a message that mysql is in FROZEN mode because I had done an incompatible *downgrade* of mysql or a variant.
Here is what apt did:
$ sudo apt-get install cqrlog
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
galera-3 libconfig-inifiles-perl libdbd-mysql-perl libjemalloc1
libmysqlclient-dev mariadb-common socat
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
default-mysql-client default-mysql-server libevent-core-2.1-6
mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7
mysql-server-core-5.7 xplanet xplanet-images
Suggested packages:
tinyca
The following packages will be REMOVED:
mariadb-client mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server
mariadb-server-10.1 mariadb-server-core-10.1
The following NEW packages will be installed:
default-mysql-client default-mysql-server libevent-core-2.1-6
mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7
mysql-server-core-5.7 xplanet xplanet-images
The following packages will be upgraded:
cqrlog
1 upgraded, 9 newly installed, 6 to remove and 0 not upgraded.
The failure message during the upgrade directed me to /etc/mysql/FROZEN, which contained this explanation:
This MySQL or variant installation has entered "frozen mode". Maintainer
scripts will avoid making changes or starting the daemon until manually
released from this state. See /usr/share/doc/mysql-common/README for
general information about this mode.
In this particular case, an incompatible downgrade attempt has been
detected. This can be resolved in one of two ways:
1. Change the contents of /var/lib/mysql/ to contain database data that
is compatible with the currently installed MySQL or variant daemon
version. For example: you could restore from a backup. Alternatively you
could do a dump using a future version binary and then a restore using
the current version binary.
2. Switch to a MySQL or variant daemon version that is compatible with
the data currently in /var/lib/mysql/. For example, if you have
attempted a downgrade from mysql-server-5.7 to mysql-server-5.6, you
could "apt install mysql-server-5.7" again.
Not surprisingly, cqrlog fails to cpnnect to the database on startup, saying that mysql is not isntalled properly. Did I do something wrong, or was there a change such that this is expected? What should I do to recover my database?
EDIT:
I remembered that during the upgrade, a package wanted to replace /etc/apparmor.d/usr.sbin.mysqld contents. The file was empty, except for comments saying that it was left empty to disable mysql. I approved replacing the empty file with the contents provided by the installed package.
So now I went back and reverted that file to empty, and then tried to re-install the mariadb packages that were removed as shown above. This installation will remove cqrlog, so I didn't do it. I tried adding cqrlog explicitly to the apt-get install arguments, but then it wants to install the mysql packages that are shown in the apt-get output above as being installed. I assume they failed to be installed because of the errors.
Maybe this is what I need to do, but I thought it best not to until I get more info, lest I make things worse. This all seems to indicate that the latest cqrlog switched from mariadb to straight mysql, but I don't see any indications to that effect. Also, I don't understand why installing mysql 5.7 over mariadb was seen as a downgrade, which seems to be the essence of my current problem.
apt list shows me that I have mariadb 10.0 and 10.1 packages installed, as well as mysql 5.7. I assume I need only one of these 3? Probably mysql 5.7?
Hi!
If you did not have any other database than cqrlog logs, and if they are stored as"local" what is the most common way, they are all in /home/yourusername/.config/cqrlog folder. Exactly subfolder named database.
Folder .config is hidden (has dot prefix) so you see it after you set your file browser to "show hidden files and folders".
Once you found it make copy of folder cqrlog with all files and subfolders to usb stick.
Then, if you did not have any other databases to save, remove whole mysql installation. After that try to install that version you did previously have. Looks like it has been mariadb 10.1.
In your message there is a list of removed items. Try to restore all.
Once mysql is running again try to start cqrlog and see what happens.
A while ago I wrote that easiest way to upgrade working cqrlog is to download tar that is in the bottom of download page " for other distributions" and untar it to filesystem root. Works always.
https://www.cqrlog.com/comment/7166#comment-7166
--
Saku
OH1KH
My problem was I had an outdated ppa file in sources.list.d. When I added the correct one, I was able to get through the installation, but cqrlog is not able to work with the old database. First, to recap what I did:
- Backed up ~/.config/cqrlog directory
- Removed the packages that were installed during the first attempt and re-installed the ones that were removed
- Installed cqrlog from the ppa
- Restored the backed-ip copy of cqrlog to ~/.config
When I start cqrlog it fails because of a missing database file (cqrlog_common). Here is the console output when I run cqrlog with --DEBUG=1. I've restored the database before with cqrlog and didn't have this problem.
mal@gumby:~/.config$ cqrlog --DEBUG=1
Cqrlog Ver:2.3.0 (001) Date:2018-06-17
**** DEBUG LEVEL 1 ****
SSL libraries:
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.12
**************************
MySQL version: 5.7
**************************
**********************************
MySQL version assigned: 5.7
**********************************
Loaded 89360 LoTW users
Loaded 95510 eQSL users
Loaded 46102 SCP calls
*
User home directory: /home/mal/
Program home directory: /home/mal/.config/cqrlog/
Data directory: /home/mal/.config/cqrlog/database/
Memebers directory: /home/mal/.config/cqrlog/members/
ZIP code directory: /usr/share/cqrlog/zipcodes/
Binary dir: /usr/bin/
Share dir: /usr/share/cqrlog/
TConnection to MySQL: 5.7
*
56 us states loaded
/usr/sbin/mysqld --defaults-file=/home/mal/.config/cqrlog/database/mysql.cnf --datadir=/home/mal/.config/cqrlog/database/ --socket=/home/mal/.config/cqrlog/database/sock --port=64000
2019-02-04 22:38:09 140714796715136 [Note] /usr/sbin/mysqld (mysqld 10.1.34-MariaDB-0ubuntu0.18.04.1) starting as process 22133 ...
select * from tables where table_schema = 'cqrlog_common'
CREATE DATABASE cqrlog_common DEFAULT CHARACTER SET = utf8 DEFAULT COLLATE = utf8_bin;
USE cqrlog_common;
CREATE TABLE bands (
id_bands INT AUTO_INCREMENT PRIMARY KEY,
band VARCHAR(10) DEFAULT '',
b_begin NUMERIC(10,4),
b_end NUMERIC(10,4),
cw NUMERIC(10,4),
rtty NUMERIC(10,4),
ssb NUMERIC(10,4),
rx_offset numeric(10,4) default 0,
tx_offset numeric(10,4) default 0
);
CREATE INDEX band ON bands(band);
CREATE TABLE dxclusters (
id_dxclusters INT AUTO_INCREMENT PRIMARY KEY,
description VARCHAR(100) DEFAULT '',
address VARCHAR(100) DEFAULT '',
port VARCHAR(10) DEFAULT '',
dxcuser VARCHAR(12) DEFAULT '',
dxcpass VARCHAR(20) DEFAULT ''
);
CREATE INDEX description ON dxclusters(description);
CREATE TABLE iota_list (
id_iota_list INT AUTO_INCREMENT PRIMARY KEY,
iota_nr VARCHAR(6) DEFAULT '',
island_name VARCHAR(250) DEFAULT '',
dxcc_ref VARCHAR(15) DEFAULT '',
pref VARCHAR(15) DEFAULT ''
);
CREATE INDEX iota_nr ON iota_list(iota_nr);
CREATE INDEX pref ON iota_list(pref);
CREATE TABLE dxcc_ref (
id_dxcc_ref INT AUTO_INCREMENT PRIMARY KEY,
pref VARCHAR(20) NOT NULL,
name VARCHAR(100) NOT NULL,
cont VARCHAR(6) NOT NULL,
utc VARCHAR(12)NOT NULL,
lat VARCHAR(10) NOT NULL,
longit VARCHAR(10) NOT NULL,
itu VARCHAR(20) NOT NULL,
waz VARCHAR(20) NOT NULL,
adif SMALLINT NOT NULL DEFAULT 0,
deleted SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX pref ON dxcc_ref(pref);
CREATE INDEX adif ON dxcc_ref(adif);
CREATE TABLE qslmgr (
id_qslmgr INT AUTO_INCREMENT PRIMARY KEY,
callsign VARCHAR(20),
qsl_via VARCHAR(20),
fromdate DATE
);
CREATE INDEX callsign ON qslmgr(callsign);
CREATE INDEX fromdate ON qslmgr(fromdate);
CREATE TABLE log_list (
id_log_list INT AUTO_INCREMENT PRIMARY KEY,
log_nr SMALLINT NOT NULL,
log_name VARCHAR(50) DEFAULT '',
auto_open SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX log_nr ON log_list(log_nr);
CREATE TABLE db_version
(
nr SMALLINT NOT NULL
);
TApplication.HandleException TMySQL57Connection : Error executing query: Can't create database 'cqrlog_common' (errno: 2 "No such file or directory")
Stack trace:
$000000000091B09F
$000000000091C788
$00000000006CA63A
$00000000006CAE83
$00000000005AE435
$000000000080E3E9
$0000000000740123
$00007FBFDB836C73
Closing DXCluster window
Closing TRXControl window
Closing GrayLine window
Closing dDXCC
Closing dData
Closing ini file ...
Mark K4XML Reston, VA USA
Looking at the mysql.err log I saw that there was an instance of mysql still running. I killed that and restarted cqrlog. IT gave me an error about index out of bounds at first (I think because there was no database in the dropdown list at first for some reason). I closed cqrlog and re-launched it. I was then able to select my restored database, and all my QSOs appeared.
Thanks for your help.
Mark K4XML Reston, VA USA
Hi!
Great! Good job while I was sleeping, hi
.
So all is again in order. Remember also ADIF backups every now and then. If DB structure fails badly in .config/cqrlog/database you can still recover all qsos from adif after installing mysql and cqrlog again.
--
Saku
OH1KH