Skip to content

Receive-only directories do not compare content when hashing #10928

Closed

Description

@intelfx

What happened?

Consider a scenario:

  • host A has a send-only folder X, whose contents are canonical;
  • host B has a damaged copy of folder X, whose contents we need to resynchronize against A. All files in this folder are present with correct metadata, but contents are randomly damaged. This folder is set to receive-only;
  • I drop the database of X on B to force a rescan with rehash.

Expected behavior:

  • all files on B with mismatching content are flagged as "local changes";
  • I click on "override local changes" in Web UI;
  • all mismatching files are pulled from A.

Actual behavior:

  • No changes are reported on B.

Probable cause:

This seems to be a regression from adce6fa ("all: Support syncing ownership", #8434, v1.21.0).

Before that commit the call was gf.IsEquivalentOptional(fi, b.f.modTimeWindow, false, false, protocol.FlagLocalReceiveOnly), where the fourth argument (ignoreBlocks) is false. When the call was converted to FileInfoComparison, it became IgnoreBlocks: true. The invocation was later moved into reconcileReceiveOnlyToGlobal (d7df27a, #10843) unchanged.

Syncthing version

v2.1.5

Platform & operating system

Linux amd64

Browser version

N/A

Relevant log output

$ for h in enclave stratofortress; do
  echo "\n\n=== $h"
  ssh operator@$h.tailbefcf.ts.net '
    set -x
    syncthing cli show connections | jq -c ".connections | to_entries[] | select(.value.connected) | {k:.key, a:.value.address, c:.value.clientVersion}"
    syncthing cli debug file rb3gf-w3ggb linux/os/arch/archlinux-2026.09.01-x86_64.iso | jq "del(.global.blocks, .local.blocks) | walk(if type==\"object\" then del(.blocks) else . end)"
  '
done


=== enclave
+zsh:3> syncthing cli show connections
+zsh:3> jq -c '.connections | to_entries[] | select(.value.connected) | {k:.key, a:.value.address, c:.value.clientVersion}'
{"k":"2LOFO6E-ZZUM7VU-23FLNXI-UEDVYZ6-O6AQ3MV-XMDGL4T-5NKWIIF-FYI7KAQ","a":"[2a0b:4880::aaa1:59ff:fe58:1f99]:28384","c":"v2.1.5"}
{"k":"A233MP6-MJQ5WUR-63JATVQ-KTAMXAS-GVZNPBZ-2UFPE7J-GF4LRR7-5Q57MQ6","a":"[2a01:7e01::f03c:91ff:fe23:77fb]:28384","c":"v2.1.6"}
{"k":"ADLMVLH-FH23OBH-C3KVIMG-WCZMOYK-L7YS2QD-4BLVQER-RZFTSCX-NAK6LQR","a":"193.106.93.116:51231","c":"v2.1.5"}
{"k":"LFEBZVV-M7SMVEV-MO52VTF-2IOHQPV-QMWU3PM-XR7G6EO-KZLGQ2C-454LSAG","a":"192.168.1.35:22000","c":"v2.1.3"}
{"k":"SJMFTPY-UZQ4HND-DCKEYSH-Y3KV2VE-5KCCLXV-5UD4YMM-JBRBD7W-6UNFXAL","a":"10.160.11.13:28384","c":"v2.1.5"}
{"k":"WK7FAUM-32B64BN-MLR56M3-YP4LEUB-EUNPJXS-2C4DSUS-6DDHO2Z-47KJMQS","a":"193.106.93.116:41476","c":"v2.1.5"}
+zsh:4> syncthing cli debug file rb3gf-w3ggb linux/os/arch/archlinux-2026.09.01-x86_64.iso
+zsh:4> jq 'del(.global.blocks, .local.blocks) | walk(if type=="object" then del(.blocks) else . end)'
{
  "availability": [
    {
      "fromTemporary": false,
      "id": "ADLMVLH-FH23OBH-C3KVIMG-WCZMOYK-L7YS2QD-4BLVQER-RZFTSCX-NAK6LQR"
    },
    {
      "fromTemporary": false,
      "id": "SJMFTPY-UZQ4HND-DCKEYSH-Y3KV2VE-5KCCLXV-5UD4YMM-JBRBD7W-6UNFXAL"
    }
  ],
  "global": {
    "blocksHash": "27bGBjXq4cVOZJu25hj0yxIYulOlBZqunItLPzKbEyk=",
    "deleted": false,
    "ignored": false,
    "invalid": false,
    "localFlags": 0,
    "modified": "2026-09-03T16:55:00.571778727+03:00",
    "modifiedBy": "ADLMVLH",
    "mustRescan": false,
    "name": "linux/os/arch/archlinux-2026.09.01-x86_64.iso",
    "noPermissions": true,
    "numBlocks": 1534,
    "platform": {
      "Darwin": null,
      "FreeBSD": null,
      "Linux": null,
      "NetBSD": null,
      "Unix": null,
      "Windows": null
    },
    "previousBlocksHash": null,
    "sequence": 200751,
    "size": 1608286208,
    "type": "FILE_INFO_TYPE_FILE",
    "version": [
      "ADLMVLH:1792509895"
    ]
  },
  "local": {
    "blocksHash": "27bGBjXq4cVOZJu25hj0yxIYulOlBZqunItLPzKbEyk=",
    "deleted": false,
    "ignored": false,
    "invalid": false,
    "localFlags": 0,
    "modified": "2026-09-03T16:55:00.571778727+03:00",
    "modifiedBy": "ADLMVLH",
    "mustRescan": false,
    "name": "linux/os/arch/archlinux-2026.09.01-x86_64.iso",
    "noPermissions": true,
    "numBlocks": 1534,
    "platform": {
      "Darwin": null,
      "FreeBSD": null,
      "Linux": null,
      "NetBSD": null,
      "Unix": null,
      "Windows": null
    },
    "previousBlocksHash": null,
    "sequence": 200751,
    "size": 1608286208,
    "type": "FILE_INFO_TYPE_FILE",
    "version": [
      "ADLMVLH:1792509895"
    ]
  }
}


=== stratofortress
+zsh:3> syncthing cli show connections
+zsh:3> jq -c '.connections | to_entries[] | select(.value.connected) | {k:.key, a:.value.address, c:.value.clientVersion}'
{"k":"2LOFO6E-ZZUM7VU-23FLNXI-UEDVYZ6-O6AQ3MV-XMDGL4T-5NKWIIF-FYI7KAQ","a":"[fd00:be:fcf:11::1]:28384","c":"v2.1.5"}
{"k":"A233MP6-MJQ5WUR-63JATVQ-KTAMXAS-GVZNPBZ-2UFPE7J-GF4LRR7-5Q57MQ6","a":"100.68.109.12:28384","c":"v2.1.6"}
{"k":"AITWVGK-LZAYCLP-6GSZVED-KT6ML4P-4JYPIZQ-ZRJPUOV-4CLYWHC-XGG4RA6","a":"213.7.220.148:22000","c":"v2.1.5"}
{"k":"IMDP22M-HWNMBNL-TT4UMEI-LCWSGTP-XFTGGLH-EUN3L5Z-MJZC3F5-742LMQA","a":"[fd7a:115c:a1e0:ab12:4843:cd96:6269:bb63]:28384","c":"v1.30.0"}
{"k":"SJMFTPY-UZQ4HND-DCKEYSH-Y3KV2VE-5KCCLXV-5UD4YMM-JBRBD7W-6UNFXAL","a":"213.7.220.148:56873","c":"v2.1.5"}
{"k":"WK7FAUM-32B64BN-MLR56M3-YP4LEUB-EUNPJXS-2C4DSUS-6DDHO2Z-47KJMQS","a":"[fd00:be:fcf:11:b019:9ff:feb0:7211]:28384","c":"v2.1.5"}
+zsh:4> syncthing cli debug file rb3gf-w3ggb linux/os/arch/archlinux-2026.09.01-x86_64.iso
+zsh:4> jq 'del(.global.blocks, .local.blocks) | walk(if type=="object" then del(.blocks) else . end)'
{
  "availability": [
    {
      "fromTemporary": false,
      "id": "AITWVGK-LZAYCLP-6GSZVED-KT6ML4P-4JYPIZQ-ZRJPUOV-4CLYWHC-XGG4RA6"
    },
    {
      "fromTemporary": false,
      "id": "SJMFTPY-UZQ4HND-DCKEYSH-Y3KV2VE-5KCCLXV-5UD4YMM-JBRBD7W-6UNFXAL"
    }
  ],
  "global": {
    "blocksHash": "27bGBjXq4cVOZJu25hj0yxIYulOlBZqunItLPzKbEyk=",
    "deleted": false,
    "ignored": false,
    "invalid": false,
    "localFlags": 0,
    "modified": "2026-09-03T13:55:00.571778727Z",
    "modifiedBy": "ADLMVLH",
    "mustRescan": false,
    "name": "linux/os/arch/archlinux-2026.09.01-x86_64.iso",
    "noPermissions": true,
    "numBlocks": 1534,
    "platform": {
      "Darwin": null,
      "FreeBSD": null,
      "Linux": null,
      "NetBSD": null,
      "Unix": null,
      "Windows": null
    },
    "previousBlocksHash": null,
    "sequence": 6862,
    "size": 1608286208,
    "type": "FILE_INFO_TYPE_FILE",
    "version": [
      "ADLMVLH:1792509895"
    ]
  },
  "local": {
    "blocksHash": "27bGBjXq4cVOZJu25hj0yxIYulOlBZqunItLPzKbEyk=",
    "deleted": false,
    "ignored": false,
    "invalid": false,
    "localFlags": 0,
    "modified": "2026-09-03T13:55:00.571778727Z",
    "modifiedBy": "ADLMVLH",
    "mustRescan": false,
    "name": "linux/os/arch/archlinux-2026.09.01-x86_64.iso",
    "noPermissions": true,
    "numBlocks": 1534,
    "platform": {
      "Darwin": null,
      "FreeBSD": null,
      "Linux": null,
      "NetBSD": null,
      "Unix": null,
      "Windows": null
    },
    "previousBlocksHash": null,
    "sequence": 6862,
    "size": 1608286208,
    "type": "FILE_INFO_TYPE_FILE",
    "version": [
      "ADLMVLH:1792509895"
    ]
  }
}

$ for h in enclave stratofortress; do
  echo "\n\n=== $h"
  ssh operator@$h.tailbefcf.ts.net '
    set -x
    sha256sum /mnt/data/Files/shared/dist/linux/os/arch/archlinux-2026.09.01-x86_64.iso
  '
done


=== enclave
+zsh:3> sha256sum /mnt/data/Files/shared/dist/linux/os/arch/archlinux-2026.09.01-x86_64.iso
2aea410e288f2d7aa24da366340ec077b467de1461e5f9b767b7276acf282aa5  /mnt/data/Files/shared/dist/linux/os/arch/archlinux-2026.09.01-x86_64.iso


=== stratofortress
+zsh:3> sha256sum /mnt/data/Files/shared/dist/linux/os/arch/archlinux-2026.09.01-x86_64.iso
be8458032f8105e60ee2a3067f950b6e3c007ee51b38dac50e8b48e765561c91  /mnt/data/Files/shared/dist/linux/os/arch/archlinux-2026.09.01-x86_64.iso

Activity

  1. added
    bug
    needs-triage
    on Oct 20, 2026
  2. added theissue type on Oct 20, 2026
  3. calmh commented on Oct 20, 2026

    @calmh
    Member

    Neat

  4. added a commit that references this issue on Oct 20, 2026
    d6d0181
  5. added a commit that references this issue on Oct 28, 2026
    c2ffc33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions