IntersectMBO / govtool

🔩 GovTool and utilities monorepo.
https://gov.tools
Apache License 2.0
13 stars 7 forks source link

Proposal and network metrics endpoints break when network has no predefined DReps #501

Closed Ryun1 closed 2 months ago

Ryun1 commented 6 months ago

Bug spotted by @johnalotoski - great spot, thank you for raising 💪

Context & versions

When GovTool is run on a network without any stake delegated to the predefined DReps (no confidence and abstain), then the proposal list and networks metrics backend endpoints break.

With GovTool sancho-v1.0.1.

Fix

John has fixed the SQL queries causing this here.

Steps to reproduce

Run GovTool on a network without any stake delegated to predefined DReps.

Actual behavior

Proposal list and network metrics return error 500.

Expected behavior

Proposal list and network metrics work.

SandraRodziewicz commented 6 months ago

Verifying on our environment is not easily possible and preparing the right environment would takie a lot of effort but asked @jankun4 about the change and it should be ok

Ready for staging

MSzalowski commented 6 months ago

@johnalotoski Could you reverify if the issue still exists after efd1556?

johnalotoski commented 6 months ago

Hi @MSzalowski, the nix flake build for the backend on x86_64-linux is broken at efd1556:

❯ nix build -L .#packages.x86_64-linux.backend
vva-be> setupCompilerEnvironmentPhase
vva-be> Build with /nix/store/xqwdr3bx1k90jqy0664xl9bafjk3ikmi-ghc-9.2.7.
vva-be> unpacking sources
vva-be> unpacking source archive /nix/store/hv5i00ghxcwvyidsp6m89rq6jhgw2zwj-backend
vva-be> source root is backend
vva-be> patching sources
vva-be> compileBuildDriverPhase
vva-be> setupCompileFlags: -package-db=/build/tmp.RIIaaNsAkq/setup-package.conf.d -j8 +RTS -A64M -RTS -threaded -rtsopts
vva-be> [1 of 1] Compiling Main             ( /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs, /build/tmp.RIIaaNsAkq/Main.o )
vva-be> Linking Setup ...
vva-be> configuring
vva-be> configureFlags: --verbose --prefix=/nix/store/d0pm05p6wag3hwnh5ny6bzs18b78zmd9-vva-be-0.1.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/85lvfn96qjwq7w0dz6wsyi8209j80sqk-vva-be-0.1.0.0-doc/share/doc/vva-be-0.1.0.0 --with-gcc=gcc --package-db=/build/tmp.RIIaaNsAkq/package.conf.d --ghc-options=-j8 +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --ghc-options=-haddock --extra-lib-dirs=/nix/store/q75826qw95k82qkmqnj3haw63zp73w2g-ncurses-6.4/lib --extra-lib-dirs=/nix/store/5k2kf42dz1hy8a8li9rzw88mb7r7mifq-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/68y9c6pmlncm4zh62avmnaa1cd7k25fa-gmp-with-cxx-6.2.1/lib --extra-lib-dirs=/nix/store/q75826qw95k82qkmqnj3haw63zp73w2g-ncurses-6.4/lib --extra-lib-dirs=/nix/store/xqwdr3bx1k90jqy0664xl9bafjk3ikmi-ghc-9.2.7/lib
vva-be> Using Parsec parser
vva-be> Configuring vva-be-0.1.0.0...
vva-be> CallStack (from HasCallStack):
vva-be>   withMetadata, called at src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0-GJpw8P8PfUWK0fq1SmKVwe:Distribution.Simple.Utils
vva-be> Error: Setup: Encountered missing or private dependencies:
vva-be> resource-pool >=0.4.0.0
error: builder for '/nix/store/pjhiyw7c6almw59mjfcgjpk86v08z1l7-vva-be-0.1.0.0.drv' failed with exit code 1;
       last 10 log lines:
       > Linking Setup ...
       > configuring
       > configureFlags: --verbose --prefix=/nix/store/d0pm05p6wag3hwnh5ny6bzs18b78zmd9-vva-be-0.1.0.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/85lvfn96qjwq7w0dz6wsyi8209j80sqk-vva-be-0.1.0.0-doc/share/doc/vva-be-0.1.0.0 --with-gcc=gcc --package-db=/build/tmp.RIIaaNsAkq/package.conf.d --ghc-options=-j8 +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections --ghc-options=-haddock --extra-lib-dirs=/nix/store/q75826qw95k82qkmqnj3haw63zp73w2g-ncurses-6.4/lib --extra-lib-dirs=/nix/store/5k2kf42dz1hy8a8li9rzw88mb7r7mifq-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/68y9c6pmlncm4zh62avmnaa1cd7k25fa-gmp-with-cxx-6.2.1/lib --extra-lib-dirs=/nix/store/q75826qw95k82qkmqnj3haw63zp73w2g-ncurses-6.4/lib --extra-lib-dirs=/nix/store/xqwdr3bx1k90jqy0664xl9bafjk3ikmi-ghc-9.2.7/lib
       > Using Parsec parser
       > Configuring vva-be-0.1.0.0...
       > CallStack (from HasCallStack):
       >   withMetadata, called at src/Distribution/Simple/Utils.hs:370:14 in Cabal-3.8.1.0-GJpw8P8PfUWK0fq1SmKVwe:Distribution.Simple.Utils
       > Error: Setup: Encountered missing or private dependencies:
       > resource-pool >=0.4.0.0
       >
bosko-m commented 4 months ago

Changing this to the last known status before the migration to this project. (In QA) @MSzalowski Did this one end up on staging env?

MSzalowski commented 4 months ago

Seems like the fix is not working. I'll reopen this issue