Skip to content

syncthing cli --help doesn't work without a valid home path with cert.pem #7588

Closed

Description

@tomasz1986
  1. Try running syncthing cli --help without starting Syncthing at least once first, or when using a custom home/config folder.
  2. The command fails with the following error.
    reading device ID: open C:\Users\User\AppData\Local\Syncthing\cert.pem: The system cannot find the path specified.
    

Also, not sure if this should be a different issue or not, but if I try running

syncthing cli --home=<path-to-home> --help

then I only get

getting config: unexpected HTTP status returned: 401 Unauthorized
Not Authorized

.

Activity

  1. added
    bug
    needs-triage
    on Apr 21, 2021
  2. calmh commented on Apr 21, 2021

    @calmh
    Member

    So the thing here is that the CLI code actually talks to Syncthing in order to build the --help output, because it lists the config commands and such which depend on the actual config returned by Syncthing. Though if we can't talk to Syncthing to build the config we could show some general options and explain the situation.

  3. AudriusButkevicius commented on Apr 21, 2021

    @AudriusButkevicius
    Member

    I don't think it needs to do that? Or atleast didn't need it before?

  4. calmh commented on Apr 21, 2021

    @calmh
    Member

    Well I can't speak to the necessity or the history, but that appears to be what it does now.

  5. tomasz1986 commented on Apr 21, 2021

    @tomasz1986
    MemberAuthor

    Though if we can't talk to Syncthing to build the config we could show some general options and explain the situation.

    What to do about the 401 Unauthorized error?

    The configuration that I tried running the syncthing cli --home=<path-to-home> --help command on is just my test instance of Syncthing with no HTTPS enabled, and also no user and no password set.

  6. removed
    needs-triage
    on Apr 22, 2021
  7. self-assigned this
    on Apr 22, 2021
  8. imsodin commented on Apr 22, 2021

    @imsodin
    Member

    @tomasz1986 This PR should fix your issues: #7591
    I don't know where the 401 comes from - if that persists with the PR lets debug that on the forum first.

  9. AudriusButkevicius commented on Apr 22, 2021

    @AudriusButkevicius
    Member

    Had a look again, and we do indeed need the config to get the list of devices, as when we construct the command line, we create commands for managing devices. :(

    Making some comments on the PR on how I think this could be worked around.

  10. tomasz1986 commented on May 11, 2021

    @tomasz1986
    MemberAuthor

    I think that this one has been fixed, right?

    Now the output of syncthing cli --help is

    >syncthing-windows-386-v1.16.2-dev.32.g41179660.exe cli --help
    NAME:
       syncthing-windows-386-v1.16.2-dev.32.g41179660.exe cli - Syncthing command line interface
    
    USAGE:
       syncthing-windows-386-v1.16.2-dev.32.g41179660.exe cli command [command options] [arguments...]
    
    COMMANDS:
       config      Configuration modification command group
       show        Show command group
       operations  Operation command group
       errors      Error command group
       debug       Debug command group
    
    OPTIONS:
       --gui-address value  Override GUI address (e.g. "http://192.0.2.42:8443") (default: "URL")
       --gui-apikey value   Override GUI API key (default: "API-KEY")
       --home value         Set configuration and data directory (default: "PATH")
       --conf value         Set configuration directory (config and keys) (default: "PATH")
       --help, -h           show help
    
  11. imsodin commented on May 11, 2021

    @imsodin
    Member

    Yes, that was fixed by #7591 which was missing a # in the commit message - thanks for noticing.

  12. added this to the v1.16.0 milestone on May 11, 2021
  13. added
    frozen-due-to-age
    on Aug 11, 2022
  14. locked and limited conversation to collaborators on Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfrozen-due-to-age

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions