logseq / logseq/db-test

DB graph download fails when custom sync server is only reachable through configured proxy

Open
#1,080 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
28
Forks
2
PR merge metrics
No merged PRs in 30d

Description

### Search first

- [x] I searched and no similar issues were found

### What Happened?

In the Logseq 2.0 , graph download does not respect the Network Proxy configured in Settings > Advanced > Network Proxy.

My self-hosted DB Sync server is http://xxx:8787. On this Windows machine, the server cannot be reached directly, but it is reachable through a local HTTP proxy at 127.0.0.1:10808.

After configuring that HTTP proxy in Logseq, I can log in, configure the custom sync server, and see the remote graph. However, clicking graph name for the remote graph always fails.

The DB worker log shows that the download worker is attempting a direct TCP connection to xxx:8787 instead of using the configured HTTP proxy:

TypeError: fetch failed
Connect Timeout Error (attempted address: xxx:8787, timeout: 10000ms)

This occurs at the DB Sync download stage :fetch-pull.

### Reproduce the Bug

1. Use Logseq Desktop 2.0.1 on a network where a self-hosted DB Sync server is not directly reachable, but is reachable through a HTTP proxy.
2. Configure a HTTP proxy in Settings > Advanced > Network Proxy, for example 127.0.0.1:10808.
3. Log in to Logseq.
4. Set the custom sync server URL to http://xxx:8787.
5. Open the remote graph list and select a graph.
6. Click Download.
7. Observe that the download fails after about 10 seconds with `fetch failed` / `Connect Timeout Error (attempted address: xxx:8787, timeout: 10000ms)`.

Control checks on the same machine:
- Direct TCP/HTTP access to xxx:8787 times out.
- Access through the HTTP proxy succeeds and returns HTTP 404 for the server root path, which confirms that the proxy can reach the server.

### Expected Behavior

All DB Sync network operations, including remote graph download and the initial pull request, should use the Network Proxy configured in Logseq.

### Screenshots

_No response_

### Desktop or Mobile Platform Information

Windows 11 Pro, version 10.0.26200, x64
Logseq Desktop 2.0.1
Self-hosted DB Sync server

### Additional Context

currently I set HTTP_PROXY env before start logseq to give sync worker proxy.

### Are you willing to submit a PR? If you know how to fix the bug.

- [ ] I'm willing to submit a PR (Thank you!)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the DB Sync download worker at the :fetch-pull stage and compare its network handling with the configured Settings > Advanced > Network Proxy. Reproduce the failure using a custom sync server reachable only through the HTTP proxy. Done means remote graph downloads and the initial pull request use the configured proxy without requiring HTTP_PROXY.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.