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

Empty backups created on AWS #237

Open
giovantenne opened this issue Jan 3, 2023 · 9 comments
Open

Empty backups created on AWS #237

giovantenne opened this issue Jan 3, 2023 · 9 comments

Comments

@giovantenne
Copy link

giovantenne commented Jan 3, 2023

I'm running a dockerized instance of dokku 0.29.1 like explained here: https://dokku.com/docs/getting-started/install/docker/ with a couple of rails apps and linked postgres services.

I created a bucket lollipop-pg-bakups and an IAM policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "s3:ListAllMyBuckets",
                "s3:GetBucketLocation"
            ],
            "Effect": "Allow",
            "Resource": [
                "arn:aws:s3:::*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::lollipop-pg-backups",
                "arn:aws:s3:::lollipop-pg-backups/*"
            ]
        }
    ]
}

I run dokku postgres:backup-auth lollipop-db AKIxxxxxxxxxxxxxx63LH lHixxxxxxxxxxxxxxxxxxxxxxxlnLY
an than dokku postgres:backup lollipop-db lollipop-pg-backups
and I obtain the following output:
2023-01-03-14-59-01: The backup for postgres-lollipop-db finished successfully.

After this a a file named postgres-lollipop-db-2023-01-03-14-59-01.tgz is correctly created on AWS but the tgz file is 111.0 B and only contains an empty buckup directory.

I actually don't know how to debug this further...

@aevenot
Copy link

aevenot commented Apr 16, 2023

I have the same issue. Do you use a custom network (like me) in your postgres service ?

@josegonzalez
Copy link
Member

Do y'all install dokku via docker?

@aevenot
Copy link

aevenot commented Apr 17, 2023

Do y'all install dokku via docker?

Yes. I have installed it with docker on my vps and I am using custom network du to others products installed on the same server.

@giovantenne
Copy link
Author

giovantenne commented Apr 17, 2023

I have the same issue. Do you use a custom network (like me) in your postgres service ?

No, no custom network

Do y'all install dokku via docker?

Yes

@josegonzalez
Copy link
Member

I wonder if there is some weird interplay here with how mounted volumes work in conjunction with the backup being created due to the place where files are written to not being the same on the host...

@aevenot
Copy link

aevenot commented Apr 17, 2023

You-re right, some actions are taken inside the dokku container and other on the host.
Here is my workaroud:

Add a volume used for backup in my dokku container
.docker-compose.yml
volumes: - ${PWD}/backups:/backups

Change the backup script to create the tmp folder inside the dokku container
/var/lib/dokku/plugins/available/postgres/common-functions line 282

BACKUP_TMPDIR=$(docker exec -u dokku dokku mktemp -d --tmpdir=/backups )
BACKUP_PARAMETERS="$BACKUP_PARAMETERS -v /dokku_folder/backups:/backup"

Now backups are ok in my minio server

@josegonzalez
Copy link
Member

Nice! I wonder how we can do that keeping our existing support....

Maybe we can expose an env var that is like "DOKKU_HOST_TMP_DIR` or something?

@aevenot
Copy link

aevenot commented Apr 17, 2023

Maybe.
I have no support in my solution, I have installed it on my vps to allow me to deploy my applications easily.

Installing dokku with docker is really supported ? I have encountered many problems due to this implementation, maybe the vagrant setup is better for starting.

@josegonzalez
Copy link
Member

It is supported but its not the thing I test on my end via unit tests, hence why sometimes certain features are broken. Its easy to break something you're not actively testing or aware of :)

That said, I rely on folks to report issues and help debug/resolve them when I don't have time to do so on my own. Hopefully now that we know the issue, I can spend some time soon resolving it :)

@josegonzalez josegonzalez transferred this issue from dokku/dokku-postgres Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants