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

Type Error & unhandled promise rejection error when navigating dashboards in cloud2 #4677

Closed
philjb opened this issue May 25, 2022 · 9 comments · Fixed by #4847
Closed

Type Error & unhandled promise rejection error when navigating dashboards in cloud2 #4677

philjb opened this issue May 25, 2022 · 9 comments · Fixed by #4847
Assignees
Labels
kind/bug Something isn't working team/automation Engineering / Automation Team team/ui

Comments

@philjb
Copy link
Contributor

philjb commented May 25, 2022

About the bug

While editing a dashboard, I received the "an error has occurred. please report here" message so I am reporting it here.

The error seemed to be persistent as I navigated around (see the gifs) but I'm not sure how to reproduce it.

In the zip archive are two text files showing the console errors. Here's the top of them.

==> error1 <==
[Error] TypeError: Type error
decode
D — flux-lsp-browser_bg.js:342
__wbindgen_json_parse — bootstrap:69
wasm-stub
<?>.wasm-function[4200]
<?>.wasm-function[1895]
wasm-stub
C — flux-lsp-browser_bg.js:225
s — astim.ts:22

==> error2 <==
[Error] Unhandled Promise Rejection: SyntaxError: JSON Parse error: Unrecognized token ''
        parse (30.f5990f947f.js:2:1779771)
        D (30.f5990f947f.js:2:1779771)
        __wbindgen_json_parse (c0375f819e.js:1:544)
        wasm-stub
        <?>.wasm-function[4200]
        <?>.wasm-function[1895]
        wasm-stub
        C (30.f5990f947f.js:2:1779085)
        s (31.9bc96f602e.js:1:642599)

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

Unknown

Expected behavior:
Use cloud2 without errors.

Actual behavior:
Page crashed and reported than an error has occurred.

Visual Proof:

ui error
Screen Shot 2022-05-25 at 12 02 16 PM
Archive.zip

About your environment

Environment info:
cloud2

Config:

na

Logs:

see archive above for console log
Performance:
na

@philjb philjb added kind/bug Something isn't working team/ui labels May 25, 2022
@philjb philjb changed the title Error when navigating dashboards in cloud2 Type Error & unhandled promise rejection error when navigating dashboards in cloud2 May 25, 2022
@philjb
Copy link
Contributor Author

philjb commented May 27, 2022

I got two type errors when just scrolling down my dashboard

==> type error <==
[Error] Unhandled Promise Rejection: TypeError: Type error
        decode (30.19444cc24f.js:2:1779773)
        D (30.19444cc24f.js:2:1779773)
        __wbindgen_json_parse (fc7b1f118e.js:1:544)
        wasm-stub
        <?>.wasm-function[4200]
        <?>.wasm-function[1895]
        wasm-stub
        C (30.19444cc24f.js:2:1779085)
        s (31.5d780fd62b.js:1:643541)

==> type error2 <==
[Error] TypeError: Type error
decode
D — flux-lsp-browser_bg.js:342
__wbindgen_json_parse — bootstrap:69
wasm-stub
<?>.wasm-function[4200]
<?>.wasm-function[1895]
wasm-stub
1895
C — flux-lsp-browser_bg.js:225

Archive.zip

@philjb
Copy link
Contributor Author

philjb commented May 27, 2022

@rockstar - this might be a lsp issue based on the referenced file? flux-lsp-browser_bg.js:342

@kristinarobinson kristinarobinson added the team/automation Engineering / Automation Team label May 27, 2022
@abalone23
Copy link

abalone23 commented Jun 3, 2022

I just got this error as well. Console shows:

Unhandled Promise Rejection: Error: Model is disposed!

Screen Shot 2022-06-03 at 3 05 31 PM

Complete console log:
console_mon.log

@rockstar
Copy link
Contributor

rockstar commented Jun 8, 2022

Just a spitball here, but @wiedld recently changed the way the ui communicates with the lsp, and I'm willing to bet it's blindly calling JSON.parse on whatever is returned from the lsp. However, in some cases, e.g. textDocument/didOpen, there is no response body, so it's essentially doing JSON.parse('') and blowing up. We had this issue in the ui when we went to using lspower because the previous protocol implementation was incorrectly sending a valid json body in response.

@wiedld
Copy link
Contributor

wiedld commented Jun 8, 2022

blindly calling JSON.parse on whatever is returned from the lsp.

All responses from the LSP are wrapped in error handling, on the JSON.parse(). It only transmits a response back to the monaco-editor if the response can be parsed.

@wiedld
Copy link
Contributor

wiedld commented Jun 8, 2022

Recreated the likely error in the use cases shown by @philjb , and have a solution in progress. However, those use cases did not use the raw flux script editor. Therefore the stacktrace shown by @abalone23 does not apply.

Could you please give me a rundown @abalone23 of exactly the path you took to hit that console error? Thanks!

@abalone23
Copy link

@wiedld I was probably writing Flux in Data Explorer Script Editor.

@wiedld
Copy link
Contributor

wiedld commented Jun 8, 2022

One fix merged.
Changing status back to "in progress", and will consider Adam2's use case next week.

@wiedld
Copy link
Contributor

wiedld commented Jun 18, 2022

Reviewed again the error @abalone23 found. Could not recreate; could only hypothetically see how it may occur.
Added error logging/metrics to measure frequency and [hopefully] isolate cause of this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working team/automation Engineering / Automation Team team/ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants