FreePBX / issue-tracker

The unified FreePBX issue tracker.
https://www.freepbx.org
GNU General Public License v3.0
12 stars 1 forks source link

[bug]: Updates not showing up for certain modules #416

Closed Massi-X closed 3 weeks ago

Massi-X commented 2 months ago

FreePBX Version

FreePBX 16

Issue Description

Hi to all, I'm the author of this pull request and still today no updates to the "calendar" module is available on my test and real systems. I decided to dig deeper and finally find out this:

  1. When checking for updates FreePBX access https://mirror.freepbx.org/all-16.0.xml
  2. If you access it normally you can see that "calendar" module in the standard repo is at version 16.0.32
  3. If you send a POST request (like FreePBX does - those are the only important values) and indicate
    phpver = 7.4.16
    distrover = 12.7.8-2306-1.sng7

    the response will now contain calendar version 16.0.21

So the question is why this? There is no special dependencies in module.xml and if I set module admin to edge I can easily install 16.0.33!

I think something is going wrong 😅

Operating Environment

FreePBX 16.0.40.7, Asterisk 18 (not relevant), calendar 16.0.21

Relevant log output

No response

kguptasangoma commented 2 months ago

cat /etc/sangoma/pbx-brand output please as that also played an role in selecting the version from the mirror server.

kguptasangoma commented 2 months ago

16.0.32 is currently in stable release so are you saying for your freepbx system you are not seeing this version?

Massi-X commented 2 months ago

Exactly, on two systems the same problem, I will post the output tonight, anyway as said above everything happens because the POST request contains the two fields above that makes the mirror server return version 16.0.21 instead of .32

Massi-X commented 2 months ago

cat /etc/sangoma/pbx-brand output please as that also played an role in selecting the version from the mirror server.

The return value is 'FreePBXDistro' which I see also in the POST request, but that isn't the offending one.

To see the problem you can use Postman and set:

  1. POST type with URL https://mirror.freepbx.org/all-16.0.xml
  2. Inside 'body' set both 'phpver' -> '7.4.16' and 'distrover" -> '12.7.8-2306-1.sng7'

This is a problem with the mirror server and sadly I cannot help you much without the code, but I noticed also that you can set any 'phpver' (in the format 1.0, 2.0, 5.2...) and nothing changes, the important thing is that the value is included in the body of the request. The same for 'distrover', you can reduce and change it to something completely invalid like '14.8.8-5000' but as long as both values are there and the format is right, the mirror server will return the incorrect version (.21) of calendar.

And this could happen with other modules too, I only didn't test it.

Massi-X commented 1 month ago

Any updates? I think the issue originated here https://community.freepbx.org/t/calendar-module-update-16-0-28/94279/4

Massi-X commented 1 month ago

Hi @kguptasangoma sorry but did you manage to have a look into that? Yesterday I forced an update to the calendar module to 16.0.33 by switching to the edge repo but the issue still remains. If I try to search for updates it still shows the latest version being 16.0.21 (in the standard repo).

So in short, edge works fine, standard still broken.

kguptasangoma commented 1 month ago

Hey @Massi-X sorry i was OOO , will add this to my list to check asap.

kguptasangoma commented 1 month ago

Hi @Massi-X please give a try again.

thanks

Massi-X commented 1 month ago

Will do later today!

Massi-X commented 1 month ago

Hi @kguptasangoma nope, sadly it is still not working.

I further debugged the issue and found out that:

curl --location 'https://mirror.freepbx.org/all-16.0.xml' \
--form 'phpver="7.4.16"' \
--form 'distrover="12.7.8-2306-1.sng7"'

This is the original request coming from the PBX server, and returns the version .21 (wrong)


curl --location 'https://mirror.freepbx.org/all-16.0.xml' \
--form 'phpver="8.1"' \
--form 'distrover="12.7.8-2306-1.sng7"'

This request contains a modified php version but it doesn't matter at all (you can set 1.0, 999.0...), and returns the version .21 (wrong)


curl --location 'https://mirror.freepbx.org/all-16.0.xml' \
--form 'phpver="1.0"' \
--form 'distrover="12.7.8.sng7"'

This request removes the dash from distrover (notice how the php version is totally wrong), and correctly returns the version .32

Seems like the server has some issue with -, the things I can't understand is why in the world does it return the old version?

kguptasangoma commented 1 month ago

Just now tried below command and i can see 16.0.30 is coming back as stable version, see below screenshot.

https://mirror.freepbx.org/all-16.0.xml?phpver=7.4.14&distrover=12.7.8-2012-1.sng7

image

Massi-X commented 1 month ago

Hi @kguptasangoma the module affected is not certman but calendar! (Which indeed returns .21 with the url provided)

I didn't check if other modules have the same problem

kguptasangoma commented 1 month ago

sorry @Massi-X somehow i got confused with calendar vs certman.

i will check calendar module.

Massi-X commented 3 weeks ago

@kguptasangoma Don't know what you did but noticed today that the update is showing up, so I'm closing this issue!