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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [BUG] - Litestream in docker compose not working #1357

Open
B4rtware opened this issue Jul 22, 2023 · 2 comments
Open

馃悰 [BUG] - Litestream in docker compose not working #1357

B4rtware opened this issue Jul 22, 2023 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@B4rtware
Copy link
Contributor

Description

I'm getting errors the way the docker compose file is being written right now.

When starting the undb service the following error occurs:
cannot fetch generations: cannot lookup bucket region: InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.

It seems like someone else got the same issue and opened an issue (provides a fix):
benbjohnson/litestream#478

When mounting this fix through docker compose
./litestream.yml:/etc/litestream.yml

litestream.yml:

access-key-id:     minioadmin
secret-access-key: minioadmin

dbs:
  - path: /var/opt/.undb/undb.db
    replicas:
      - type: s3
        bucket: undb
        path: undb.db
        endpoint: http://minio:9000

I am able to execute litestream replicate manually but I think because this line in the start.mjs:

await $`litestream restore -v -if-replica-exists -o ${database} "${process.env.UNDB_LITESTREAM_REPLICA_URL}"`

the command does not use the provided replicas? Maybe using an endpoint environment variable could fix it.

And with this line, the client threw a warning about one should use anonymous:
https://github.com/undb-xyz/undb/blob/c8322050fb569ac41d1d5462828dff326ff2e575/docker/docker-compose.minio.yaml#L37C7-L37C53
/usr/bin/mc anonymous set public undb_minio/undb;
This seems to fix the warning.

If you think this makes sense, I can also create a pull request.

Reproduction URL

No response

Reproduction steps

Execute the current docker compose file via `docker compose up`.

Screenshots

No response

Logs

undb                  | No database found, restoring from replica if exists
undb                  | $ litestream restore -v -if-replica-exists -o /var/opt/.undb/undb.db "s3://undb.minio:9000/undb.db"
undb                  | cannot fetch generations: cannot lookup bucket region: InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.
undb                  |         status code: 403, request id: HTE4KMS9T..., host id: gmSnCk7hkA6gsYBTR7PpbOtR+lslV4t3F5gTPTyUxvtd...
undb                  | Error: cannot fetch generations: cannot lookup bucket region: InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records.
undb                  |         status code: 403, request id: HTE4KMS9T..., host id: gmSnCk7hkA6gsYBTR7PpbOtR+lslV4t3F5gTPTyUxvtddrk8...
undb                  |     at file:///undb/scripts/start.mjs:10:12
undb                  |     exit code: 1
undb exited with code 1

Browsers

Chrome

@B4rtware B4rtware added the bug Something isn't working label Jul 22, 2023
@nichenqin nichenqin self-assigned this Jul 22, 2023
@B4rtware
Copy link
Contributor Author

I have now tested it with Backblaze B2 as well. It works with litestream's provided config from https://litestream.io/guides/backblaze/.
The restore documentation states that using the replica_url does not use the configuration file. So maybe using the database path might be an option With a database path:

root@c11b18bbf5f1:/undb# litestream restore -if-db-not-exists -if-replica-exists /var/opt/.undb/undb.db
database already exists, skipping

@nichenqin
Copy link
Collaborator

thanks I will take a look

@nichenqin nichenqin added good first issue Good for newcomers help wanted Extra attention is needed labels Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants