Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archived Workflows - Failed to execute 'setItem' on 'Storage' #9656

Closed
1 of 3 tasks
ltartarini opened this issue Sep 22, 2022 · 12 comments · Fixed by #9846
Closed
1 of 3 tasks

Archived Workflows - Failed to execute 'setItem' on 'Storage' #9656

ltartarini opened this issue Sep 22, 2022 · 12 comments · Fixed by #9846

Comments

@ltartarini
Copy link

ltartarini commented Sep 22, 2022

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what you expected to happen?

When opening the tab "Archived Workflows" in the web UI I got the following error:

Failed to execute 'setItem' on 'Storage': Setting the value of 'ArchiveListOptions/options' exceeded the quota.

Screenshot 2022-09-21 at 16 59 32

In particular, I am using a Postgres storage backend to archive the workflows and I already tried to increase resources for both workflow-controller and argo-server.

Any idea?

Version

v3.3.5

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

Cannot view any workflow in the UI.
@sarabala1979
Copy link
Member

@ltartarini Thanks for fixing this bug. Please submit the PR. We are happy to review.

@tooptoop4
Copy link
Contributor

tooptoop4 commented Sep 26, 2022

@sarabala1979 i don't think anyone fixed.
i am getting same issue on v3.3.9
stack trace:

react-dom.production.min.js:198 DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of 'ArchiveListOptions/options' exceeded the quota.
    at e.setItem (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:30:1302229)
    at t.saveHistory (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:577:704485)
    at oa (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:72729)
    at ra (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:72479)
    at Ha (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:82493)
    at Va (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:84967)
    at https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:98147
    at t.unstable_runWithPriority (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:555:3194)
    at Ts (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:98082)
    at Os (https://redactmyhost/main.7aa35a5a4bfeac381af7.js:546:97858)
fa @ react-dom.production.min.js:198
Ma.i.componentDidCatch.n.callback @ react-dom.production.min.js:211
oa @ react-dom.production.min.js:193
ra @ react-dom.production.min.js:193
Ha @ react-dom.production.min.js:216
Va @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Ts @ react-dom.production.min.js:250
Os @ react-dom.production.min.js:249
Es @ react-dom.production.min.js:248
xs @ react-dom.production.min.js:245
$a @ react-dom.production.min.js:243
enqueueSetState @ react-dom.production.min.js:130
w.setState @ react.production.min.js:13
(anonymous) @ archived-workflow-list.tsx:194
Promise.then (async)
t.fetchArchivedWorkflows @ archived-workflow-list.tsx:193
t.changeFilters @ archived-workflow-list.tsx:142
onChange @ archived-workflow-list.tsx:99
onChange @ archived-workflow-filters.tsx:144
(anonymous) @ react-datepicker.min.js:1
(anonymous) @ react-datepicker.min.js:1
(anonymous) @ react-datepicker.min.js:1
(anonymous) @ react-datepicker.min.js:1
(anonymous) @ react-datepicker.min.js:1
(anonymous) @ react-datepicker.min.js:1
(anonymous) @ react-dom.production.min.js:14
f @ react-dom.production.min.js:15
(anonymous) @ react-dom.production.min.js:15
k @ react-dom.production.min.js:17
E @ react-dom.production.min.js:18
L @ react-dom.production.min.js:18
T @ react-dom.production.min.js:21
xn @ react-dom.production.min.js:84
Ns @ react-dom.production.min.js:250
Ie @ react-dom.production.min.js:39
En @ react-dom.production.min.js:86
(anonymous) @ react-dom.production.min.js:251
t.unstable_runWithPriority @ scheduler.production.min.js:18
js @ react-dom.production.min.js:251
Cn @ react-dom.production.min.js:85

i wonder if its related to too many workflows which fill up the browser storage? i have over 35k in that month range

below is the javascript:

var r=this.scope+"/"+e,o=JSON.stringify(t);JSON.stringify(n)!==o?localStorage.setItem(r,o):localStorage.removeItem(r)

image

i guess it is not paginating by doing a new request to server every 500 rows but instead storing ALL workflows for the month in the browser in one go

#9570 maybe related

any idea @terrytangyuan ?

@alexec
Copy link
Contributor

alexec commented Sep 29, 2022

The bug is on this line of code:

It should not save state to local storage.

@alexec alexec added the type/security Security related label Sep 30, 2022
@alexec alexec added good first issue Good for newcomers help wanted and removed type/security Security related labels Oct 10, 2022
@athityakumar
Copy link
Contributor

@alexec - Is the scope of the solution for this issue about not saving the state at all for archived workflows into the browser's local storage, or to store the state to the browser's local storage with a pagination/max limit?

@alexec
Copy link
Contributor

alexec commented Oct 15, 2022

The code is saving more into the state that is needed. The line needs to be changed to something like

this.storage.setItem('options', {this.state.pagination}, {});

@athityakumar
Copy link
Contributor

Just to confirm: Basically all the state variables (this.state.*) - except the this.state.workflows; can be stored to the browser in this line right?

@alexec
Copy link
Contributor

alexec commented Oct 15, 2022

That is correct.

@athityakumar
Copy link
Contributor

Awesome. Can I work on the patch for this as part of Hacktoberfest, if no one is already working on it?

@athityakumar
Copy link
Contributor

Opened a PR here: #9846

@juliev0
Copy link
Contributor

juliev0 commented Oct 27, 2022

@alexec Regarding @athityakumar 's question above: this PR does not save workflows to local storage at all (as opposed to paginating them). Do you feel that's okay?

@stale
Copy link

stale bot commented Nov 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

@stale stale bot added the problem/stale This has not had a response in some time label Nov 12, 2022
@drpebcak
Copy link

Not stale

@stale stale bot removed the problem/stale This has not had a response in some time label Nov 12, 2022
alexec pushed a commit that referenced this issue Nov 28, 2022
Signed-off-by: Athitya Kumar <athityakumar@gmail.com>
Co-authored-by: Saravanan Balasubramanian <33908564+sarabala1979@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants