-
Notifications
You must be signed in to change notification settings - Fork 254
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
Crash with invalid memory address or nil pointer dereference when restoring #556
Comments
Hi! Does this only happen with a specific release or a specific database and is it 100% reproducible? Did you look up the lines of the same release you're on on GitHub as those have changed a little since last release? Thanks! |
Ah, I see what the issue is now that I'm at my laptop. It's indeed an expectation that a successful request to the bucket returns the content length of the object (snapshot in this case) and it's recorded in metrics. For some reason the length of the object is not given by the AWS SDK. Is that a standard AWS S3 bucket you are using or some third party provider? And which provider if you can say. Thanks. |
The SDK provides helper functions when you want an empty value if the actual one is nil so we can just wrap all of them to avoid getting bit. Fixes benbjohnson#556 Replaces benbjohnson#555 Also fixes another panic when getting a delete error without key.
The SDK provides helper functions when you want an empty value if the actual one is nil so we can just wrap all of them to avoid getting bit. Fixes benbjohnson#556 Replaces benbjohnson#555 Also fixes another panic when getting a delete error without key.
Opened #557 that fixes this and another issue that is related to the same thing which we just hit earlier. |
Sorry for the late follow-up: In this case it is a S3-like API from Palantir Foundry. |
Ah, yeah, so their implementation doesn't seem to send that information. Regardless it should not cause issues so the merged fix should help. If you're able to build Litestream from source if you could try the latest code from main it should work. |
Already built it today and it works. Thank you! |
Hi @benbjohnson,
first of all: Thank you for this project. This helps a lot for my databases!
I'm using it in different projects and databases and it works quite good.
But now I have an issue when restoring a database after it was working for months. The database file has 10 tables and the largest one has 11072 rows with 35 columns. The total size of the database file is ~ 1 MB. The restore crashes with the following error message:
If I comment the lines 294 and 295 and compile the code:
litestream/s3/replica_client.go
Lines 285 to 298 in e71e685
the restore is working again. If I instead remove 52 rows of my table or remove 1 column it is working too.
When I download the snapshot file manually and decompress it, it is working too.
I don't really know go language and I'm not sure what these two lines are needed for. When I understand it correctly they are used for some metrics, but I'm not sure if it is safe to remove these two lines, although it would be better to fix the root cause.
Does anybody know why this happens?
Thank you!
The text was updated successfully, but these errors were encountered: