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

[INF] CHDB: Unable to apply migration #10 #3463

Closed
bats06 opened this issue Sep 4, 2019 · 8 comments
Closed

[INF] CHDB: Unable to apply migration #10 #3463

bats06 opened this issue Sep 4, 2019 · 8 comments
Labels
bug Unintended code behaviour database Related to the database/storage of LND migration

Comments

@bats06
Copy link

bats06 commented Sep 4, 2019

Background

After updating from 0.5.1 to 0.7.1 lnd wont start
cd $GOPATH/src/github.com/lightningnetwork/lnd
git pull
make clean && make && make install

Your environment

LND 0.7.1
Ubuntu 18.04.3 LTS
bitcoind 0.18.1

Steps to reproduce

Start LND. ps LND runs fine without the old channeldb but my channels wont show up.

Expected behaviour

LND should start with all my channels up and running.

Actual behaviour

2019-09-04 20:19:02.213 [INF] LTND: Version: 0.7.1-beta commit=v0.7.1-beta-155-g06206f09b5c0c29654110b5cb95a85a9c0e75e14, build=production, logging=default
2019-09-04 20:19:02.214 [INF] LTND: Active chain: Bitcoin (network=mainnet)
2019-09-04 20:19:02.219 [INF] CHDB: Checking for schema update: latest_version=10, db_version=8
2019-09-04 20:19:02.220 [INF] CHDB: Performing database schema migration
2019-09-04 20:19:02.220 [INF] CHDB: Applying migration #9
2019-09-04 20:19:02.220 [INF] CHDB: Migrating outgoing payments to new bucket structure
2019-09-04 20:19:02.224 [INF] CHDB: Migration of outgoing payment bucket structure completed!
2019-09-04 20:19:02.224 [INF] CHDB: Applying migration #10
2019-09-04 20:19:02.224 [INF] CHDB: Unable to apply migration #10
2019-09-04 20:19:02.224 [ERR] LTND: Unable to open channeldb: unexpected EOF
2019-09-04 20:19:02.224 [INF] LTND: Shutdown complete
Unable to open channeldb: unexpected EOF

@chrisrico
Copy link

chrisrico commented Sep 4, 2019

I'm also experiencing this error, coming from 0.6.0.

Attempting automatic RPC configuration to bitcoind
Automatically obtained bitcoind's RPC credentials
2019-09-04 13:43:32.767 [INF] LTND: Version: 0.7.1-beta commit=v0.7.1-beta-163-gc397a2ea78ac837bfb43b6473be7fe5709e9b7e6, build=production, logging=default
2019-09-04 13:43:32.767 [INF] LTND: Active chain: Bitcoin (network=mainnet)
2019-09-04 13:43:32.774 [INF] CHDB: Checking for schema update: latest_version=10, db_version=8
2019-09-04 13:43:32.774 [INF] CHDB: Performing database schema migration
2019-09-04 13:43:32.774 [INF] CHDB: Applying migration #9
2019-09-04 13:43:32.774 [INF] CHDB: Migrating outgoing payments to new bucket structure
2019-09-04 13:43:32.775 [INF] CHDB: Migration of outgoing payment bucket structure completed!
2019-09-04 13:43:32.775 [INF] CHDB: Applying migration #10
2019-09-04 13:43:32.775 [INF] CHDB: Unable to apply migration #10
2019-09-04 13:43:32.776 [ERR] LTND: Unable to open channeldb: unexpected EOF
2019-09-04 13:43:32.776 [INF] LTND: Shutdown complete
Unable to open channeldb: unexpected EOF

@bats06
Copy link
Author

bats06 commented Sep 4, 2019

I'm not a 100 procent sure im coming from 0.5.1. I might have updated in between. Any way to check?

@cfromknecht
Copy link
Contributor

@bats06 @chrisrico for now just update to 0.7.1, instead of master

@wpaulino wpaulino added bug Unintended code behaviour database Related to the database/storage of LND migration labels Sep 4, 2019
@bats06
Copy link
Author

bats06 commented Sep 4, 2019

@cfromknecht I don't know what u mean by master. I'm still learning.

@wpaulino
Copy link
Contributor

wpaulino commented Sep 4, 2019

git pull

By doing this, you're pulling in the latest changes of the repo, i.e., the master branch. Check out https://github.com/lightningnetwork/lnd/releases/tag/v0.7.1-beta for how to obtain a proper v0.7.1 binary.

@cfromknecht
Copy link
Contributor

if you already have the source code pulled, simply check out v0.7.1-beta and then try to reinstall

@molxyz
Copy link

molxyz commented Sep 4, 2019

@bats06 First, make sure you have go1.12.9 or close to it installed. Go1.11 or older won't do it. Uninstall the older go version first before installing new one. Then do this:

$ cd $GOPATH/src/github.com/lightningnetwork/lnd
$ git pull
$ git checkout v0.7.1-beta
$ make clean && make && make install

EDIT: If you plan to compile from source, or just follow what the devs said. :-D

@bats06
Copy link
Author

bats06 commented Sep 5, 2019

@cfromknecht after the checkout I could unlock and run LND.

All the channel funds seem to be in an on chain transaction. I will check again tomorrow.

@bats06 bats06 closed this as completed Sep 5, 2019
Roasbeef added a commit to Roasbeef/lnd that referenced this issue Sep 9, 2019
…ningnetwork#9 and lightningnetwork#10

In this commit, we fix an issue that was recently introduced as a result
of migration lightningnetwork#10. The new TLV format ended up modifying the
serialization functions called in `serializePaymentAttemptInfo`.
Migration lightningnetwork#9, also used this `serializePaymentAttemptInfo` method to
serialize the _new_ (pre TLV, but new payment attempt structure) routes
into the database during its migration. However, migration lightningnetwork#10 failed to
copy over the existing unmodified `serializePaymentAttemptInfo` method
into the legacy serialization for migration lightningnetwork#9. As a result, once
migration lightningnetwork#9 was run, the routes/payments were serialized using the
_new_ format, rather than the format used for v0.7.1. This then lead to
de-serialization either failing, or causing partial payment corruption
as migration lightningnetwork#10 was expecting the "legacy" format (no TLV info).

We fix this issue by adding a new fully enclosed
`serializePaymentAttemptInfoMigration9`method that will be used for
migration lightningnetwork#9. Note that our tests didn't catch this, as they test the
migration in isolation, rather than in series which is how users will
encounter the migrations.

Fixes lightningnetwork#3463.
matheusd pushed a commit to matheusd/dcrlnd that referenced this issue Oct 15, 2019
…#10

In this commit, we fix an issue that was recently introduced as a result
of migration #10. The new TLV format ended up modifying the
serialization functions called in `serializePaymentAttemptInfo`.
Migration #9, also used this `serializePaymentAttemptInfo` method to
serialize the _new_ (pre TLV, but new payment attempt structure) routes
into the database during its migration. However, migration #10 failed to
copy over the existing unmodified `serializePaymentAttemptInfo` method
into the legacy serialization for migration #9. As a result, once
migration #9 was run, the routes/payments were serialized using the
_new_ format, rather than the format used for v0.7.1. This then lead to
de-serialization either failing, or causing partial payment corruption
as migration #10 was expecting the "legacy" format (no TLV info).

We fix this issue by adding a new fully enclosed
`serializePaymentAttemptInfoMigration9`method that will be used for
migration #9. Note that our tests didn't catch this, as they test the
migration in isolation, rather than in series which is how users will
encounter the migrations.

Fixes lightningnetwork#3463.
matheusd pushed a commit to matheusd/dcrlnd that referenced this issue Oct 16, 2019
…#10

In this commit, we fix an issue that was recently introduced as a result
of migration #10. The new TLV format ended up modifying the
serialization functions called in `serializePaymentAttemptInfo`.
Migration #9, also used this `serializePaymentAttemptInfo` method to
serialize the _new_ (pre TLV, but new payment attempt structure) routes
into the database during its migration. However, migration #10 failed to
copy over the existing unmodified `serializePaymentAttemptInfo` method
into the legacy serialization for migration #9. As a result, once
migration #9 was run, the routes/payments were serialized using the
_new_ format, rather than the format used for v0.7.1. This then lead to
de-serialization either failing, or causing partial payment corruption
as migration #10 was expecting the "legacy" format (no TLV info).

We fix this issue by adding a new fully enclosed
`serializePaymentAttemptInfoMigration9`method that will be used for
migration #9. Note that our tests didn't catch this, as they test the
migration in isolation, rather than in series which is how users will
encounter the migrations.

Fixes lightningnetwork#3463.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour database Related to the database/storage of LND migration
Projects
None yet
Development

No branches or pull requests

5 participants