(Bug report) Always error connecting to sync server after wrong DNS configuration once #880

Open
opened 2025-10-01 15:55:53 -05:00 by giteasync · 4 comments
Owner

Originally created by @renyuneyun on GitHub.

TriliumNext Version

0.90.4

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

Archlinux

Description

I have my own sync server, and set up syncing in my Trilium desktop app. It all worked great, until I made a mistake in DNS set up.
In short, the problematic set up was: Infinite redirect loop using status code 301. (It was due to an incorrect configuration of cloudflare by myself.)
The resulting behaviour is: trilium always fails to connect to sync server; on "sync" configuration page, clicking "test sync" will lead to an immediate popup saying "... too many redirects".

I can bypass the issue with commandline switch --disable-http-cache, and trilium will resort to sync. However, I have to enable this switch everytime when starting trilium, otherwise the problem re-occurs.

This has been an issue since original Trilium. It looks like clearing the DNS cache would resolve the issue, but I cannot find a way to do this. Hopefully this can be added as a button in "advanced" options page.

Error logs

No response

Originally created by @renyuneyun on GitHub. ### TriliumNext Version 0.90.4 ### What operating system are you using? Other Linux ### What is your setup? Local + server sync ### Operating System Version Archlinux ### Description I have my own sync server, and set up syncing in my Trilium desktop app. It all worked great, until I made a mistake in DNS set up. In short, the problematic set up was: Infinite redirect loop using status code 301. (It was due to an incorrect configuration of cloudflare by myself.) The resulting behaviour is: trilium always fails to connect to sync server; on "sync" configuration page, clicking "test sync" will lead to an immediate popup saying "... too many redirects". I can bypass the issue with commandline switch `--disable-http-cache`, and trilium will resort to sync. However, I have to enable this switch ***everytime*** when starting trilium, otherwise the problem re-occurs. This has been an issue since original Trilium. It looks like clearing the DNS cache would resolve the issue, but I cannot find a way to do this. Hopefully this can be added as a button in "advanced" options page. ### Error logs _No response_
giteasync added the
sync
label 2025-10-01 15:55:53 -05:00
Author
Owner

@renyuneyun commented on GitHub:

Hi @SiriusXT , Thanks for the quick reply.
It seems to work, by only deleting ~/.config/TriliumNext Notes/Cache/. The upper-case name made this directory invisible in my previous search (it's lower-case in other places, e.g. ~/.local/share/trilium-data/).

But this not only happens for Linux desktop, but also on MacOS. The same directory does not exist on that location, and I don't have a clue on how to guess.

In fact, it is exactly because the issue happens on all platforms (well, I only have Linux and MacOS, but no reason it's different on Windows or elsewhere) that I raised this as a bug report.

@renyuneyun commented on GitHub: Hi @SiriusXT , Thanks for the quick reply. It seems to work, by only deleting `~/.config/TriliumNext Notes/Cache/`. The upper-case name made this directory invisible in my previous search (it's lower-case in other places, e.g. `~/.local/share/trilium-data/`). But this not only happens for Linux desktop, but also on MacOS. The same directory does not exist on that location, and I don't have a clue on how to guess. In fact, it is exactly because the issue happens on all platforms (well, I only have Linux and MacOS, but no reason it's different on Windows or elsewhere) that I raised this as a bug report.
Author
Owner

@dosubot[bot] commented on GitHub:

To clear the Electron/Chromium cache for TriliumNext and resolve persistent sync redirect issues, you need to manually delete the Cache directory for your platform:

  • Linux: ~/.config/TriliumNext Notes/Cache/ (note the upper-case and space in the directory name)
  • MacOS: ~/Library/Application Support/TriliumNext Notes/Cache
  • Windows: C:\Users\<username>\AppData\Roaming\TriliumNext Notes\Cache

These locations are managed by Electron's Chromium engine, and clearing them removes cached HTTP responses that can cause issues like infinite redirect loops after a DNS or server config error. There is currently no built-in UI option in TriliumNext to clear this cache—you must delete the directory manually on each platform. For a quick cache bypass without deleting files, you can open Developer Tools (Ctrl+Shift+I), go to the Network tab, check "Bypass cache", and refresh with Ctrl+R to force a reload of all resources.
More details here

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub: <!-- Answer --> To clear the Electron/Chromium cache for TriliumNext and resolve persistent sync redirect issues, you need to manually delete the Cache directory for your platform: - Linux: `~/.config/TriliumNext Notes/Cache/` (note the upper-case and space in the directory name) - MacOS: `~/Library/Application Support/TriliumNext Notes/Cache` - Windows: `C:\Users\<username>\AppData\Roaming\TriliumNext Notes\Cache` These locations are managed by Electron's Chromium engine, and clearing them removes cached HTTP responses that can cause issues like infinite redirect loops after a DNS or server config error. There is currently no built-in UI option in TriliumNext to clear this cache—you must delete the directory manually on each platform. For a quick cache bypass without deleting files, you can open Developer Tools (Ctrl+Shift+I), go to the Network tab, check "Bypass cache", and refresh with Ctrl+R to force a reload of all resources. [More details here](https://github.com/TriliumNext/Trilium/issues/5251) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/cd5e4ee8-f228-4daa-9a42-1c9b626353d8?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/4af773a7-9840-4978-96dc-c436f6f437cf/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/TriliumNext/Trilium/issues/5251)
Author
Owner

@SiriusXT commented on GitHub:

I'm not sure, but clearing the Electron cache might solve the problem.
path: ~/.config/<app_name>

@SiriusXT commented on GitHub: I'm not sure, but clearing the Electron cache might solve the problem. path: `~/.config/<app_name>`
Author
Owner

@SiriusXT commented on GitHub:

Mac: ~/Library/Application Support/<app_name>/Cache
Windows: C:\Users<username>\AppData\Roaming<app_name>\Cache
This location is managed by electron's Chromium engine.

@SiriusXT commented on GitHub: Mac: ~/Library/Application Support/<app_name>/Cache Windows: C:\Users\<username>\AppData\Roaming\<app_name>\Cache This location is managed by electron's Chromium engine.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TriliumNext/Trilium#880
No description provided.