CardanoSolutions / kupo

🐹 Fast, lightweight & configurable chain-index for Cardano.
https://cardanosolutions.github.io/kupo/
Mozilla Public License 2.0
119 stars 29 forks source link

Running kupo twice with same configuration results in configuration mismatch error #86

Closed nielstron closed 1 year ago

nielstron commented 1 year ago

What Git revision are you using? release v2.2.0

What operating system are you using, and which version?

Describe what the problem is?

I run

kupo \
  --ogmios-host $OGMIOS_HOST \
  --ogmios-port $OGMIOS_PORT \
  --since 39916796.e72579ff89dc9ed325b723a33624b596c08141c7bd573ecfff56a1f7229e4d09 \
  --match "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/*" \
  --match "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/*" \
  --match "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" \
  --match "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ" \
  --workdir ./kupo/db \
  --prune-utxo \
  --port 1445 \
  --defer-db-indexes

twice. The second time I get

{"severity":"Info","timestamp":"2022-11-17T16:50:51.913915825Z","thread":"15","message":{"Database":{"tag":"DatabaseCurrentVersion","currentVersion":9}},"version":"v2.2.0"}
{"severity":"Warning","timestamp":"2022-11-17T16:50:51.914228606Z","thread":"15","message":{"Database":{"tag":"DatabaseDeferIndexes","warning":"Creation of lookup indexes has been deferred: synchronization will be faster but many queries will also be a lot longer. Consider installing indexes once synchronization is done to speed up queries."}},"version":"v2.2.0"}
{"severity":"Error","timestamp":"2022-11-17T16:50:51.914394811Z","thread":"15","message":{"Configuration":{"tag":"ConfigurationInvalidOrMissingOption","hint":"Configuration patterns are different from previously known patterns. Restarting a running server using different command-line patterns is not allowed for it may likely be an error. If you do intent do dynamically manage patterns, please use the HTTP API instead of the command-line options."}},"version":"v2.2.0"}
kupo: ConflictingOptionsException "Configuration patterns are different from previously known patterns. Restarting a running server using different command-line patterns is not allowed for it may likely be an error. If you do intent do dynamically manage patterns, please use the HTTP API instead of the command-line options."

The issue seems to be the duplicated pattern. After removing it, the second time starts fine.

What should be the expected behavior?

Some more useful error message ;)

KtorZ commented 1 year ago

Ho. Good point. Patterns should probably be compared as a set.