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

Metrics errors on a clean node startup #1511

Closed
LesnyRumcajs opened this issue Mar 29, 2022 · 4 comments
Closed

Metrics errors on a clean node startup #1511

LesnyRumcajs opened this issue Mar 29, 2022 · 4 comments
Labels
good first issue Priority: 4 - Low Limited impact and can be implemented at any time Ready Issue is ready for work and anyone can freely assign it to themselves Type: Bug Something isn't working

Comments

@LesnyRumcajs
Copy link
Member

Describe the bug

A fresh instance of Forest, i.e. with no ~/.forest (or rather config.data_dir + /db) is triggering an error in metrics. It shouldn't be a big issue but it's not nice for a new user to see errors on a clean instance.

To Reproduce
Steps to reproduce the behavior:

  1. Remove your rocksdb directory, e.g. $HOME/.forest/db
  2. Run forest as usual
  3. See the error as below error

Log output

❯ target/release/forest --target-peer-count 50 --encrypt-keystore false --import-snapshot ~/Downloads/minimal_finality_stateroots_latest.car 2>&1 | tee forest.log                                                                                                                                                            
2022-03-29T11:07:56.384Z WARN  forest::cli > No configuration found! Using default                                                                                                                                                                                                                                           
2022-03-29T11:07:56.384Z INFO  forest::daemon > Starting Forest daemon, version v0.2.2/unstable/mainnet/5f0c7f0f                                                                                                                                                                                                             
2022-03-29T11:07:56.384Z INFO  forest_libp2p::service > Recovered libp2p keypair from "/home/rumcajs-work/.forest/libp2p/keypair"                                                                                                                                                                                            
2022-03-29T11:07:56.384Z WARN  forest::daemon         > Warning: Keystore encryption disabled!                                                                                                                                                                                                                               
Admin token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJBbGxvdyI6WyJyZWFkIiwid3JpdGUiLCJzaWduIiwiYWRtaW4iXX0.4t86AoJCoAxEMPm9w2RNrmM09aJCR789SLVfkLUkclU                                                                                                                                                                         
2022-03-29T11:07:56.384Z INFO  metrics                > Prometheus server started at 127.0.0.1:6116                                                                                                                                                                                                                          
2022-03-29T11:07:57.629Z INFO  genesis                > Initialized genesis: BlockHeader: Cid(bafy2bzacecnamqgqmifpluoeldx7zzglxcljo6oja4vrmtj7432rphldpdmm2)                                                                                                                                                                
2022-03-29T11:07:57.630Z INFO  forest::daemon         > Using network :: testnetnet                                                                                                                                                                                                                                          
2022-03-29T11:07:57.630Z INFO  genesis                > Importing chain from snapshot                                                                                                                                                                                                                                        
2022-03-29T11:07:57.630Z INFO  genesis                > Reading file...                                                                                                                                                                                                                                                      
Scanning blockchain 4840 / 1534080 [>--------------------] 0.32 % 100.07/s 255m  2022-03-29T11:21:55.587Z ERROR metrics::db            > Calculating DB size for metrics failed: Error { kind: NotFound, message: "No such file or directory (os error 2)" }          

Expected behaviour

No errors from metrics on a fresh instance of Forest.

Screenshots

Environment (please complete the following information):

  • OS: Linux
  • Rust version(e.g. rustc --version) 1.59.0
  • Branch/commit e2accbe

Other information and links

We should probably create the correct structure before initialising Prometheus though maybe the problem is more complex than that.

@LesnyRumcajs LesnyRumcajs added Priority: 4 - Low Limited impact and can be implemented at any time good first issue Type: Bug Something isn't working labels Mar 29, 2022
@lemmih lemmih added the Ready Issue is ready for work and anyone can freely assign it to themselves label Jun 21, 2022
@LesnyRumcajs LesnyRumcajs reopened this Jun 29, 2022
@lemmih
Copy link
Contributor

lemmih commented Jul 1, 2022

Wasn't this fixed by #1582? @tyshko5, maybe you could look into this.

@LesnyRumcajs
Copy link
Member Author

Ya, I thought it would be closed but I'm pretty sure I saw it recently. Let me double-check to confirm, perhaps I was running an old build.

@lemmih
Copy link
Contributor

lemmih commented Jul 1, 2022

Maybe the metrics try to query the DB size before the DB is created.

@LesnyRumcajs
Copy link
Member Author

Ya, can't see it anymore. I'll reopen it again with some strong proof if it happens again. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Priority: 4 - Low Limited impact and can be implemented at any time Ready Issue is ready for work and anyone can freely assign it to themselves Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants