Marco98 / routeros-upgrader

Mass-Upgrade Mikrotik RouterOS devices synchronized
MIT License
2 stars 1 forks source link

For RouterOS 6.48.4 I get "fatal error: Process exited with status 1" #1

Closed issrec closed 1 month ago

issrec commented 1 month ago

I have such an old device/system: MikroTik RouterOS 6.48.4.

A session with routeros-upgrader looks like this:

$ ./routeros-upgrader
2024/07/19 13:11:08 the target version is: 7.15.2
2024/07/19 13:11:08 checking installed packages
2024/07/19 13:11:08 fatal error: Process exited with status 1

Looking at the code we have this (routeros-upgrader/pkg/rosapi/rosapi.go:25):

...
out, err := sess.Output("/system/package/print terse")
...

Trying to repeat this in the console results in an error:

[admin@mikrotik] > /system/package/print terse
expected command name (line 1 column 8)

But this works (only the first slash):

[admin@mikrotik] > /system package print terse  
 0   name=routeros-powerpc version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled=""
 1   name=system version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 2 X name=ipv6 version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 3   name=wireless version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 4   name=hotspot version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 5   name=mpls version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 6   name=routing version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 7   name=ppp version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 8   name=dhcp version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
 9   name=security version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
10   name=advanced-tools version=6.48.4 build-time=aug/18/2021 06:43:27 scheduled="" bundle=routeros-powerpc
Marco98 commented 1 month ago

Hi @issrec, i initially did not build this tool with RouterOS v6 in mind, but if you need this compatibility i'm more than happy to help. I'll setup a test environment tomorrow - expect a patch this weekend.

Does the default target-version matter to you (can be overwritten with -tgt)? Currently it will always use latest ROS v7 version, but in your use case this probably wont work.

issrec commented 1 month ago

Hi @Marco98, thanks for fast reaction. Unfortunately, the proposed approach did not provide a solution:

$ ./routeros-upgrader -tgt 6.49.15
2024/07/19 15:22:09 the target version is: 6.49.15
2024/07/19 15:22:09 checking installed packages
2024/07/19 15:22:09 fatal error: Process exited with status 1
Marco98 commented 1 month ago

@issrec sorry for the misunderstanding - that was a question on how it should be implemented. I've now implemented it, so that it will stay on the latest minor version per default, which should be a mostly sane default imo.

Please try this prerelease if you have the time. It should™ work as you probably would expect.

issrec commented 1 month ago

Hi, thank you for the new release. I started updating the device as standard, so I already had the packages updated. Regardless, the firmware could be updated using routeros-upgrader.

$ ./routeros-upgrader
2024/07/22 08:18:02 checking installed packages
|OK> MikroTik: routeros-7.15.2-powerpc
|OK> MikroTik: wireless-7.15.2-powerpc
|UP> MikroTik: fw 3.24 => fw 7.15.2
Install? [y/N]: y
2024/07/22 08:18:12 MikroTik: upgraded firmware
Execute synchronized reboot? [y/N]: y
2024/07/22 08:18:14 MikroTik: rebooting in 10s

I thank you for your support. Problem solved.

PS. By the way, I have some enhancement suggestions for routeros-upgrader, but for clarity I will register it as a separate issue ;) - #3.