stratisproject / StratisBitcoinFullNode

Bitcoin full node in C#
https://stratisplatform.com
MIT License
787 stars 315 forks source link

Core 1.3.1 cannot start due to "Newtonsoft.Json.JsonReaderException: Unterminated string. Expected delimiter" #4096

Closed trunghieud closed 4 years ago

trunghieud commented 4 years ago

I went to check on my Core wallet and apparently it wasn't running. It hasn't been running since 5 days ago according to the last log. I started Core and the app could not load; I waited for about 10-15 minutes. I check the logs:

[2019-11-26 06:42:24.0456 1] INFO: Stratis.Bitcoin.FullNode.Initialize Full node initialized on StratisMain. [2019-11-26 06:42:24.1057 1] INFO: Stratis.Bitcoin.FullNode.Start Starting node. [2019-11-26 06:42:25.0212 1] INFO: Stratis.Bitcoin.Features.Api.ApiFeature.InitializeAsync API starting on URL 'http://localhost:37221/'. [2019-11-26 06:42:29.2815 1] INFO: Stratis.Bitcoin.Base.BaseFeature+d30.MoveNext Loading finalized block height. [2019-11-26 06:42:29.4998 5] INFO: Stratis.Bitcoin.Base.BaseFeature+d30.MoveNext Loading chain. [2019-11-26 06:46:09.6715 6] INFO: Stratis.Bitcoin.Base.BaseFeature+d30.MoveNext Chain loaded at height 1551209. [2019-11-26 06:46:09.7410 19] INFO: Stratis.Bitcoin.Utilities.AsyncLoop+<>cDisplayClass20_0+<b0>d.MoveNext FlushChain starting in 60 seconds. [2019-11-26 06:46:11.1087 20] INFO: Stratis.Bitcoin.Base.BaseFeature.StartAddressManager Loading peers from : C:\Users\Stratis\AppData\Roaming\StratisNode\stratis\StratisMain. [2019-11-26 06:46:13.6348 1] ERROR: Stratis.Bitcoin.Builder.FullNodeFeatureExecutor.LogAndAddException An error occurred: 'Newtonsoft.Json.JsonReaderException: Unterminated string. Expected delimiter: ". Path '[32810].endpoint', line 1, position 9966510. at Newtonsoft.Json.JsonTextReader.ReadStringIntoBuffer(Char quote) at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Stratis.Bitcoin.Utilities.FileStorage`1.LoadByFileName(String fileName) in C:\Users\StratisTest\Desktop\DevOps\Agent1_work\4\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\Utilities\FileStorage.cs:line 193 at Stratis.Bitcoin.P2P.PeerAddressManager.LoadPeers() in C:\Users\StratisTest\Desktop\DevOps\Agent1_work\4\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\P2P\PeerAddressManager.cs:line 62 at Stratis.Bitcoin.Base.BaseFeature.StartAddressManager(NetworkPeerConnectionParameters connectionParameters) in C:\Users\StratisTest\Desktop\DevOps\Agent1_work\4\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\Base\BaseFeature.cs:line 290 at Stratis.Bitcoin.Base.BaseFeature.InitializeAsync() in C:\Users\StratisTest\Desktop\DevOps\Agent1_work\4\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\Base\BaseFeature.cs:line 214 at Stratis.Bitcoin.Builder.FullNodeFeatureExecutor.<>c.b3_1(IFullNodeFeature service) in C:\Users\StratisTest\Desktop\DevOps\Agent1_work\4\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\Builder\FullNodeFeatureExecutor.cs:line 56 at Stratis.Bitcoin.Builder.FullNodeFeatureExecutor.Execute(Action`1 callback, Boolean disposing) in C:\Users\StratisTest\Desktop\DevOps\Agent1_work\4\s\StratisBitcoinFullNode\src\Stratis.Bitcoin\Builder\FullNodeFeatureExecutor.cs:line 130' [2019-11-26 06:46:13.6695 1] ERROR: Stratis.Bitcoin.Builder.FullNodeFeatureExecutor.Initialize An error occurred starting the application.

@dev0tion @zeptin @fassadlr any ideas? how do I resolve this issue?

rowandh commented 4 years ago

@trunghieud this sounds a lot like your peers.json is corrupt. Try making a backup copy and deleting the original, then restart the node. And have a look in the file to see if it's a well-formed JSON object.

trunghieud commented 4 years ago

@rowandh i backup the original file, delete, and restart node. Now it finally started and waiting to sync.

I looked at the backup file and it is corrupted. Toward the end there is just a bunch of “NUL” and “NUI”. I don’t use this system for anything other than staking. I rarely check it. I noticed that windows update was running, updated, and restart the system.

I check the log and no errors. The last block was 1551151. Anything further to troubleshoot?

rowandh commented 4 years ago

Thanks, I think that's enough info. I think it's unlikely to have been caused by a bug in the FN. Probably one of these things:

trunghieud commented 4 years ago

Got it. It's definitely not running out of disk space. I'll monitor it closely now. Thanks for taking the quick replies.

On Wed, Nov 27, 2019 at 12:04 AM Rowan de Haas notifications@github.com wrote:

Thanks, I think that's enough info. I think it's unlikely to have been caused by a bug in the FN. Probably one of these things:

  • The machine crashed/restarted/updated while writing the file
  • The machine ran out of disk space

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stratisproject/StratisBitcoinFullNode/issues/4096?email_source=notifications&email_token=AHCW7RFQURN57KCMIPAJGJDQVYSXLA5CNFSM4JRTMAS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFIUUPQ#issuecomment-558975550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHCW7RFESW4JF4U3OBWNS73QVYSXLANCNFSM4JRTMASQ .