LemmyNet/lemmy · error

To set parameters for running migrations, use the lemmy_serv

Error message

To set parameters for running migrations, use the lemmy_server command.

What it means

Sentinel validation error in the migration wrapper binary's main. It fires when the user passes any command-line argument to this minimal wrapper; arguments are not supported because the full lemmy_server binary owns parameterized migration runs. The input at fault is argv[1..] passed to the wrapper instead of to lemmy_server.

Source

Thrown at crates/diesel_utils/src/main.rs:6

/// Very minimal wrapper around `lemmy_diesel_utils::run` to allow running migrations without
/// compiling everything.
#[cfg(feature = "full")]
fn main() -> anyhow::Result<()> {
  if std::env::args().len() > 1 {
    anyhow::bail!("To set parameters for running migrations, use the lemmy_server command.");
  }

  lemmy_diesel_utils::schema_setup::run(
    lemmy_diesel_utils::schema_setup::Options::default().run(),
    &std::env::var("LEMMY_DATABASE_URL")?,
  )?;

  Ok(())
}

#[cfg(not(feature = "full"))]
fn main() -> Result<(), Box<dyn std::error::Error>> {
  Ok(())
}

View on GitHub (pinned to 439734dd63)

Solutions

  1. Run the wrapper binary with no command-line arguments; it only reads LEMMY_DATABASE_URL from the environment.
  2. Use the full lemmy_server binary with its migration subcommand/flags when you need to set migration parameters.
  3. Set LEMMY_DATABASE_URL before invoking the wrapper so migrations can connect.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/diesel_utils/src/main.rs:6 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of LemmyNet/lemmy@439734dd63 (2026-09-06). Data as JSON: /api/errors/ea2e21c91aa2d0a7. Report an issue: GitHub.