hirosystems / ordhook

Build indexers, standards and protocols on top of Ordinals and Inscriptions (BRC20, etc).
Apache License 2.0
180 stars 55 forks source link

WARN unable to query hord.sqlite: no such column: inscription_id #257

Closed shadadowz closed 7 months ago

shadadowz commented 7 months ago

After a fresh install I get the following error message:

$ ordhook scan blocks --interval 767430:767753 --mainnet

Jan 22 22:03:20.060 INFO Basing ordinals evaluation on database /home/someuser/ordhook/ordhook/hord.sqlite Jan 22 22:03:20.060 WARN unable to query hord.sqlite: no such column: inscription_id Jan 22 22:03:20.060 WARN unable to prepare query hord.sqlite: no such column: inscription_id Jan 22 22:03:21.061 WARN unable to prepare query hord.sqlite: no such column: inscription_id

$ ordhook service start --config-path=./Ordhook.toml

Jan 22 22:04:47.567 WARN unable to query hord.sqlite: no such column: inscription_id Jan 22 22:04:47.567 INFO Starting service... Jan 22 22:04:47.672 INFO Indexing inscriptions from block #826780 to block #826895 Jan 22 22:04:50.768 INFO Processing 7 blocks Jan 22 22:04:50.768 INFO Inscriptions data computation for block #826780 started Jan 22 22:04:50.768 WARN unable to prepare query hord.sqlite: no such column: inscription_id Jan 22 22:04:51.771 WARN unable to prepare query hord.sqlite: no such column: inscription_id

$ git clone https://github.com/hirosystems/ordhook.git
$ cd ordhook
$ cargo ordhook-install
$ ordhook config generate --mainnet

(Ordhook,toml)

[storage]
working_dir = "ordhook"

# The Http Api allows you to register / deregister
# dynamically predicates.
# Disable by default.
#
# [http_api]
# http_port = 20456

[network]
mode = "mainnet"
bitcoind_rpc_url = "http://0.0.0.0:8332"
bitcoind_rpc_username = "XXXX"
bitcoind_rpc_password = "XXXXXXXXX"

# Bitcoin block events can be received by Chainhook
# either through a Bitcoin node's ZeroMQ interface,
# or through the Stacks node. Zmq is being
# used by default:

bitcoind_zmq_url = "tcp://0.0.0.0:18543"

# but stacks can also be used:
# stacks_node_rpc_url = "http://0.0.0.0:20443"

[limits]
max_number_of_bitcoin_predicates = 100
max_number_of_concurrent_bitcoin_scans = 100
max_number_of_processing_threads = 16
bitcoin_concurrent_http_requests_max = 16
max_caching_memory_size_mb = 32000

# Disable the following section if the state
# must be built locally

[bootstrap]
download_url = "https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest"

[logs]
ordinals_internals = true
chainhook_internals = true

System is Ubuntu 22.04.3 LTS, Release: 22.04, Codename: jammy

sabbyanandan commented 7 months ago

@shadadowz: πŸ‘‹πŸ½ ; Thanks for opening the issue.

@smcclellan: For context, @shadadowz reached out to us via support@ distro, and I suggested opening an issue here with logs and the environment specifics.

tapstoone commented 7 months ago

I got the same problem. I guess it due to the SQLite data version is inconsistent with the develop branch code version. I checked the pr250, this seems is the correct version for the SQLite archive after 2024-01-20.

pr https://github.com/hirosystems/ordhook/pull/250

Shadadow commented 7 months ago

Is develop different than 2.0.1? I tried using that version on a fresh install again and got the same issue:

~/ordhook-2.0.1$ wget https://github.com/hirosystems/ordhook/archive/refs/tags/v2.0.1.tar.gz ~/ordhook-2.0.1$ tar -zxvf v2.0.1.tar.gz ~/ordhook-2.0.1$ cd ordhook-2.0.1/ ~/ordhook-2.0.1$ cargo ordhook-install Installing ordhook-cli v2.0.0 (/home/someuser/ordhook-2.0.1/components/ordhook-cli) Updating crates.io index warning: package memmap2 v0.9.2 in Cargo.lock is yanked in registry crates-io, consider running without --locked warning: package secp256k1 v0.28.0 in Cargo.lock is yanked in registry crates-io, consider running without --locked warning: package secp256k1-sys v0.9.1 in Cargo.lock is yanked in registry crates-io, consider running without --locked Compiling proc-macro2 v1.0.70 Compiling unicode-ident v1.0.12 Compiling versioncheck v0.9.4 **<<SKIPPED - No errors>>_** Compiling rocksdb v0.21.0 Compiling ordhook v1.0.0 (/home/someuser/ordhook-2.0.1/components/ordhook-core) Compiling ordhook-cli v2.0.0 (/home/someuser/ordhook-2.0.1/components/ordhook-cli) Finished release [optimized] target(s) in 4m 59s warning: the following packages contain code that will be rejected by a future version of Rust: rstest v0.11.0 note: to see what the problems were, use the option --future-incompat-report, or run cargo report future-incompatibilities --id 1 Replacing /home/someuser/.cargo/bin/ordhook Replaced package ordhook-cli v2.0.0 (/home/someuser/ordhook/components/ordhook-cli) with ordhook-cli v2.0.0 (/home/someuser/ordhook-2.0.1/components/ordhook-cli) (executable ordhook)

~/ordhook-2.0.1$ ordhook scan blocks --interval 767430:767753 --mainnet => https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest.tar.gz Jan 23 00:52:32.484 INFO Unable to retrieve hord.sqlite file locally Jan 23 00:52:32.485 INFO Downloading https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest.tar.gz [==========================================================] (18916275145/18916275145) Jan 23 01:14:27.662 WARN unable to query hord.sqlite: no such column: inscription_id Jan 23 01:14:27.662 WARN unable to prepare query hord.sqlite: no such column: inscription_id Jan 23 01:14:28.663 WARN unable to prepare query hord.sqlite: no such column: inscription_id Jan 23 01:14:29.667 WARN unable to prepare query hord.sqlite: no such column: inscriptionid **<< Repeats until killed >>_**

lgalabru commented 7 months ago

Hey there! this issue will be solved with https://github.com/hirosystems/ordhook/pull/250. Thank you for your patience!

Shadadow commented 7 months ago

Thank you @lgalabru ! Appreciate the update!

Shadadow commented 7 months ago

I just downloaded a fresh install to try again and here are my results. Unfortunately I am still getting the no such column error.

~/ordhook$ cargo ordhook-install
  Installing ordhook-cli v2.0.0 (/home/someuser/ordhook/components/ordhook-cli)
    Updating crates.io index
warning: package `memmap2 v0.9.2` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
warning: package `secp256k1 v0.28.0` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
warning: package `secp256k1-sys v0.9.1` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
   Compiling proc-macro2 v1.0.70
....redacted but no errors....
   Compiling stacks-rpc-client v2.0.0
   Compiling chainhook-sdk v0.12.2
   Compiling rocksdb v0.21.0
   Compiling ordhook v1.0.0 (/home/someuser/ordhook/components/ordhook-core)
warning: unused variable: `memory_available`
   --> components/ordhook-core/src/db/mod.rs:251:44
    |
251 | fn rocks_db_default_options(ulimit: usize, memory_available: usize) -> rocksdb::Options {
    |                                            ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_memory_available`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: `ordhook` (lib) generated 1 warning (run `cargo fix --lib -p ordhook` to apply 1 suggestion)
   Compiling ordhook-cli v2.0.0 (/home/someuser/ordhook/components/ordhook-cli)
    Finished release [optimized] target(s) in 4m 38s
warning: the following packages contain code that will be rejected by a future version of Rust: rstest v0.11.0
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
   Replacing /home/someuser/.cargo/bin/ordhook
    Replaced package `ordhook-cli v2.0.0 (/home/someuser/ordhook/components/ordhook-cli)` with `ordhook-cli v2.0.0 (/home/someuser/ordhook/components/ordhook-cli)` (executable `ordhook`)

Install seems to work as well as scan blocks:

$ ordhook scan blocks --interval 767430:767753 --mainnet
=> https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest.tar.gz
Feb 06 18:05:58.695 INFO Unable to retrieve hord.sqlite file locally
Feb 06 18:05:58.695 INFO Downloading https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest.tar.gz
[==========================================================] (19092554042/19092554042)
Inscription 6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0 revealed at block #767430 (inscription_number 0, ordinal_number 1252201400444387)
Inscription 1252201400444387
    β†’ Transferred in transaction 0x6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799
Inscriptions revealed: 1, inscriptions transferred: 1
-----
Inscription 26482871f33f1051f450f2da9af275794c0b5f1c61ebf35e4467fb42c2813403i0 revealed at block #767753 (inscription_number 1, ordinal_number 727624168684699)
Inscription 727624168684699
    β†’ Transferred in transaction 0x26482871f33f1051f450f2da9af275794c0b5f1c61ebf35e4467fb42c2813403
Inscriptions revealed: 1, inscriptions transferred: 1
-----

However looking at individual inscriptions still produces the error:

~/ordhook$ ordhook scan inscription 6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0 --mainnet
Feb 06 18:26:49.495 INFO Basing ordinals evaluation on database /home/someuser/ordhook/ordhook/hord.sqlite
Inscription 6fb976ab49dcec017f1e201e84395983204ae1a7c2abf7ced0a85d692e442799i0 revealed at block #767430 (inscription_number 0, ordinal_number 1252201400444387)
Feb 06 18:26:49.509 WARN unable to prepare query SELECT offset, outpoint_to_watch, tx_index, block_height FROM locations WHERE inscription_id = ? ORDER BY block_height ASC, tx_index ASC: no such column: inscription_id
Feb 06 18:26:54.512 WARN unable to prepare query SELECT offset, outpoint_to_watch, tx_index, block_height FROM locations WHERE inscription_id = ? ORDER BY block_height ASC, tx_index ASC: no such column: inscription_id
chetanbothra commented 3 months ago

@Shadadow are u still having this issue ? we tried doing same thing as u mentioned from develop as well as from release/2.1.0 and endup with same error

unable to prepare query SELECT offset, outpoint_to_watch, tx_index, block_height FROM locations WHERE inscription_id = ? ORDER BY block_height ASC, tx_index ASC: no such column: inscription_id

please let us know if u were able to resolve ?

Shadadow commented 3 months ago

I was not. I tried installing on other fresh systems and kept running into the same issue.

chetanbothra commented 3 months ago

I was trying throughout the day finally got some luck.. this is wat i did

git clone https://github.com/hirosystems/ordhook.git
cd ordhook
git checkout 420579
cargo ordhook-install
ordhook config generate --mainnet  # this created Ordhook.toml
#edited Ordhook.toml
[snapshot]
download_url = "https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest.tar.gz"

NOTE: the original Ordhook.toml had https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest and not https://archive.hiro.so/mainnet/ordhook/mainnet-ordhook-sqlite-latest.tar.gz

Shadadow commented 3 months ago

Thanks! I will check this out and report back!