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

OpenMCT should tell you it cannot connect to its persistence store #4888

Closed
scottbell opened this issue Feb 23, 2022 · 9 comments · Fixed by #5276
Closed

OpenMCT should tell you it cannot connect to its persistence store #4888

scottbell opened this issue Feb 23, 2022 · 9 comments · Fixed by #5276

Comments

@scottbell
Copy link
Contributor

Is your feature request related to a problem? Please describe.
If OpenMCT cannot connect to its persistence store (e.g., CouchDB), there's no notification to the user aside from some exciting errors in the console. The stored objects in CouchDB don't appear, and the first error a user will get is if they try to save something and the dialog hangs.

Describe the solution you'd like
We should alert the user that the configured persistence store is unreachable.

Describe alternatives you've considered
If they have more than one persistence store, perhaps one being down is acceptable? In that case, I think an operator would still like to know that one of them is unavailable.

Additional context
The error message if CouchDB is down:

CouchObjectProvider.js?9318:132          GET http://localhost:5984/openmct/mine net::ERR_CONNECTION_REFUSED

The frozen save dialog:
Screen Shot 2022-02-23 at 12 36 07 PM

@scottbell
Copy link
Contributor Author

An easy implementation would be to just notice on page load if the persistence store is down and pop up a notification. A nicer implementation would be to heartbeat the persistence store, and notify when connection is lost or restored.

@akhenry
Copy link
Contributor

akhenry commented May 25, 2022

Let's definitely implement this for Couch. We can use the SimpleIndicator. There is actually a generic URLIndicator which you could potentially use as a guide for this.

For Couch, since we hold a persistent connection open for updates, could we just use the status of that connection as a proxy for Couch availability?

@akhenry akhenry assigned ozyx and unassigned charlesh88 May 25, 2022
@scottbell
Copy link
Contributor Author

scottbell commented May 25, 2022

Using the server side event feed is a good idea @akhenry! This will be helpful when the connection drops while you're looking at the page (i.e., post page load):
https://github.com/nasa/openmct/blob/master/src/plugins/persistence/couch/CouchChangesFeed.js#L46
On page load, it looks like the first error happens here:
https://github.com/nasa/openmct/blob/master/src/plugins/persistence/couch/CouchObjectProvider.js#L132
which should be changed to a async/await try/catch and give the same notification to the user.

Note to get OpenMCT to use CouchDB (so you can implement this ticket), follow the README here:
https://github.com/nasa/openmct/blob/master/src/plugins/persistence/couch/README.md

@ozyx ozyx mentioned this issue Jun 1, 2022
15 tasks
@ozyx
Copy link
Contributor

ozyx commented Jun 3, 2022

Testing

Case 1

  • Launch OpenMCT with CouchDB plugin installed and CouchDB running
  • Notice that CouchDB indicator is present and green
  • End CouchDB process by ctrl-C
  • Notice that CouchDB indicator is yellow
  • Start CouchDB process again
  • Notice that CouchDB indicator is green

Case 2

  • Launch OpenMCT with CouchDB plugin installed and without CouchDB running
  • Notice that CouchDB indicator is present and red
  • Start CouchDB
  • Trigger some request to the object API (clicking 'CREATE')
  • Notice that CouchDB indicator is green again

Case 3

  • Launch OpenMCT with CouchDB plugin installed and running (but configured for a database that doesn't exist)
  • Notice that CouchDB indicator is present and green
  • Notice that console errors are present and descriptive ("Database doesn't exist")

@shefalijoshi
Copy link
Contributor

Case 1 above fails - after ending the couchdb process indicator does not turn yellow.

@unlikelyzero
Copy link
Collaborator

@ozyx to take a look

@ozyx
Copy link
Contributor

ozyx commented Jun 27, 2022

Case 1 above fails - after ending the couchdb process indicator does not turn yellow.

I was not able to reproduce this issue locally on release/2.0.5 on Chrome 102 and CouchDB 3.2.2.

@ozyx
Copy link
Contributor

ozyx commented Jun 28, 2022

Found some scenarios where the indicator will show 'connected' erroneously: #5406

@shefalijoshi
Copy link
Contributor

Verified this as a feature - there is a bug outstanding which will be addressed separately.

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.

6 participants