joplin
joplin copied to clipboard
Sync fails but displays "Completed" when getaddrinfo results in ENOTFOUND
Environment
Joplin version: 2.6.10 (prod, win32) Platform: Windows OS specifics: Windows 11
Steps to reproduce
- Add a sync target (in my case, Nextcloud via WebDAV) and perform initial syncs
- At some point, make Joplin (or the whole OS) unable to resolve the WebDAV server's FQDN
- An "nslookup" of the server's FQDN in the OS would return "DNS request timed out"
- The following things will occur:
- The sync status text above the Synchronize button will display "Completed: DATE TIME (20s)"
- The Synchronization Status page will not show any errors
- Add a new note, perform a manual sync
- The sync will silently continue to fail:
- No errors will be displayed in the UI that the sync does not complete
- On the Synchronization Status page, the "synced items" and "total items" will begin to differ
- The Synchronization Status page's Debug Report will show no new entries since the last successful sync (including no new Note IDs for any of the new notes)
- The
log.txt
file will reveal the actual error, reproduced below
There may be other scenarios beyond the ENOTFOUND result reproduced below that would result in a false-Completed message displayed, this is only what happened in my particular scenario
Once the DNS lookup failure is resolved (for example, by adding an entry into the Operating System's HOSTS file) the next sync works correctly and all note changes are correctly synced.
Describe what you expected to happen
A transient fault (like the server's FQDN not resolving as experienced here) should result in some sort of indication that the sync did not complete, which would allow the user to debug further or at least know that the user should not expect the data to be synced to other devices yet.
I would expect the UI to indicate that the sync failed and to hopefully reveal some additional error information, such as the "reason" output from the Synchronizer task's FetchError.
Logfile
2022-02-17 13:20:54: "Preparing scheduled sync"
2022-02-17 13:20:54: "Starting scheduled sync"
2022-02-17 13:20:54: Synchronizer: "Sync: starting: Starting synchronisation to target 5... supportsAccurateTimestamp = false; supportsMultiPut = false [1645122054694]"
2022-02-17 13:20:54: Synchronizer: "Indexing resources..."
2022-02-17 13:20:54: "ResourceService::indexNoteResources: Start"
2022-02-17 13:20:54: "ResourceService::indexNoteResources: Completed"
2022-02-17 13:21:01: "SearchEngine: Updating FTS table..."
2022-02-17 13:21:01: "SearchEngine: Updated FTS table in 29ms. Inserted: 1. Deleted: 0"
2022-02-17 13:21:22: Synchronizer: "FetchError: request to https://totallyrealfqdn.test/remote.php/dav/files/mpotts/Joplin/info.json failed, reason: getaddrinfo ENOTFOUND totallyrealfqdn.test
Code: ENOTFOUND
FetchError: request to https://totallyrealfqdn.test/remote.php/dav/files/mpotts/Joplin/info.json failed, reason: getaddrinfo ENOTFOUND totallyrealfqdn.test
at ClientRequest.<anonymous> (C:\Users\mpotts\AppData\Local\Programs\Joplin\resources\app.asar\node_modules\@joplin\lib\node_modules\node-fetch\index.js:133:11)
at ClientRequest.emit (events.js:376:20)
at TLSSocket.socketErrorListener (_http_client.js:475:9)
at TLSSocket.emit (events.js:376:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21)"
2022-02-17 13:21:22: Synchronizer: "Sync: finished: Synchronisation finished [1645122054694]"
2022-02-17 13:21:22: Synchronizer: "Operations completed: "
2022-02-17 13:21:22: Synchronizer: "Total folders: 25"
2022-02-17 13:21:22: Synchronizer: "Total notes: 129"
2022-02-17 13:21:22: Synchronizer: "Total resources: 31"
2022-02-17 13:21:23: "DecryptionWorker: cannot start because no master key is currently loaded."
Normally if the sync configuration check passed, this ENOTFOUND error is temporary so that's why it's not reported. There are other errors like ECONNRESET or ETIMEDOUT which are not reported because we don't want to flood the user with temporary errors (which are solved on next sync). I can appreciate in some cases like yours it might have been nice to show the error but getting the right balance is tricky.
I totally understand not displaying a popup or other intrusive notification that there is a temporary error but I do feel that the status text could at least not indicate that the sync was successful. In my scenario, I spent quite a few minutes troubleshooting when a small change to a note made on one computer didn't appear on another and, had I not specifically checked for the small change, the result would have been, in my case, an incomplete set of commands that would have been a bad time.
While I would uniquely appreciate the value of knowing that the server is temporarily not responding (since I run the server), I think a user knowing that any sync target failed would at least let the user know that they are currently in the somewhat dangerous void of not everything is synced and to have the foreknowledge that they should not expect the updates to appear on other devices for the time being.
If the goal is to hide any temporary errors, perhaps it's better to just hide the "Sync: Completed" text entirely (so it's not like the app is just lying to the user) and only show an error if the user manually selects "Synchronize" ? Otherwise I would propose just replacing the "Completed" text with something like "Temporary sync error" in a warning-style yellow (potentially with a mouseover that contains more details); This would seem to me to be non-intrusive enough to not bother a user yet keep the user's expectations on the status of their data accurate.
While testing other thing, I disconnected from internet before running Joplin and I noticed that the sync message incorrectly said completed even though I could see the ENOTFOUND error in the console. And even when I manually clicked the sync button.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Leave it open.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
Open sesame.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
open
Showing users that there is a sync error, even temporary, is the right thing to do. User should know that there is a problem with saving. Right now it misleading, and showing "Completed" without any indication of an error is just lying to the user.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
open
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
öppen
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
This close-bot stuff is ridiculous. Review an issue and assign it to some label that is exempt from auto-closing bot, or close the issue yourself with "wontfix" explanation. This current auto-close system is totally bs, I really don't understand what the point of this is.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
.
I'm confirming that the current behavior, reporting the sync completed successfully even when my internet was down, was a bit confusing. Instead, I would expect that if Joplin cannot connect to the synchronize server, it would notify the user of that. This from my experience using the desktop app on Ubuntu.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
go away ridiculous bot
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
...
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
...
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.