Community discussions

MikroTik App
 
wispwitch
just joined
Topic Author
Posts: 1
Joined: Tue Jan 23, 2024 4:11 pm

Firmware upgrade script not working w/ 7.11.2

Tue Jan 23, 2024 4:33 pm

All of our routers (models RB960PGS and CRS318-16P-2S+) are stuck on version 7.11.2. When we go to router board it shows that the current firmware is 7.11.2 and the upgrade firmware to 7.12. In the resources tab it shows "version" 7.12 (stable). So, it's downloading the firmware but not able to complete the update. We've never had an issue with our script running the updates until this version that the routers are stuck on. We also noticed we're getting weird error messages under the logs tab that we never got before. We can manually update the routers with no issues. We've tried manually updating some routers to 7.12 to see if the script will run and update them 7.13.2, but we see the same results. Anyone else have this issue or a similar issue?
You do not have the required permissions to view the files attached to this post.
Last edited by wispwitch on Tue Jan 23, 2024 4:50 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Firmware upgrade script not working w/ 7.11.2

Tue Jan 23, 2024 4:40 pm

We've never had an issue with our script running the updates until this version that the routers are stuck on.
It is impossible to evaluate what you do not display.
But from what we read in the screenshot of the logs,
if they are generated by the script, I assume it is poorly done.

We also noticed we're getting weird error messages under the logs tab that we never got before.
I recommend reading and understanding the changelog of the version you are installing,
and the intermediate ones compared to the one you come from,
several times before installing any version, because this change in log verbosity was already present.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Firmware upgrade script not working w/ 7.11.2

Tue Jan 23, 2024 5:11 pm

Why first post is deleted?
 
Xenhat
just joined
Posts: 8
Joined: Fri Dec 30, 2016 9:41 pm

Re: Firmware upgrade script not working w/ 7.11.2

Wed Mar 27, 2024 9:34 pm

I also use a script to automatically update my router (and multiple APs using Capsman), and it recently stopped working, returning a "403" error code.

This is the script I use:
{
    :local pkgs ("routeros");
    :local archs {"arm64"; "arm"};
    # Example: https://cdn.mikrotik.com/routeros/7.14.2/routeros-7.14.2-arm.npk
    :local mode "https"
    :local downloaddomain "cdn.mikrotik.com"
    
    :log info "Refreshing CAP packages files..."
    # do NOT include the leading slash, or file check will always fail
    :local upgradedir "firmware"
    /system/package/update check-for-updates once
    :delay 3s;
    :local curVer [/system/package/update/get installed-version]
    :local newVer [/system/package/update/get latest-version]

    :foreach pkg in=$pkgs do={
        :foreach arch in=$archs do={
            :local oldPkgName   "$pkg-$curVer-$arch.npk"
            :local newPkgName   "$pkg-$newVer-$arch.npk"
            :log debug "Current package name: $oldPkgName"
            :log debug "New package name:     $newPkgName"
            :local exists [:len [/file/find name="$upgradedir/$newPkgName"]]
            :if ($exists = 0) do={
                :local path  [ :put "/routeros/$newVer/$newPkgName" ]
                :log info " => Downloading package v$newVer for $arch from $mode://$downloaddomain$path"
                /tool fetch http-method=get address="$downloaddomain" mode=$mode src-path="$path" dst-path="$upgradedir/$newPkgName"
               :if ($oldPkgName != $newPkgName) do {
                   /file/remove "$upgradedir/$pkg-$curVer-$arch.npk"
               }
            }
        }
    }
}
it has worked perfectly until recently with no change, but now it does this:
Screenshot_20240327_153210.png
Is there something to do about this?

For completion, here's a wget output:
 wget  https://cdn.mikrotik.com/routeros/7.14.2/routeros-7.14.2-arm64.npk
--2024-03-27 15:36:37--  https://cdn.mikrotik.com/routeros/7.14.2/routeros-7.14.2-arm64.npk
Resolving cdn.mikrotik.com (cdn.mikrotik.com)... 159.148.147.244
Connecting to cdn.mikrotik.com (cdn.mikrotik.com)|159.148.147.244|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12212134 (12M) [application/octet-stream]
Saving to: ‘routeros-7.14.2-arm64.npk’

routeros-7.14.2-arm64.npk    100%[==============================================>]  11.65M  8.36MB/s    in 1.4s    

2024-03-27 15:36:40 (8.36 MB/s) - ‘routeros-7.14.2-arm64.npk’ saved [12212134/12212134]
and a static /tool/fetch call:
[xenhat@router] > /tool fetch http-method=get address=cdn.mikrotik.com mode=https src-path=/routeros/7.14.2/routeros-7.14.2-arm64.npk
  status: failed

failure: Fetch failed with status 403
You do not have the required permissions to view the files attached to this post.
 
alekseu
just joined
Posts: 1
Joined: Wed Apr 03, 2024 11:33 pm

Re: Firmware upgrade script not working w/ 7.11.2

Wed Apr 03, 2024 11:48 pm

I found out that if you remove "once" then it start to work again
/system/package/update check-for-updates once
replace with
/system/package/update check-for-updates
install

RBD53iG-5HacD2HnD is affected as well, so I believe this is RouterOS issue, not hardware related
Last edited by alekseu on Wed Apr 03, 2024 11:51 pm, edited 1 time in total.

Who is online

Users browsing this forum: Jotne and 9 guests