Git Product home page Git Product logo

Comments (14)

wwoytenko avatar wwoytenko commented on May 27, 2024

Hi!

Could you provide the Greenmask version? Are you using S3 storage or directory?

Try to execute Greenmask in debug mode. Maybe you will find something that you can share.

Let's gather more information

from greenmask.

jeffsutherland-bluesky avatar jeffsutherland-bluesky commented on May 27, 2024

I am using v0.1.6. The storage is a directory. I ran greenmask restore in debug mode. Once again, it stopped working, with no exit and no error-level logs. It stops with the following debug message:

2024-03-14T17:46:57Z DBG ../greenmask/internal/db/postgres/pgrestore/pgrestore.go:44 > pg_restore: /usr/local/pgsql/bin/pg_restore --dbname host=db.host.name port=5432 user=postgres dbname=db_name password=super_secret_password --jobs 1 --section post-data --username postgres /tmp/1710436063879645860
 pid=145520

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

Try to restore dump directly via pg_reatore

pg_restore --verbose -U postgres -h localhost /storage_path/1708598401362987000

Replace your connection string and actual backup id (1708598401362987000)

In case it will stop unexpectedly, there is going to be bug in ported library.

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

I suspect there is bug in TOC library. Add --verbose parameter in pg_restore command

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

Provide PostgreSQL version as well, please

from greenmask.

jeffsutherland-bluesky avatar jeffsutherland-bluesky commented on May 27, 2024

I ran pg_restore as directed. No errors, and it exited as expected.

I am using Postgres 13.13.

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

Does Greenmask return non-zero exit code?

I suspect it is a schema restoration issue, could you two times run Greenmask with the next parameters:

  1. greenmask --config config.yml restore --schema-only=true --verbose=true latest
  2. greenmask --config config.yml restore --verbose=true latest

The things that I will be happy if you provide:

  • is the schema and data restored in the database (even partially if greenmask fails)?
  • is Greenmask fails on the index or constraint restoration?
  • could you check the PostgreSQL log as well, maybe there you will find a log like with the reason
  • Could you check that the greenmask was not killed by OOM Killer? You can find this log via dmesg -t

from greenmask.

jeffsutherland-bluesky avatar jeffsutherland-bluesky commented on May 27, 2024

I get the following with verbose flag enabled:

$ greenmask --config config.yml restore --schema-only --verbose latest
{"level":"fatal","error":"1 error(s) decoding:\n\n* cannot parse 'restore.pg_restore_options.schema-only' as bool: strconv.ParseBool: parsing \"--verbose\": invalid syntax","time":"2024-03-15T17:55:14Z"}

from greenmask.

jeffsutherland-bluesky avatar jeffsutherland-bluesky commented on May 27, 2024

I am also getting the following with just --schema-only enabled, but not --verbose:

$ greenmask --config config.yml restore --schema-only latest
{"level":"fatal","error":"1 error(s) decoding:\n\n* cannot parse 'restore.pg_restore_options.schema-only' as bool: strconv.ParseBool: parsing \"latest\": invalid syntax","time":"2024-03-15T18:00:24Z"}

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

That's my fault. Try to use

greenmask --config config.yml restore --verbose=true --schema-only=true latest

from greenmask.

jeffsutherland-bluesky avatar jeffsutherland-bluesky commented on May 27, 2024

Your first command ran with no issues. So did your second command, except that it took forever to restore the indexes. Maybe restoring indexes was where it stopped working before?

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

Thank you for the details. I was not able to reproduce your case.

Could you try to restore the DB with two steps:

  • greenmask --config config.yml restore --schema-only=true --verbose=true latest --log-level=debug
  • greenmask --config config.yml restore --data-only=true --verbose=true latest --log-level=debug

This command splits the restoration into two stages:

  • Schema will be restored in the first command. Grenmask internally delegates it to pg_restore
  • The data will be restored in the second command. Greenmask restores the data by itself

If there is a stuck in the second command It is supposed to be a bug in data restoration. Check the log output maybe there will be something that can help me to find the issue

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

@jeffsutherland-bluesky has this problem been solved? I could not reproduce your case

from greenmask.

wwoytenko avatar wwoytenko commented on May 27, 2024

@jeffsutherland-bluesky I am closing this issue. Feel free to re-open this or create a new issue. Thank you!

from greenmask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.