Skip to content

Empty vss.url is documented as disabled but aborts startup #161

Description

@Kewe63

Summary

The sample configuration says that an empty [vss].url disables VSS, but the startup argument resolver preserves the empty string and validates it as a URL. A daemon started with the documented value exits before startup.

Affected commit / version

  • Commit: af03c7f1a65135a429f05a5820600338215954dc
  • Package version: 0.1.0
  • Branch: dev

Environment

  • Linux (WSL2)
  • rustc 1.94.0
  • cargo 1.94.0
  • No network or daemon service was used

Expected behavior

Given the sample contract:

[vss]
url = ""

VSS should remain disabled and startup argument resolution should succeed.

Actual behavior

The empty string remains Some("") and is rejected by validate_vss_url:

Error: Invalid VSS configuration: VSS URL `` must start with http:// or https://

Minimal local regression test

#[test]
fn empty_vss_url_disables_vss() {
    let ua = resolve(&base(&[]), "[vss]\nurl = \"\"\n").unwrap();
    assert!(ua.vss_url.is_none());
}

Exact command and output

cargo +1.94.0 test --locked --lib \
  args::tests::empty_vss_url_disables_vss -- --exact --test-threads=1

running 1 test
... FAILED
InvalidVssConfig("VSS URL `` must start with http:// or https://")

A release binary invoked with a temporary storage directory and this config also exited 1 with the same error.

Root cause

  • Sample contract:
    [vss]
    # VSS server URL for cloud backup (empty = VSS disabled)
    #url = ""
  • Resolution/validation:
    let vss_url = args.vss_url.or(vss.url);
    let vss_allow_http = args.vss_allow_http || vss.allow_http.unwrap_or(false);
    let vss_allow_empty_restore =
    args.vss_allow_empty_restore || vss.allow_empty_restore.unwrap_or(false);
    // Reject http:// URLs unless the host is loopback or allow_http is set.
    if let Some(url) = &vss_url {
    crate::utils::validate_vss_url(url, vss_allow_http)?;
    }

args.vss_url.or(vss.url) preserves Some(""), then validation treats it as a malformed URL instead of the documented disabled sentinel.

Concrete user impact

Uncommenting the documented sample value prevents the self-hosted daemon from starting instead of leaving VSS disabled.

Fork / upstream assessment

This configuration surface is UTEXO-specific and absent from the compared upstream master commit e4008278c80495ea8a8514580b899e771feff872.

Duplicate-check evidence and limitations

I searched open and closed UTEXO and upstream issues/PRs, issue comments, review comments, commit history, and current open PR path overlaps using the config key, exact error, empty/blank URL wording, and validator name. No matching report or fix was found. PRs #139 and #140 touch the same files but contain no VSS URL hunk. Private maintainer discussions are not visible.

Suggested fix direction

Normalize an empty (preferably trimmed-empty) config value to None before URL validation, and retain a focused startup/config regression test.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions