stacks-network / stacks-blockchain-docker

Stacks-blockchain with API using docker compose
GNU General Public License v3.0
27 stars 37 forks source link

/new_block failes with InternalServerError after upgrade #48

Closed friedger closed 2 years ago

friedger commented 2 years ago

I ran stacks-local-dev with stacks node 2.0.11.4 After the announcement of 2.05, I called upgrade. version are:

postgres postgres alpine eb82a397daaf 199.3 MB stacks-node-api blockstack/stacks-blockchain-api latest 52e72247954f 674.6 MB stacks-node-follower blockstack/stacks-blockchain latest fa1cf834abf2 296.5 MB

Now, I see errors on the follower node with InternalServerErrors on new_block requests.

stacks-node-follower    | ERRO [1637911292.021194] [testnet/stacks-node/src/event_dispatcher.rs:136] [chains-coordinator] Event dispatcher: POST stacks-node-api:3700/http://stacks-node-api:3700/new_block failed with error Response { status: InternalServerError, headers: Headers { headers: {HeaderName("connection"): [HeaderValue { inner: "keep-alive" }], HeaderName("date"): [HeaderValue { inner: "Fri, 26 Nov 2021 07:21:32 GMT" }], HeaderName("content-length"): [HeaderValue { inner: "12" }], HeaderName("x-powered-by"): [HeaderValue { inner: "Express" }], HeaderName("etag"): [HeaderValue { inner: "W/\"c-3Rk1bge0s6VuJbi+S2m2iU0UGdY\"" }], HeaderName("keep-alive"): [HeaderValue { inner: "timeout=5" }], HeaderName("content-type"): [HeaderValue { inner: "application/json; charset=utf-8" }]} }, version: None, sender: Some(Sender { .. }), receiver: Receiver { .. }, body: Body { reader: "<hidden>", length: Some(12) }, local: TypeMap }
wileyj commented 2 years ago

for some reason i missed this issue - but yes, this was something uncovered during the latest upgrade. there was a schema change in the stacks-blockchain-api, making it impossible to upgrade without a re-sync (not desirable, i know).

the latest PR to master should address this though - i've added the event-replay file for the API, which will allow schema changes to be handled without a re-sync.

However, in order to use this event-replay - you'll need to first export the file (or do yet another resync).

https://github.com/blockstack/stacks-local-dev#quickstart

step 8 (export the data to an event-replay file):

./manage.sh <network> export
# check logs for completion
./manage.sh <network> restart

step 9: (import the data - this would be used for an api schema change):

./manage.sh <network> import
# check logs for completion
./manage.sh <network> restart