Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Litestream error on restore #573

Closed
danielmichaels opened this issue Jun 5, 2024 · 2 comments
Closed

Litestream error on restore #573

danielmichaels opened this issue Jun 5, 2024 · 2 comments

Comments

@danielmichaels
Copy link
Contributor

danielmichaels commented Jun 5, 2024

Hey mate,

I updated my picoshare instance this morning and it failed to start.

The error I am getting is:

ERROR failed to run error="flag provided but not defined: -v"

I am using the docker image. Reverting from 1.4.3 (latest) to 1.4.2 fixed the issue.

Repro:

Working version:

  • docker run --rm -it --entrypoint bash mtlynch/picoshare:1.4.2
# /app/litestream restore -v -if-replica-exists 
database path or replica URL required

I have not provided the argument, this is expected behavior.

Error version:

  • docker run --rm -it --entrypoint bash mtlynch/picoshare:1.4.3
# /app/litestream restore -v -if-replica-exists
flag provided but not defined: -v

The restore command recovers a database from a previous snapshot and WAL.

Usage:

	litestream restore [arguments] DB_PATH

	litestream restore [arguments] REPLICA_URL

Arguments:

	-config PATH
	    Specifies the configuration file.
	    Defaults to /etc/litestream.yml

	-no-expand-env
	    Disables environment variable expansion in configuration file.

	-replica NAME
	    Restore from a specific replica.
	    Defaults to replica with latest data.

	-generation NAME
	    Restore from a specific generation.
	    Defaults to generation with latest data.

	-index NUM
	    Restore up to a specific hex-encoded WAL index (inclusive).
	    Defaults to use the highest available index.

	-timestamp TIMESTAMP
	    Restore to a specific point-in-time.
	    Defaults to use the latest available backup.

	-o PATH
	    Output path of the restored database.
	    Defaults to original DB path.

	-if-db-not-exists
	    Returns exit code of 0 if the database already exists.

	-if-replica-exists
	    Returns exit code of 0 if no backups found.

	-parallelism NUM
	    Determines the number of WAL files downloaded in parallel.
	    Defaults to 8

	-v
	    Verbose output.


Examples:

	# Restore latest replica for database to original location.
	$ litestream restore /path/to/db

	# Restore replica for database to a given point in time.
	$ litestream restore -timestamp 2020-01-01T00:00:00Z /path/to/db

	# Restore latest replica for database to new /tmp directory
	$ litestream restore -o /tmp/db /path/to/db

	# Restore database from latest generation on S3.
	$ litestream restore -replica s3 /path/to/db

	# Restore database from specific generation on S3.
	$ litestream restore -replica s3 -generation xxxxxxxx /path/to/db

2024/06/05 23:36:53 ERROR failed to run error="flag provided but not defined: -v"

This is odd because the output indicates that -v is a valid flag.

I suspect this could be an upstream issue but wanted to flag it here first.

Dan

@mtlynch
Copy link
Owner

mtlynch commented Jun 6, 2024

@danielmichaels - Thanks for the heads up!

It looks like it was a breaking change in Litestream that I missed:

benbjohnson/litestream#517

Fix should just be to remove the -v flag from the script.

danielmichaels added a commit to danielmichaels/picoshare that referenced this issue Jun 7, 2024
Addresses mtlynch#573 

Removing `-v` from the `litestream restore` command as it is now the default.
mtlynch pushed a commit that referenced this issue Jun 7, 2024
Addresses #573 

Removing `-v` from the `litestream restore` command as it is now the
default.
@mtlynch
Copy link
Owner

mtlynch commented Jun 7, 2024

Fixed in #574

@mtlynch mtlynch closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants