home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
4.13k stars 2.81k forks source link

`unknown_error` when retrieving backups #21450

Closed tetele closed 1 month ago

tetele commented 4 months ago

Checklist

Describe the issue you are experiencing

I have been careless with pruning and a large number of daily backups have accumulated on my network storage (200+ backups, totaling ~46GB). When I access https://my.home-assistant.io/redirect/supervisor_snapshots/ apart from the fact that I get an incorrect message stating there are no backups, the list never gets populated and I find an error in the console

hassio-backups.ts:83 Uncaught (in promise) 
{code: 'unknown_error', message: ''}

Describe the behavior you expected

Leaving aside a potential loading animation, telling me that the backups are not available yet, I'd like to eventually see my 200 backups so that I can delete the ones which are not used.

Steps to reproduce the issue

  1. Go to https://my.home-assistant.io/redirect/supervisor_snapshots/
  2. Wait
  3. The error appears

What version of Home Assistant Core has the issue?

2024.7.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 126.0.6478.127

Which operating system are you using to run this browser?

MS Win 11

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

hassio-backups.ts:83 Uncaught (in promise) {code: 'unknown_error', message: ''}
value @ hassio-backups.ts:83
await in value (async)
value @ hassio-backups.ts:114
_$AE @ reactive-element.ts:1378
performUpdate @ reactive-element.ts:1345
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
u @ reactive-element.ts:948
x @ reactive-element.ts:931
E @ lit-element.ts:115
a @ hassio-backups.ts:53
finisher @ custom-element.ts:41
runClassFinishers @ decorate.js:237
s @ decorate.js:15
(anonymous) @ hassio-backups.ts:53
await in (anonymous) (async)
d.a @ async module:49
2853 @ 2853-wDB_JUGS5mI.js:1
d @ bootstrap:19
Promise.then (async)
load @ hassio-panel-router.ts:34
value @ hass-router-page.ts:152
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
u @ reactive-element.ts:948
x @ reactive-element.ts:931
o @ hass-router-page.ts:48
F @ hassio-panel-router.ts:12
u @ lit-html.ts:1124
g @ lit-html.ts:1535
_$AI @ lit-html.ts:1379
G @ lit-html.ts:2175
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
set @ reactive-element.ts:726
value @ hassio-router.ts:76
value @ hass-router-page.ts:91
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
set @ reactive-element.ts:726
j @ lit-html.ts:1875
_$AI @ lit-html.ts:1817
v @ lit-html.ts:1187
g @ lit-html.ts:1532
_$AI @ lit-html.ts:1379
G @ lit-html.ts:2175
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
set @ reactive-element.ts:726
value @ supervisor-base-element.ts:102
(anonymous) @ supervisor-base-element.ts:142
i @ store.js:19
(anonymous) @ collection.js:25
Promise.then (async)
c @ collection.js:25
p @ collection.js:27
(anonymous) @ collection.js:52
subscribe @ collection.js:96
value @ supervisor-base-element.ts:140
(anonymous) @ supervisor-base-element.ts:175
value @ supervisor-base-element.ts:159
value @ supervisor-base-element.ts:84
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
u @ reactive-element.ts:948
x @ reactive-element.ts:931
E @ lit-element.ts:115
(anonymous) @ provide-hass-lit-mixin.ts:11
(anonymous) @ url-sync-mixin.ts:29
i @ supervisor-base-element.ts:42
i @ hassio-main.ts:17
finisher @ custom-element.ts:41
runClassFinishers @ decorate.js:237
s @ decorate.js:15
(anonymous) @ hassio-main.ts:17
(anonymous) @ entrypoint.ts:29
Show 10 more frames

Additional information

No response

karwosts commented 4 months ago

You can try quering the backups API directly from your browser console, see what kind of responses you get. Seems like maybe one or more of these commands is returning "unknown_error" from the supervisor.

Should return nothing (I think)

document.getElementsByTagName("home-assistant")[0].hass.callWS({type: "supervisor/api", endpoint: "/backups/reload", method: "post"}) 

Should return a list of backups

document.getElementsByTagName("home-assistant")[0].hass.callWS({type: "supervisor/api", endpoint: "/backups", method: "get"}) 
tetele commented 4 months ago

document.getElementsByTagName("home-assistant")[0].hass.callWS({type: "supervisor/api", endpoint: "/backups/reload", method: "post"})

Promise {<pending>}[[Prototype]]: Promise[[PromiseState]]: "pending"[[PromiseResult]]: undefined
connection.js:45 Uncaught (in promise) {code: 'unknown_error', message: ''}
(anonymous) @ connection.js:45
_handleMessage @ connection.js:15
Show 2 more frames
Show less

document.getElementsByTagName("home-assistant")[0].hass.callWS({type: "supervisor/api", endpoint: "/backups", method: "get"})

Promise {<pending>}[[Prototype]]: Promise[[PromiseState]]: "fulfilled"[[PromiseResult]]: Objectbackups: (215) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, …][[Prototype]]: Object

Does that help?

karwosts commented 4 months ago

It doesn't help me personally, but it tells me that an error is coming from the supervisor, not from the frontend. So I would suggest to try posting your question on that github instead.

For some reason the reload backups operation returns unknown_error, they would have to track that down.

karwosts commented 4 months ago

Seems like maybe a common issue:

https://github.com/home-assistant/supervisor/issues/4357

tetele commented 4 months ago

Cool, thanks for the help!

karwosts commented 4 months ago

Given that it seems like only the reload operation fails, but we're still able to successfully fetch a (maybe incomplete?) list of backups, it does seem like maybe the frontend could do something more helpful than just crap out and show nothing (maybe it can display the list of known backups and a warning bar or something), but I don't have a supervisor development setup to test anything :\

github-actions[bot] commented 1 month ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.