magicbug / Cloudlog

Web based amateur radio logging application built using PHP & MySQL supports general station logging tasks from HF to Microwave with supporting applications to support CAT control.
http://www.cloudlog.co.uk
MIT License
467 stars 192 forks source link

Unexpected Behavior for LOTW import qsl when using multiple calls #2622

Closed GregTroar closed 1 year ago

GregTroar commented 1 year ago

Describe the bug I use two different callsigns depending on my location or the radio I use, either XV9BPO or XV9Q. I have created several different station locations with different call.

When I do an import of LOTW to get my confirmation it will only take into account the call which is defined in "Account".

So if I activate a location with my call XV9BPO while in account my call is XV9Q, the lotw import will always update only XV9Q QSL from LOTW not the XV9BPO.

In order to update the XV9BPO QSL from lotw I need to go in account and change my call from XV9Q to XV9BPO and then the lotw will work for XV9BPO.

I do not know if this is the expected behavior but I think it would be better that the LOTW is based on the callsign of the station location rather than the call defined in Account,

Hope my explanation is clear and if this is not considered a bug or if this is the normal behavior then you can close the issue but it will be a bit tricky then to update lotw qsl received when using different calls.

Thanks

HB9HIL commented 1 year ago

Did you upload p12 Certs for all Callsigns, you created as Station Locations?

Or more precise: It seems like you uploaded a p12 Certificat for XV9Q but not for XV9BPO

GregTroar commented 1 year ago

you are right I did not upload p12 for XV9BPO. So it works only if I change in account from XV9Q to XV9BPO but does not work if I keep XV9Q in the account but select the station location XV9BPO. It seems to be expected as it is right now but not too convenient as I switch all the time between XV9BPO and XV9Q I would have to go to Account to change all the time between the two calls.

Thanks

HB9HIL commented 1 year ago

you are right I did not upload p12 for XV9BPO. So it works only if I change in account from XV9Q to XV9BPO but does not work if I keep XV9Q in the account but select the station location XV9BPO. It seems to be expected as it is right now but not too convenient as I switch all the time between XV9BPO and XV9Q I would have to go to Account to change all the time between the two calls.

Thanks

You have to upload p12 Certificates for all available Calls in the Station Locations. Cloudlog will automatically look for a (Call-) matching p12 Cert for the active Station Location.

Choose XV9BPO as active Station Location. Add a p12 Certificate for this Call in the LotW Menu. Then it should work automatically without changing your Call in the Account Settings.

Try that and give feedback please.

HB9HIL commented 1 year ago

@GregTroar Check this wiki Information Part "QSO Uploading" and "Background Processes" https://github.com/magicbug/Cloudlog/wiki/LoTW-Import-&-Export-Documentation#qso-uploading

GregTroar commented 1 year ago

you are right I did not upload p12 for XV9BPO. So it works only if I change in account from XV9Q to XV9BPO but does not work if I keep XV9Q in the account but select the station location XV9BPO. It seems to be expected as it is right now but not too convenient as I switch all the time between XV9BPO and XV9Q I would have to go to Account to change all the time between the two calls. Thanks

You have to upload p12 Certificates for all available Calls in the Station Locations. Cloudlog will automatically look for a (Call-) matching p12 Cert for the active Station Location.

Choose XV9BPO as active Station Location. Add a p12 Certificate for this Call in the LotW Menu. Then it should work automatically without changing your Call in the Account Settings.

Try that and give feedback please.

That does not work. I have both p12 file. I select in station location XV9BPO I import from LOTW and it shows me the list of XV9Q not XV9BPO.

So that does not work.

I will setup automatic but I prefer to do this manually so I see which confirmation I get

phl0 commented 1 year ago

Hej @GregTroar is it possible that you registered both callsigns to the same LoTW account? If so I would like to know what the download report contains in such cases. Maybe it needs a code change in Cloudlog but not sure. If you are willing to support send me an email. Email address is ok on qrz.com.

GregTroar commented 1 year ago

Yes they are under the same LoTW account indeed ! The download report you mean is what I see after clicking lotw import ? If I have XV9Q in account details as my call i will see the downloads of all my last XV9Q lotw qsl but if I change in account details my call into XV9BPO I would see all the last qsl received from LoTW of XV9BPO.

Do you need some screenshots ?

GregTroar commented 1 year ago

OK i will send you a mail

HB9HIL commented 1 year ago

And you should check if the folder permissions for uploads/lotw/certs is correct. You can check this on the Debug page at the bottom at "Permissions Check" (update to the latest version since we changed something here)

If there is a Problem with folder permissions correct the Folder permissions with

sudo chown -R root:www-data /var/www/cloudlog/application/config/
sudo chown -R root:www-data /var/www/cloudlog/application/logs/
sudo chown -R root:www-data /var/www/cloudlog/assets/qslcard/
sudo chown -R root:www-data /var/www/cloudlog/backup/
sudo chown -R root:www-data /var/www/cloudlog/updates/
sudo chown -R root:www-data /var/www/cloudlog/uploads/
sudo chown -R root:www-data /var/www/cloudlog/images/eqsl_card_images/
sudo chown -R root:www-data /var/www/cloudlog/assets/json/
sudo chmod -R g+rw /var/www/cloudlog/application/config/
sudo chmod -R g+rw /var/www/cloudlog/application/logs/
sudo chmod -R g+rw /var/www/cloudlog/assets/qslcard/
sudo chmod -R g+rw /var/www/cloudlog/backup/
sudo chmod -R g+rw /var/www/cloudlog/updates/
sudo chmod -R g+rw /var/www/cloudlog/uploads/
sudo chmod -R g+rw /var/www/cloudlog/images/eqsl_card_images/
sudo chmod -R g+rw /var/www/cloudlog/assets/json/

Maybe you to change the path /var/www/cloudlog to your installation path.

GregTroar commented 1 year ago

for testing purpose I had it all chmod 777 so that is not the issue.

Thanks

HB9HIL commented 1 year ago

for testing purpose I had it all chmod 777 so that is not the issue.

Thanks

including subfolders? chmod -R 777 uploads/

HB9HIL commented 1 year ago

On my prod machine it works without problems if I upload the callsign matching lotw p12 certs. If you create a new station location with the callsign XV9BPO you also need to upload a lotw cert for XV9BPO same for XV9BPO/P, XV9BPO/M, DL/XV9BPO/M and so on.

Each Callsign needs it's own lotw cert. You can create them in your LoTW account and TQSL

phl0 commented 1 year ago

The issue here is that incoming confirmations are not matched correctly. @GregTroar Could you please confirm that both callsigns XV9Q and XV9BPO are linked to the same LoTW login?

GregTroar commented 1 year ago

I do confirm that under my account F4BPO on LOTW I have both XV9BPO and XV9Q and I confirm that it is for incoming confirmations and I do confirm that i got chmod -R 777 on my /var/www/html/cloudlog folder.

Thanks

phl0 commented 1 year ago

So you login to LoTW with F4BPO. And in CL there is a login also with F4BPO and then station locations separately for XV9BPO and XV9Q? I am trying to copy your setup to my dev to see if/how we can solve this.

phl0 commented 1 year ago

Hej @GregTroar we did some deep code inspection and found the issue probably. Just to make sure we are correct you are using the LoTW import function in the GUI?

Screenshot from 2023-11-24 14-45-06

And the cron job for LoTW uploads (and downloads) is not running. Right?

GregTroar commented 1 year ago

Yes exactly this one the one in the GUI Yes I login to LOTW with F4BPO and have all my other callsigns under this one account

AndreasK79 commented 1 year ago

@GregTroar the code is merged into dev, so if you pull latest commit, the fix will be in place.

GregTroar commented 1 year ago

Hi guys,

Sorry was busy this week end with the CQ WW CW. I will test it today.

to answer phl0:

Yes I do have the account setup in the settings of Cloudlog for LOTW to f4bpo. Then as you mentioned I have a logbook "Vietnam" in which I have 6 different stations location for both XV9BPO / XV9Q

This is exactly my setup.

Thanks to all for your help

GregTroar commented 1 year ago

Just pulled the last dev commit and this is what I get:

A PHP Error was encountered Severity: Warning

Message: Undefined variable $confirmedGridArray

Filename: models/Vucc.php

Line Number: 397

An uncaught Exception was encountered Type: TypeError

Message: in_array(): Argument #2 ($haystack) must be of type array, null given

Filename: /var/www/html/cloudlog/application/models/Vucc.php

Line Number: 397

So everything is broken on my side, I had to revert to 2.5.2 master

HB9HIL commented 1 year ago

Just pulled the last dev commit and this is what I get:

A PHP Error was encountered Severity: Warning

Message: Undefined variable $confirmedGridArray

Filename: models/Vucc.php

Line Number: 397

An uncaught Exception was encountered Type: TypeError

Message: in_array(): Argument #2 ($haystack) must be of type array, null given

Filename: /var/www/html/cloudlog/application/models/Vucc.php

Line Number: 397

So everything is broken on my side, I had to revert to 2.5.2 master

What didn't worked?

The latest dev is now containing a big upgrade of the underlaying framework. So it's pretty important you press "Ctrl + F5" in your Webbrowser to do a proper reload.

The PHP error you describe looks as one of the errors we already know. But this shouldn't make whole thing stop working.

Can you please try again. Switch to latest dev branch, press "Ctrl + F5" in Webbrowser and check your LotW thing again.

Thx :)

GregTroar commented 1 year ago

Let me check now and revert with Ctrl + F5

GregTroar commented 1 year ago

Ctrl + F5 does not work. I cleared the cache completely Closed chrome and re opened. Same I just cannot access cloudlog anymore with https://log.xxxx.com/index.php

GregTroar commented 1 year ago

ok so in fact it is just the dashboard giving the error above. If I do https://log.xxx.com/index.php/user it works

And I confirm now with the dropdown for lotw import it works as expected, it is not related to station location at all as we can just select the proper call for which we want to import lotw confirmation.

Thanks

HB9HIL commented 1 year ago

Confirm you working on Windows (On Mac it would be Cmd + Shift + R)

Why you can't access Cloudlog anymore when changing just the branch? What do you see? Any Error Messages in Browser Tool (F12)?

HB9HIL commented 1 year ago

ok so in fact it is just the dashboard giving the error above. If I do https://log.xxx.com/index.php/user it works

And I confirm now with the dropdown for lotw import it works as expected, it is not related to station location at all as we can just select the proper call for which we want to import lotw confirmation.

Thanks

  1. Are you in Dev Mode?
  2. Is the Dashboard functional with this Error at the Top, or is it inaccessible? Can you provide a Screenshot for that?
GregTroar commented 1 year ago

I am on Windows 11 with Chrome last version.

I am in Dev mode Dashboard does not appear at all, only the error

cloudlog

Internal Error 500

Nothing suspicious in error log of nginx nor in access log

Using php8.3

GregTroar commented 1 year ago

I have found this in error log

[error] 3123973#3123973: *703772 open() "/var/www/html/cloudlog/assets/js/bundle.js.map" failed (2: No such file or directory), client: 10.10.100.2, server:

[error] 3123973#3123973: *703798 open() "/var/www/html/cloudlog/assets/css/default/bootstrap.min.css.map" failed (2: No such file or directory)

HB9HIL commented 1 year ago

Ok hold on. I'm digging into this. Could be related to PHP 8.3 since this is pretty new and we did not test 8.3 yet

GregTroar commented 1 year ago

Do not bother it is not this I tried 8.2 and 8.0 and 7.4 Same thing error 500

HB9HIL commented 1 year ago

And you are sure your dev is the latest version? Because I thought we fix this error.

@AndreasK79 Could you take a look? This is the one you fixed recently.

AndreasK79 commented 1 year ago

@GregTroar could you try to edit application/models/vucc.php and move line 380 $confirmedGridArray = array(); up to line 378?

GregTroar commented 1 year ago

image

image

GregTroar commented 1 year ago

@GregTroar could you try to edit application/models/vucc.php and move line 380 $confirmedGridArray = array(); up to line 378?

Yep this works. My dashboard is back !!!!!!

AndreasK79 commented 1 year ago

@GregTroar thanks for confirming. I have pushed the same fix to dev, so undo the changes and pull dev, and you should be all set :)

GregTroar commented 1 year ago

ok will do Now have to solve another issue :) And also the Winkeyer does not work still, hope it will be solved soon Thanks for your help you provided I close this one now

phl0 commented 1 year ago

Let us know your issues so we can solve them (Make a new issue on github though).

GregTroar commented 1 year ago

Ok I pulled the new commit and now my menu does nothing, when I click on any menu the url have a # at the end anothing happens (no sub menu opens)

phl0 commented 1 year ago

Press CTRL + F5 ;-)

GregTroar commented 1 year ago

Hahahahaha Ok I have to remember this and to do this at first before coming here :) It worked Thanks

phl0 commented 1 year ago

Never mind. Pitfalls for all of us. It has become a running gag among devs already :)