Skip to content

Trying to launch Syncthing when already running resets cert.pem to 0 bytes #10053

Closed

Description

@tomasz1986

What happened?

  1. Start Syncthing.
  2. Try to start Syncthing again using the same --config (or --home) directory.
  3. The new instance fails to start with the following error:
[start] 2025/04/12 01:58:55.751711 main.go:432: INFO: syncthing v2.0.0-beta.6 "Hafnium Hornet" (go1.24.2 windows-amd64) [email protected] 2025-04-07 09:43:08 UTC [stnoupgrade]
[start] 2025/04/12 01:58:55.751711 utils.go:64: INFO: Generating ECDSA key and certificate for syncthing...
[start] 2025/04/12 01:58:55.753718 main.go:440: WARNING: Failed to load/generate certificate: save cert: write R:\test\syncthing\syncthing1\cert.pem: The process cannot access the file because another process has locked a portion of the file.
[monitor] 2025/04/12 01:58:55.755224 monitor.go:199: INFO: Syncthing exited: exit status 1
  1. Despite that, the cert.pem file has been wiped out and has a size of 0 bytes.

Tested under Windows 10 x64.

Ref 1: 7762e39
Ref 2: https://forum.syncthing.net/t/syncthing-device-id-keeps-switching/24147

Syncthing version

v1.29.4 and beta v2

Platform & operating system

Windows

Browser version

No response

Relevant log output

Activity

  1. added
    bug
    needs-triage
    and removed
    needs-triage
    on Apr 12, 2025
  2. calmh commented on Apr 12, 2025

    @calmh
    Member

    Sweet this seems like rather the opposite of what locking is supposed to accomplish

  3. calmh commented on Apr 12, 2025

    @calmh
    Member

    So this doesn't happen on my Windows, but 🤷

  4. added 4 commits that reference this issue on Apr 12, 2025
    190a598
    7db3f7e
    40888c1
    780b8fd
  5. added this to the v1.29.6 milestone on Apr 13, 2025
  6. added a commit that references this issue on Apr 13, 2025
    f295b69
  7. added
    frozen-due-to-age
    on Jul 1, 2026
  8. locked and limited conversation to collaborators on Jul 1, 2026
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

    bugfrozen-due-to-age

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions