Community discussions

MikroTik App
 
gpetrom
just joined
Topic Author
Posts: 19
Joined: Sat May 14, 2011 11:07 am

Api version response empty  [SOLVED]

Fri Mar 14, 2025 12:32 pm

Hi

From version 18.1 and up when i make an api call "system/package/" with librouteros version returns an empty string.
Before 18.1 it returned
[True, {'.id': '*9', 'name': 'user-manager', 'version': '7.9', 'scheduled': '', 'size': '376977', 'available': 'True', 'disabled': 'True'}]

After the upgrade it returns
[True, {'.id': '*9', 'name': 'user-manager', 'version': '', 'scheduled': '', 'size': '376977', 'available': 'True', 'disabled': 'True'}]


Thanks in advanced
Last edited by chechito on Sun Mar 16, 2025 5:20 pm, edited 1 time in total.
Reason: fixed typo in title
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 13034
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Api vesrion response empty

Sun Mar 16, 2025 3:33 pm

So what would be the point of this topic?
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 3286
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: Api version response empty

Sun Mar 16, 2025 5:23 pm

i think you must try on latest beta version, if it still happen post this on official beta version topic

viewtopic.php?t=215181
 
wrkq
Member Candidate
Member Candidate
Posts: 103
Joined: Mon Jul 29, 2019 10:59 pm

Re: Api vesrion response empty

Sun Mar 16, 2025 6:24 pm

So what would be the point of this topic?
It's not very clear, but I think they're hitting the caveat I believe you yourself pointed out before - they're basically running a "print" then checking the first item returned in the reply, but don't include the filter for "routeros" package, so get an arbitrary package's data as the "first item".
And now result looks different, I guess as a side effect of the new feature of listing also packages available for download.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4777
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Api version response empty

Mon Mar 17, 2025 8:15 am

You may be right that it's related to recent changes. And I bet API would return version if you did a check-for-update request beforehand.

But if the user-manager package was installed, the version is in the NPK... so it should be populated in all cases.
 
gpetrom
just joined
Topic Author
Posts: 19
Joined: Sat May 14, 2011 11:07 am

Re: Api version response empty

Mon Mar 17, 2025 5:03 pm

Hi

Thanks for the replies

Problem does not exist in mikrotik installed on a vm
[
    True,
    {
        '.id': '*4',
        'name': 'routeros',
        'version': '7.18.2',
        'build-time': '2025-03-11 11:59:04',
        'scheduled': '',
        'size': '19223361',
        'available': 'False',
        'disabled': 'False'
    }
]
It exists on CRS125-24G-1S-2HnD updated in 7.18.2
[True, {'.id': '*9', 'name': 'user-manager', 'version': '', 'scheduled': '', 'size': '376977', 'available': 'True', 'disabled': 'True'}]
Router RB951Ui-2HnD
The problem does not exist
[True, {'.id': '*1', 'name': 'routeros', 'version': '7.12.1', 'build-time': '2023-11-17 11:38:45', 'scheduled': '', 'disabled': 'False'}]
After upgrading 7.18.2
[True, {'.id': '*9', 'name': 'user-manager', 'version': '', 'scheduled': '', 'size': '376977', 'available': 'True', 'disabled': 'True'}]
Router RBwAPGR-5HacD2HnD
[True, {'.id': '*10', 'name': 'zerotier', 'version': '', 'scheduled': '', 'size': '790673', 'available': 'True', 'disabled': 'True'}]
After upgrading to 7.19beta5 same thing happens
[True, {'.id': '*10', 'name': 'zerotier', 'version': '', 'scheduled': '', 'size': '786577', 'available': 'True', 'disabled': 'True'}]
The problem is that it does not returns all the packages and it returns only the last one.
That is also disabled after upgrading from 7.12.1 and i have no way to remove it from packages also.
In the disabled packages the version is empty.
Last edited by gpetrom on Mon Mar 17, 2025 5:37 pm, edited 1 time in total.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4777
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

Re: Api version response empty

Mon Mar 17, 2025 5:35 pm

So it seems to be a problem when it is hardware
The "routeros" package may be treated differently the extra-packages (which is the part that changed)... so CHR show a version in all versions is not surprising. What MAY be a minor issue is that if user-manager NPK is installed, hardware or virtual, the version= should be populated based on the FILE, from the new code that gets the list of available packages as part of a check-for-update.

Now for uninstalled packages, version= being blank does not seem unreasonable. But the package is installed, it should read the version from extra-package NPK file, and version= should NOT be blank for any INSTALLED package. Or at least that the way I look at this.
 
gpetrom
just joined
Topic Author
Posts: 19
Joined: Sat May 14, 2011 11:07 am

Re: Api version response empty

Mon Mar 17, 2025 5:40 pm

So it seems to be a problem when it is hardware
The "routeros" package may be treated differently the extra-packages (which is the part that changed)... so CHR show a version in all versions is not surprising. What MAY be a minor issue is that if user-manager NPK is installed, hardware or virtual, the version= should be populated based on the FILE, from the new code that gets the list of available packages as part of a check-for-update.

Now for uninstalled packages, version= being blank does not seem unreasonable. But the package is installed, it should read the version from extra-package NPK file, and version= should NOT be blank for any INSTALLED package. Or at least that the way I look at this.
You are right. The solution is to return all packages and also to be able to remove disabled packages

Sorry eventually the problem was with my script.
It works as expected.
I was getting only the last record and after update from 7.12 the last record version was blank because it is disabled