Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Stratis.StratisD appear as a separate background process #215

Closed
trunghieud opened this issue Mar 17, 2019 · 8 comments
Closed

Stratis.StratisD appear as a separate background process #215

trunghieud opened this issue Mar 17, 2019 · 8 comments

Comments

@trunghieud
Copy link

I saw this issue once two days ago when I was syncing. I left my PC staking and when I came back home (8-9 hrs), Core wasn't running. I check the log and no error came up. I re-launch the app and staked, and went to sleep. When I woke up this morning, I noticed task manager did not have Stratis.StratisD running. Staking is still working fine on the UI and status is normal from localhost:37221/api/staking/getstakinginfo. See attachments.

Core_stakingOK
Core_NoStratisD

I thought HDMI might be the culprit from yesterday so I unplug the HDMI cable and re-plug it; Core is still running and staking. I looked at the log and no errors. I decided to re-launch Core; entered password to start staking. I looked at the log and saw this error:

[2019-03-17 16:16:59.7018 1] INFO: Stratis.Bitcoin.FullNode.Initialize Full node initialized on StratisMain.
[2019-03-17 16:16:59.7664 1] INFO: Stratis.Bitcoin.FullNode.Start Starting node.
[2019-03-17 16:17:01.1606 1] INFO: Stratis.Bitcoin.Features.Api.ApiFeature.InitializeAsync API starting on URL 'http://localhost:37221/'.
[2019-03-17 16:17:10.1060 1] INFO: Stratis.Bitcoin.Base.BaseFeature+d__29.MoveNext Loading finalized block height.
[2019-03-17 16:17:10.3263 7] INFO: Stratis.Bitcoin.Base.BaseFeature+d__29.MoveNext Loading chain.
[2019-03-17 16:18:06.2514 12] INFO: Stratis.Bitcoin.Features.Miner.MiningFeature.StartStaking Staking enabled on wallet 'Stratis1020'.
[2019-03-17 16:18:06.3050 6] INFO: Stratis.Bitcoin.Utilities.AsyncLoop+<>c__DisplayClass16_0+<b__0>d.MoveNext PosMining.Stake starting in 1 seconds.
[2019-03-17 16:18:07.3549 15] INFO: Stratis.Bitcoin.Utilities.AsyncLoop+<>c__DisplayClass16_0+<b__0>d.MoveNext PosMining.Stake starting.
[2019-03-17 16:18:07.5467 15] ERROR: Stratis.Bitcoin.Features.Miner.Staking.PosMinting+<>c__DisplayClass38_0+<b__0>d.MoveNext Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Stratis.Bitcoin.Features.Miner.Staking.PosMinting.GenerateBlocksAsync(WalletSecret walletSecret, CancellationToken cancellationToken) in C:\Users\StratisTest\Desktop\DevOps\Agent2_work\3\s\StratisBitcoinFullNode\src\Stratis.Bitcoin.Features.Miner\Staking\PosMinting.cs:line 372
at Stratis.Bitcoin.Features.Miner.Staking.PosMinting.<>c__DisplayClass38_0.<b__0>d.MoveNext() in C:\Users\StratisTest\Desktop\DevOps\Agent2_work\3\s\StratisBitcoinFullNode\src\Stratis.Bitcoin.Features.Miner\Staking\PosMinting.cs:line 288
[2019-03-17 16:18:07.5678 15] INFO: Stratis.Bitcoin.Utilities.AsyncLoop+<>c__DisplayClass16_0+<b__0>d.MoveNext PosMining.Stake stopping.
[2019-03-17 16:18:07.5947 15] FATAL: Stratis.Bitcoin.Utilities.AsyncLoop+<>c__DisplayClass16_0+<b__0>d.MoveNext PosMining.Stake threw an unhandled exception
[2019-03-17 16:18:07.6140 15] ERROR: Stratis.Bitcoin.Utilities.AsyncLoop+<>c__DisplayClass16_0+<b__0>d.MoveNext PosMining.Stake threw an unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Stratis.Bitcoin.Features.Miner.Staking.PosMinting.GenerateBlocksAsync(WalletSecret walletSecret, CancellationToken cancellationToken) in C:\Users\StratisTest\Desktop\DevOps\Agent2_work\3\s\StratisBitcoinFullNode\src\Stratis.Bitcoin.Features.Miner\Staking\PosMinting.cs:line 372
at Stratis.Bitcoin.Features.Miner.Staking.PosMinting.<>c__DisplayClass38_0.<b__0>d.MoveNext() in C:\Users\StratisTest\Desktop\DevOps\Agent2_work\3\s\StratisBitcoinFullNode\src\Stratis.Bitcoin.Features.Miner\Staking\PosMinting.cs:line 288
--- End of stack trace from previous location where exception was thrown ---
at Stratis.Bitcoin.Utilities.AsyncLoop.<>c__DisplayClass16_0.<b__0>d.MoveNext() in C:\Users\StratisTest\Desktop\DevOps\Agent2_work\3\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\Utilities\AsyncLoop.cs:line 140

Staking_None

I selected Stop Staking, enter my password, and staking is OK.

@dev0tion
Copy link
Collaborator

Hey @trunghieud, when the daemon is not running, it's impossible for the UI to show any data, so the daemon was probably running.
There's a chance it was separated from the Stratis Core process and was in the list of background processes. Please check that next time this happens and report back to us.

@rowandh
Copy link
Collaborator

rowandh commented Mar 19, 2019

This feels like it's related to #201. @trunghieud can you please try this:

  • Start a new instance of StratisCore and immediately log in and start staking, then check/post the logs here.
  • Start a new instance of StratisCore, wait 3-5 mins before logging in. Then log in and start staking and check the logs again.

@trunghieud
Copy link
Author

node.txt

@rowandh attached is the log for both scenario. I noticed that if I immediately login, the error occurred. For the second scenario, I had to "Stop Staking" and then login to start staking; I had to navigate to history for the UI to update. So it seem quickly login and start staking is an issue.

@dev0tion I see three Stratis Core and Stratis.StratisD is a background process as you suspected.

@rowandh
Copy link
Collaborator

rowandh commented Mar 19, 2019

@trunghieud thanks for that! The first scenario looks like was I was expecting.

For the second scenario it seems that the database was already in use (maybe the first instance was still shutting down?) so this affected the logging. It seemed to work correctly for you if you waited before logging in?

If possible, could you please grab another log for the second scenario after the node has finished shutting down completely? Should be no StratisD/dotnet processes running.

@trunghieud
Copy link
Author

@rowandh This is what I did:

  1. stop staking
  2. close app
  3. relaunch app and wait 6 minutes
  4. login app
  5. login to start staking
  6. verified Stratis Core and StratisD process not running
  7. attached log
    node-shutdown.txt

@rowandh
Copy link
Collaborator

rowandh commented Mar 19, 2019

Thanks @trunghieud, really helpful. That looks like everything started OK! I think this is the same issue as #201. The workaround is to do as you've been doing - wait a few minutes after the wallet is opened before logging in.

@trunghieud
Copy link
Author

Now that I am aware of the issue and the workaround, it's not so bad. However, this failed UAT from a UX perspective. My suggestion is allow the user to login their wallet and then disable the "Login to start staking" until the wallet is fully initialize. This is very minor details, but makes Stratis more polish and help with adoption. @dangershony @bokobza

@trunghieud trunghieud changed the title Stratis.StratisD crash Stratis.StratisD appear as a separate background process Mar 20, 2019
@dev0tion
Copy link
Collaborator

Done in #247

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants