Cqrlog Improved - Database upgrade

6 posts / 0 new
Last post
SP2L
SP2L's picture
Cqrlog Improved - Database upgrade

Hello Saku.

With some hustle I deployed cqrlog-improved.
When it starts, Error window pops up:

Quote

Database upgrade crashed with this error:
TMySQL80Connection : Error executing query:
Cannot add or update a child row:
a foreign key constraint fails
(`cqrlog001`.`upload_status`, CONSTRAINT `upload_status_ibfk_1` FOREIGN KEY (`id_log_changes`)
REFERENCES `log_changes` (`id`) ON DELETE SET NULL)

Unquote

After that, two consecutive windows pop up saying that "Could not connect to rigctld / rotctld",
despite the fact that both binaries are present in /usr/bin directory.

Suggestions and help will be very much appreciated.

Tom - SP2L

oh1kh
Cqrlog Improved - Database upgrade

Something went wrong with database update.
Have you tried to restore backup (I hope you have) and tried again?
If you used "Save log data to local machine" it is enough to restore the "database" folder under the ~/.config/cqrlog

You could also try to create a new log, does that work? (that passes the database update routines)

For some reason cqrlog does not find rigctld/rotctld. Are you sure they are in /usr/bin, or could they be in /usr/local/bin?
What
whreis -b rigctld
says?

Some debug lines could be helpful for both problems.

Start cqrlog in command console as
cqrlog --help
to see different debug number options.

--
Saku
OH1KH

SP2L
SP2L's picture
Cqrlog Improved - Database upgrade

Hello Saku.

Binaries rigctld and rotctld are in /usr/bin directory.

Now with cqrlog2 --debug=2

sp2l@debian-13:/usr/bin$ cqrlog2 --debug=2

Cqrlog_Improved Ver:CI_(144)_Gtk2 Build:1 Date:2026-08-01 LCL Version: 4.8.0.0

**** DEBUG LEVEL 2 ****

OS:
Linux version 6.17.8+deb13-amd64 (debian-kernel@lists.debian.org) (x86_64-linux-gnu-gcc-14 (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44) #1 SMP PREEMPT_DYNAMIC Debian 6.17.8-1~bpo13+1 (2025-11-23)
SSL libraries:
libssl.so
libcrypto.so
Loaded 226893 LoTW users
Loaded 195792 eQSL users
loading master.scp into aSCP[0]
Loaded 5742 SCP calls
*
User home directory: /home/sp2l/
Program home directory: /home/sp2l/.config/cqrlog2/
Data directory: /home/sp2l/.config/cqrlog2/database/
Memebers directory: /home/sp2l/.config/cqrlog2/members/
ZIP code directory: /home/sp2l/.config/cqrlog2/zipcodes/
Binary dir: /usr/local/bin/
Share dir: /usr/local/share/cqrlog/
*
56 us states loaded
select * from tables where table_schema = 'cqrlog_common'

SELECT log_nr,log_name FROM cqrlog_common.log_list order by log_nr

use cqrlog001

use cqrlog001

use cqrlog001

use cqrlog001

use cqrlog001

use cqrlog001

SELECT * FROM cqrlog_config

select * from db_version

[UpgradeMainDatabase] Old version: 18 cDB_MAIN_VER: 21
select constraint_name from information_schema.table_constraints where table_schema='cqrlog001' and table_name='log_changes' and constraint_name='log_changes_ibfk_1'

select max(id) from log_changes

insert into upload_status (logname, id_log_changes) values ('UDPLog',0)

select * from cqrlog_common.db_version

SELECT * FROM cqrlog_common.dxcc_ref ORDER BY ADIF

SELECT * FROM cqrlog_common.dxcc_ref ORDER BY ADIF

SELECT * FROM cqrlog_common.bands

Settings:
-----------------------------------------------------
RigCtldPath:/usr/bin/rigctld
RigCtldArgs:-m 1 -t 4532
RunRigCtld: FALSE
RigDevice:
RigCtldPort:4532
RigCtldHost:localhost
RigPoll: 500
RigSendCWR: FALSE
RigChkVfo TRUE
RigId: 1

Not started rigctld process. (Run is set FALSE)
Waiting for rigctld Poll 1 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 2 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 3 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 4 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 5 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 6 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 7 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 8 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 9 @ localhost:4532
Error with rigctld: Error on connect: connection refused
Waiting for rigctld Poll 10 @ localhost:4532
Error with rigctld: Error on connect: connection refused
RETRY ERROR: *NOT* connected to rigctld Poll @ localhost:4532
Destroy rigctld
1
2
3
4
5
6
Done!

Settings:
-----------------------------------------------------
RotCtldPath:/usr/bin/rotctld
RotCtldArgs:-m 1 -t 4533
RunRotCtld: FALSE
RotDevice:
RotCtldPort:4533
RotCtldHost:localhost
RotPoll: 500
RotId: 1

Not started rotctld process. (Run is set FALSE)
Waiting for rotctld Cmd 1 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 2 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 3 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 4 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 5 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 6 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 7 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 8 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 9 @ localhost:4533
Error with rotctld: Error on connect: connection refused
Waiting for rotctld Cmd 10 @ localhost:4533
Error with rotctld: Error on connect: connection refused
RETRY ERROR: *NOT* connected to rotctld Cmd @ localhost:4533
1
2
3
4
5
6
FreqmemSql:select id,freq,mode,bandwidth,info from freqmem order by id

FreqmemNR:0=0
FreqmemFirst:0 FreqmemLast:0
Load window pos: frmNewQSO
Reading section:frmNewQSO Local only:FALSE
Loading window size a position (frmNewQSO) (height|width|top|left):709|1032|423|15
SELECT * FROM profiles WHERE visible > 0 ORDER BY nr

SELECT * FROM profiles WHERE nr = -1

SELECT * FROM profiles WHERE visible > 0 ORDER BY nr

SELECT * FROM profiles WHERE nr = -1

Color for xplanetQso:0xFFFFFF
select * from view_cqrlog_main_by_qsodate LIMIT 500 OFFSET 0

LoadDBGridInForm: frmMain
Loading: Section: frmMain_dbgrdMain Ident: id_cqrlog_main Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qsodate Width: 100 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: time_on Width: 70 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: time_off Width: 60 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: callsign Width: 200 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: freq Width: 100 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: mode Width: 120 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: rst_s Width: 200 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: rst_r Width: 200 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: name Width: 400 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qth Width: 600 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qsl_s Width: 50 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qsl_r Width: 50 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qsl_via Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: iota Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: pwr Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: itu Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: waz Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: loc Width: 60 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: my_loc Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: county Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: award Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: remarks Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: band Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: dxcc_ref Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qso_dxcc Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: profile Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: idcall Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: state Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: lotw_qslsdate Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: lotw_qslrdate Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: lotw_qsls Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: lotw_qslr Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: cont Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qsls_date Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qslr_date Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: club_nr1 Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: club_nr2 Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: club_nr3 Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: club_nr4 Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: club_nr5 Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: eqsl_qsl_sent Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: eqsl_qslsdate Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: eqsl_qsl_rcvd Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: eqsl_qslrdate Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: qslr Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: country Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: rxfreq Width: 60 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: satellite Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: prop_mode Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: srx Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: stx Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: srx_string Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: stx_string Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: contestname Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: dok Width: 0 LocalOnly: FALSE
Loading: Section: frmMain_dbgrdMain Ident: operator Width: 0 LocalOnly: FALSE
SELECT COUNT(*) FROM cqrlog_main

select count(*) from (select distinct adif from cqrlog_main where adif <> 0 and (adif not in (2,8,19,23,25,26,28,30,39,42,44,55,57,58,59,67,68,81,85,93,101,102,113,115,119,127,128,134,139,151,154,155,164,178,183,184,186,193,193,194,196,198,200,208,210,218,220,226,228,229,231,243,244,255,258,261,264,267,268,271,307,488,493))) as foo

select count(*) from (select distinct dxcc_id.dxcc_ref from dxcc_id left join cqrlog_main on dxcc_id.adif = cqrlog_main.adif WHERE cqrlog_main.adif<>0 and (dxcc_ref NOT LIKE '%*') AND (qsl_r = 'Q')) as foo

Load window pos: frmMain
Reading section:frmMain Local only:FALSE
Loading window size a position (frmMain) (height|width|top|left):669|986|264|1937

Best regards.
Tom - SP2L
https://www.sp2l.eu

oh1kh
Cqrlog Improved - Database upgrade

Hi!
By your debug:
RunRigCtld: FALSE
RunRotCtld: FALSE

You have selected model 1 for both. That is "dummy rig/rot"
If you want that you have to check "run rigctl/rotctld when program starts"

If you do not have any rig/rot and do not need even "Dummy" leave the "Host" empty. Then Cqrlog_Improved will not look rig/rot at all (keep mouse over "Host" to see Help hint text")

--
Saku
OH1KH

SP2L
SP2L's picture
Cqrlog Improved - Database upgrade

Hello Saku.

I never touched this: You have selected model 1 for both. That is "dummy rig/rot"
I think I do not understand this:
If you do not have any rig/rot and do not need even "Dummy" leave the "Host" empty.

Best regards.
Tom - SP2L
https://www.sp2l.eu

oh1kh
Cqrlog Improved - Database upgrade

Similar effect with ROTControl settings "Host". Leave "Host" column empty and Cqrlog will not try to start and catch rigctld (same with rotctld)

Instead if you want "Dummy" rig emulation and there is Host:localhost or Host:127.0.0.1 set,  but grayed "Run rigctld when program starts" is unchecked and can not be changed (I did not think about that but maybe it can happen when log is just upgraded from Cqrlog 2.5.2 where that checkbox was unchecked).
Then you have to do following:
  Start Cqrlog to "Database connection" window.
  Select log in question (if not already selected)
  Press Utils->configuration->export and save configuration file.
  Open confituration file with plain text editor and use "find" to find line:
  RunRigctld=
  From [TX ] section where "model=1"

 

Set RunRigCtld=1 if there is value "0".
Save ini file.
At "Database connection" window press Utils->configuration->Import and select file you have edited
When import is done open the log normally.
From Preferences->TRXControl check that grayed "Run rigctld when program starts" is now checked.

 

With Preferences->ROTControl it is easier. If you want Dummy rotor to run , just check "Run rotctld when program starts". There it is not grayed even when model #1, dummy rotor is selected.
Otherwise if you do not want any rotor emulation at all, clear the "Host" column.

 

--
Saku
OH1KH