joplin icon indicating copy to clipboard operation
joplin copied to clipboard

Sync fails but displays "Completed" when getaddrinfo results in ENOTFOUND

Open hmhackmaster opened this issue 2 years ago • 50 comments

Environment

Joplin version: 2.6.10 (prod, win32) Platform: Windows OS specifics: Windows 11

Steps to reproduce

  1. Add a sync target (in my case, Nextcloud via WebDAV) and perform initial syncs
  2. 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"
  3. 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
  4. Add a new note, perform a manual sync
  5. 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."

hmhackmaster avatar Feb 17 '22 19:02 hmhackmaster

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.

laurent22 avatar Feb 17 '22 19:02 laurent22

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.

hmhackmaster avatar Feb 17 '22 20:02 hmhackmaster

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.

Perkolator avatar Mar 17 '22 14:03 Perkolator

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.

github-actions[bot] avatar Apr 16 '22 16:04 github-actions[bot]

Leave it open.

Perkolator avatar Apr 16 '22 16:04 Perkolator

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.

github-actions[bot] avatar May 17 '22 16:05 github-actions[bot]

Open sesame.

Perkolator avatar May 18 '22 06:05 Perkolator

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.

github-actions[bot] avatar Jun 18 '22 16:06 github-actions[bot]

open

Perkolator avatar Jun 18 '22 19:06 Perkolator

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.

antontkv avatar Jun 24 '22 03:06 antontkv

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.

github-actions[bot] avatar Jul 24 '22 16:07 github-actions[bot]

open

Perkolator avatar Jul 26 '22 09:07 Perkolator

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.

github-actions[bot] avatar Aug 26 '22 16:08 github-actions[bot]

öppen

Perkolator avatar Aug 27 '22 11:08 Perkolator

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.

github-actions[bot] avatar Sep 26 '22 16:09 github-actions[bot]

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.

Perkolator avatar Sep 27 '22 12:09 Perkolator

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.

github-actions[bot] avatar Oct 28 '22 16:10 github-actions[bot]

.

Perkolator avatar Oct 28 '22 22:10 Perkolator

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.

jackrsteiner avatar Nov 22 '22 20:11 jackrsteiner

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.

github-actions[bot] avatar Dec 23 '22 16:12 github-actions[bot]

go away ridiculous bot

Perkolator avatar Dec 23 '22 16:12 Perkolator

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.

github-actions[bot] avatar Jan 24 '23 16:01 github-actions[bot]

...

Perkolator avatar Jan 24 '23 16:01 Perkolator

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.

github-actions[bot] avatar Feb 25 '23 16:02 github-actions[bot]

...

Perkolator avatar Feb 25 '23 21:02 Perkolator

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.

github-actions[bot] avatar Mar 28 '23 16:03 github-actions[bot]

.

Perkolator avatar Mar 28 '23 19:03 Perkolator

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.

github-actions[bot] avatar Apr 29 '23 16:04 github-actions[bot]

.

Perkolator avatar Apr 29 '23 16:04 Perkolator

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.

github-actions[bot] avatar May 31 '23 16:05 github-actions[bot]