ioBroker.admin icon indicating copy to clipboard operation
ioBroker.admin copied to clipboard

[bug]: Upgrade Fails

Open EvilEls opened this issue 1 year ago • 7 comments

No existing issues.

  • [X] There is no existing issue for my problem.

Describe the bug

When trying to upgrade the adapter via the adapters page, a Networkerror occurs and I have to login to console and restart the admin adapter.

TypeError: NetworkError when attempting to fetch resource.

There is nothing in the logs.

The upgrade of admin worked reliably before but started to fail end of last year. Not sure with what version. I didn't care because upgrade still worked from info adapter.

To Reproduce

Go to Adapters page. Click the button with the new version for admin adapter. A few sec later the modal with the error appears.

Expected behavior

admin adapter upgrades as other adapters.

Screenshots & Logfiles

image

admin.0 | 2024-02-20 15:50:46.342 | info | ==> Connected system.user.admin from 192.168.0.20
admin.0 | 2024-02-20 15:50:35.308 | info | Repository received successfully.
admin.0 | 2024-02-20 15:50:28.885 | info | Use link "https://127.0.0.1:8081" to configure.
admin.0 | 2024-02-20 15:50:28.884 | info | https server listening on port 8081
admin.0 | 2024-02-20 15:50:28.875 | info | Secure socket.io server listening on port 8081
admin.0 | 2024-02-20 15:50:28.572 | info | Request actual repository...
admin.0 | 2024-02-20 15:50:28.233 | info | received all objects
admin.0 | 2024-02-20 15:50:26.711 | info | requesting all objects
admin.0 | 2024-02-20 15:50:26.607 | info | starting. Version 6.13.21 in /opt/iobroker/node_modules/iobroker.admin, node: v18.17.1, js-controller: 5.0.19

Adapter version

6.13.21

js-controller version

5.0.19

Node version

v18.17.1

Operating system

Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-171-generic x86_64)

Additional context

No response

EvilEls avatar Feb 20 '24 15:02 EvilEls

The question is, is the upgrade really failing or just the communication to the upgrader service is broken down. Because of course admin cannot run while updating itself. But if it starts again and has new version then everything fine for now.

foxriver76 avatar Feb 20 '24 15:02 foxriver76

The adapter did not upgrade and did not restart. After restart from terminal showed that the upgrade from web failed.

Retried today with 6.14.0 -> 6.14.1

  • init upgrade from web
  • got same NetworkError - BUT after a couple of sec the err msg changed to SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data that error did not occur yesterday. image

Maybe worth mentioning, yesterday the blue spinner did not go away. I assume it is because the adapter did not restart.

Checking the adapter logs after the error:

2024-02-21 13:49:12.725  - info: admin.0 (122786) terminating
2024-02-21 13:49:28.692  - info: admin.0 (158162) starting. Version 6.14.0 in /opt/iobroker/node_modules/iobroker.admin, node: v18.17.1, js-controller: 5.0.19
2024-02-21 13:49:28.803  - info: admin.0 (158162) requesting all objects
2024-02-21 13:49:30.568  - info: admin.0 (158162) received all objects
2024-02-21 13:49:30.865  - info: admin.0 (158162) Request actual repository...
2024-02-21 13:49:31.276  - info: admin.0 (158162) Secure socket.io server listening on port 8081
2024-02-21 13:49:31.287  - info: admin.0 (158162) https server listening on port 8081
2024-02-21 13:49:31.287  - info: admin.0 (158162) Use link "https://127.0.0.1:8081" to configure.
2024-02-21 13:49:33.151  - info: admin.0 (158162) ==> Connected system.user.admin from 192.168.0.20
2024-02-21 13:49:36.271  - info: admin.0 (158162) Repository received successfully.

So, this time the adapter came back (yesterday it did not) but the upgrade failed.

upgrade via terminal works

$ iob upgrade admin

This upgrade of "admin" will introduce the following changes:
==========================================================================
-> 6.14.1:
align items better when adapters tab is used in row mode
==========================================================================

Would you like to upgrade admin from @6.14.0 to @6.14.1 now? [(y)es, (n)o]: y
Update admin from @6.14.0 to @6.14.1
host.strausbox Adapter "system.adapter.admin.0" is stopped.
NPM version: 9.6.7
Installing [email protected]... (System call)
...
2024-02-21 13:59:49.311  - info: admin.0 (158162) Got terminate signal TERMINATE_YOURSELF
2024-02-21 13:59:49.314  - info: admin.0 (158162) terminating https server on port 8081
2024-02-21 13:59:49.316  - info: admin.0 (158162) terminating
2024-02-21 13:59:49.317  - info: admin.0 (158162) Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
2024-02-21 13:59:49.819  - info: admin.0 (158162) terminating
2024-02-21 14:00:00.655  - info: admin.0 (159180) starting. Version 6.14.1 in /opt/iobroker/node_modules/iobroker.admin, node: v18.17.1, js-controller: 5.0.19
2024-02-21 14:00:00.784  - info: admin.0 (159180) requesting all objects
2024-02-21 14:00:02.475  - info: admin.0 (159180) received all objects
2024-02-21 14:00:02.746  - info: admin.0 (159180) Request actual repository...
2024-02-21 14:00:03.096  - info: admin.0 (159180) Secure socket.io server listening on port 8081
2024-02-21 14:00:03.108  - info: admin.0 (159180) https server listening on port 8081
2024-02-21 14:00:03.108  - info: admin.0 (159180) Use link "https://127.0.0.1:8081" to configure.
2024-02-21 14:00:06.559  - info: admin.0 (159180) Repository received successfully.

EvilEls avatar Feb 21 '24 13:02 EvilEls

Just for Info Update admin 6.13.16 to 6.14.1 worked just now using webinterface without issues

mcm1957 avatar Feb 21 '24 15:02 mcm1957

In the near future we will have some additional console logging, because without it is hard to say if ip is correct and what the response actually was. https://github.com/ioBroker/ioBroker.admin/pull/2386

foxriver76 avatar Mar 01 '24 08:03 foxriver76

From Firefox using IP:

image

And similar in Edge/Chrome using hostname:

image

EvilEls avatar Mar 01 '24 16:03 EvilEls

It is okay that there are some conn refused, but after some time the server should be started and there should come an answer. But not sure which answer comes there because it does not seem to be the expected json. As soon as we have a new version with the changes a test would be helpful as we also log content then

foxriver76 avatar Mar 01 '24 17:03 foxriver76

From the controller there should also be log like Server is running on http://localhost:xy

foxriver76 avatar Mar 01 '24 17:03 foxriver76