Community discussions

MikroTik App
 
exitium
just joined
Topic Author
Posts: 6
Joined: Fri Nov 20, 2020 9:39 pm

Terminal hangs on firmware update file-not-found

Tue May 30, 2023 6:57 pm

Hi all,

I'm using external app which queries Mikrotik API from time to time, one of the commands that API executes is:
/system/package/update> /system/package/update check-for-updates
Due to my spotty internet sometimes this command is executed when my connection is down and sometimes I get message
ERROR: no internet connection
and command exits as normal, but sometimes I get a message
ERROR: file not found
and here terminal just hangs.

When I try to replicate same behavior in WinBox's terminal I can replicate the problem, here's a screenshot:
2023-05-30-175233.png
Command never exits, it just hangs indefinitely.

This is version where I noticed a bug
       routerboard: yes
             model: RB450Gx4
     firmware-type: ipq4000
  factory-firmware: 6.47.10
  current-firmware: 7.9.1
  upgrade-firmware: 7.9.1
Please let me know if there are some additional info you need, thanks.

EDIT: I've just realized this can be workaround with duration=xy which will not let command execute indefinitely. But still, I doubt this is an expected behavior.
EDIT2: Okay found out the cause for file-not-found, WAN router redirects all http to itself when internet is down so RouterOS received 404 in that moment.
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11968
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 10:30 pm

The title is wrong:
Terminal hangs on firmware update file-not-found
On my wrong configured device the terminal hangs on firmware update with message file-not-found
 
exitium
just joined
Topic Author
Posts: 6
Joined: Fri Nov 20, 2020 9:39 pm

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 10:39 pm

The title is wrong:
Terminal hangs on firmware update file-not-found
On my wrong configured device the terminal hangs on firmware update with message file-not-found
No it's not, command throws an error but it never returns, afaik that is not expected behaviour.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11968
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 10:40 pm

The title is wrong:
Terminal hangs on firmware update file-not-found
On my wrong configured device the terminal hangs on firmware update with message file-not-found
No it's not, command throws an error but it never returns, afaik that is not expected behaviour.
The unexpected behavior is to configure the router to look for the mikrotik site within itself...
As written elsewhere, by others, RouterOS cannot prevent your mistakes.
Last edited by rextended on Tue May 30, 2023 11:02 pm, edited 1 time in total.
 
exitium
just joined
Topic Author
Posts: 6
Joined: Fri Nov 20, 2020 9:39 pm

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 10:54 pm



No it's not, command throws an error but it never returns, afaik that is not expected behaviour.
The unexpected behavior is to configure the router to look for the mikrotik site within itself...
As written elsewhere, by others, RouterOS cannot prevent your mistakes.
Okay, I'm going to assume that I didn't explain the problem thoroughly, and you are not just trolling me. So, I'm going to explain it again slowly.

My ISP-provided LTE router is providing access to the internet. When there is some kind of network drop (e.g., automatic 4G change to 3G), the LTE router redirects HTTP traffic to itself. As a result, computers accessing the internet receive its config web page. I don't know why it does that, and I can't configure it because it's a built-in behavior.

When the internet is down and RouterOS tries to check for updates, it doesn't reach Mikrotik's page. Instead, the LTE router "hijacks" the request and returns a 404 error. At that moment, the "check-for-updates" command throws a "file-not-found" error, which is okay. However, the command doesn't return and stays hanging indefinitely.

I'm not reporting trouble with accessing the file. I'm reporting an issue with the terminal command that doesn't return and remains hanging indefinitely. The reason why the "file-not-found" error is thrown is not important. There is a bug with the command itself, which handles the request correctly, fails, throws an error, and doesn't return correctly.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11968
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 10:56 pm

Well, with proper explanations things are clearer, of course...

However, as it says in the terminal, the prompt IS NOT LOCKED, it's just waiting...

I suggest you to check if the internet is available before do any upgrade,
like call one external page that for sure work if internet is present...
 
holvoetn
Forum Guru
Forum Guru
Posts: 5326
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 11:04 pm

Sounds like complaining the car is not driving when gas tank is empty ...
 
exitium
just joined
Topic Author
Posts: 6
Joined: Fri Nov 20, 2020 9:39 pm

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 11:36 pm

Well, with proper explanations things are clearer, of course...

However, as it says in the terminal, the prompt IS NOT LOCKED, it's just waiting...

I suggest you to check if the internet is available before do any upgrade,
like call one external page that for sure work if internet is present...
That is a workaround, I can and I did workaround it, still, it doesn't change the fact that the command is not behaving as it should be, that's why I reported it.

Well, I should've been smarter and just reported it to Mikrotik's support email, this forum is full of pretentious smartasses. Bye and thanks for nothing.
 
holvoetn
Forum Guru
Forum Guru
Posts: 5326
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Terminal hangs on firmware update file-not-found

Tue May 30, 2023 11:42 pm

And you think they will respond differently ?
If your internet connection is not working, what do you expect an update command should do in the first place ?

As explained already, that command is NOT hanging. It WAITS for YOU to tell it how it should continue.
Q for Quit
D for Dump
C-z for pause

That's normal terminal behavior of ROS when a command can not fit all info on the available screen.

Who is online

Users browsing this forum: baragoon, GoogleOther [Bot], JDF, keithy, menyarito and 73 guests