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

[notebooks]: if the autosave api returns an error, the ui still shows that the notebook saved, when it didn't #6999

Open
philjb opened this issue Jan 27, 2025 · 0 comments · May be fixed by #7009
Assignees
Labels
kind/bug Something isn't working team/ui

Comments

@philjb
Copy link
Contributor

philjb commented Jan 27, 2025

About the bug

The Notebooks page includes an autosave feature which saves the notebook on any edit. The ui says "autosaved"

Image

The ui for an edit makes a request to PATCH /api/v2private/notebooks/0e56555f4d866000 HTTP/1.1 for example (0e56555f4d866000 is the notebook id) with the updated notebook as the patch data.

Like any request, this request can fail. If it doesn't the UI doesn't indicate it, so it looks like the notebook was saved when it wasn't.

For example, notebooks are saved to the sqlite database. If sqlite is configured to be read only, the api will return a response like

{
	"code": "internal error",
	"message": "attempt to write a readonly database"
}

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

  1. Launch influxd with a rw sqlite db like (note the rwc)
./influxd --sqlite-path "file:/path/to/.influxdbv2/influxd.sqlite?mode=rwc"
  1. create a notebook and see that it is saved
  2. shutdown influxd and ...
  3. re-launch influxd with a read only sqlite db file by using this config option (note the ro)
./influxd --sqlite-path "file:/path/to/.influxdbv2/influxd.sqlite?mode=ro"
  1. navigate to notebooks page, and make an edit
  2. See that the ui doesn't reflect the error but you can see the error in the browser console network logs

Expected behavior:

Errors are shown in toaster popups

Actual behavior:
No error is shown and it looks like a notebook was saved when it wasn't.

Visual Proof:

Requested Behavior

Show a pop error similar to this one that says "Could not autosave notebook: " - the actual error will likely be "attempt to write a readonly database".

Image

About your environment

Environment info:

OSS 2.7.x

@philjb philjb added kind/bug Something isn't working team/ui labels Jan 27, 2025
@NguyenHoangSon96 NguyenHoangSon96 linked a pull request Feb 14, 2025 that will close this issue
5 tasks
@NguyenHoangSon96 NguyenHoangSon96 linked a pull request Feb 14, 2025 that will close this issue
5 tasks
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/ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants