siyuan-note/siyuan · error

sync upload did not complete

Error message

sync upload did not complete

What it means

SyncDataUpload is the mirror of SyncDataDownload for upload-side sync. Its return error is pre-seeded with 'sync upload did not complete' and only cleared when the upload sync actually runs to completion. Receiving this message means the function returned before a full upload sync finished (early checkSync exit or a recovered panic).

Solutions

  1. Verify sync is enabled and configured before calling SyncDataUpload
  2. Wait for any in-flight sync to finish and retry (checkSync enforces single concurrent sync)
  3. Inspect kernel logs for recovered panics to identify why the upload aborted
Defensive patterns

Strategy: retry

Validate before calling

// check sync enabled state before invoking
if (!conf.sync.enabled) return;

Try / catch

err := model.SyncDataUpload()
if err != nil && strings.Contains(err.Error(), "sync upload did not complete") {
    // inspect logs for panic, confirm no sync in flight, retry
}

Prevention

When it happens

Trigger: checkSync(false,false,true) fails (sync not enabled, sync already locked/in progress) causing early return; panic recovered by logging.Recover; any internal early return without clearing err.

Common situations: Triggering upload sync while sync is disabled; concurrent sync attempt blocked by the sync lock; kernel crash/panic mid-upload leaving the sentinel error.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/d817226923af0273. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/sync.go:142

}

func completeCurrentSyncRemoteRequest(scope string) {
	// 完整同步可能在合并本地变更后生成新的最新索引,同时记录实际结果可覆盖两类通知到达顺序相反的情况。
	repo, err := newRepository()
	if nil != err {
		logging.LogWarnf("create repo after remote sync failed: %s", err)
		return
	}
	latest, err := repo.Latest()
	if nil != err {
		logging.LogWarnf("get local latest after remote sync failed: %s", err)
		return
	}
	syncRemoteRequests.complete(scope, latest.ID)
}

func SyncDataUpload() (err error) {
	err = errors.New("sync upload did not complete")
	defer logging.Recover()

	if !checkSync(false, false, true) {
		return
	}

	unlock, ok := lockSyncRequest(&syncUploadRequests)
	if !ok {
		return
	}
	defer unlock()
	util.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil)

	now := util.CurrentTimeMillis()
	Conf.Sync.Synced = now

	err = syncRepoUploadWithDNSRetry()
	code := 1

View on GitHub (pinned to 9f775e8a12)