-
Notifications
You must be signed in to change notification settings - Fork 49
Description
About the bug
The Notebooks page includes an autosave feature which saves the notebook on any edit. The ui says "autosaved"
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 does fail 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.
- Launch influxd with a rw sqlite db like (note the
rwc)
./influxd --sqlite-path "file:/path/to/.influxdbv2/influxd.sqlite?mode=rwc"
- create a notebook and see that it is saved
- shutdown influxd and ...
- 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"
- navigate to notebooks page, and make an edit
- 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".
About your environment
Environment info:
OSS 2.7.x

