iotaledger / goshimmer

Prototype implementation of IOTA 2.0
https://wiki.iota.org/goshimmer/welcome
Apache License 2.0
389 stars 113 forks source link

panic: tried to retrieve the BranchID of unknown marker.Index(1) #1845

Closed cloud-versity closed 2 years ago

cloud-versity commented 2 years ago

Bug description

Hi folks,

I'm running GoShimmer on a small VM (2 CPUs, 4GB RAM) with docker-compose by leveraging your provided compose file. The only container which crashed, was the GoShimmer itself after 5 days.

I'm running the latest image. Does it make sense to run a specifc version e.g. v0.7.5 or is the latest tag actually recommended?

GoShimmer version

Which version of GoShimmer are you running?

docker image inspect --format '{{json .}}' "3f633dde0862" | jq -r '. | {Id: .Id, Digest: .Digest, RepoDigests: .RepoDigests, Labels: .Config.Labels}'

{
  "Id": "sha256:3f633dde0862ea2b830a8807dbe93c13aad743e440bfbf44493fa288df2106f0",
  "Digest": null,
  "RepoDigests": [
    "iotaledger/goshimmer@sha256:839003dea312b1b9caa0625bd42dc2064014ff38a5ec858954e7c062a433be4a"
  ],
  "Labels": null
}

Hardware specification

What hardware are you using?

Steps To reproduce the bug

No idea.

Expected behaviour

No crash at all.

Actual behaviour

Well, it crashed.

Errors

docker logs goshimmer

panic: tried to retrieve the BranchID of unknown marker.Index(1)

goroutine 80 [running]:
github.com/iotaledger/goshimmer/packages/tangle.(*MarkerIndexBranchIDMapping).BranchID(0xc0055f00c0, 0x5695f4)
        /goshimmer/packages/tangle/booker.go:836 +0x1b4
github.com/iotaledger/goshimmer/packages/tangle.(*MarkersManager).BranchID.func1(0xb7a020)
        /goshimmer/packages/tangle/booker.go:598 +0x2a
github.com/iotaledger/goshimmer/packages/tangle.(*CachedMarkerIndexBranchIDMapping).Consume.func1({0x1f3a240, 0xc0055f00c0})
        /goshimmer/packages/tangle/booker.go:1012 +0x36
github.com/iotaledger/hive.go/objectstorage.(*CachedObjectImpl).Consume(0xc00095d758, 0xc005569660, {0x0, 0x15e3740, 0x1})
        /go/pkg/mod/github.com/iotaledger/hive.go@v0.0.0-20211029111324-6d3d2fca5b4d/objectstorage/cached_object.go:132 +0xd7
github.com/iotaledger/goshimmer/packages/tangle.(*CachedMarkerIndexBranchIDMapping).Consume(0xc005569650, 0xc0055d4750, {0x0, 0x0, 0x0})
        /goshimmer/packages/tangle/booker.go:1011 +0x91
github.com/iotaledger/goshimmer/packages/tangle.(*MarkersManager).BranchID(0xc000193330, 0xc01098c690)
        /goshimmer/packages/tangle/booker.go:597 +0xc7
github.com/iotaledger/goshimmer/packages/tangle.(*MarkersManager).BranchMappedByPastMarkers.func1(0x2, 0x1)
        /goshimmer/packages/tangle/booker.go:634 +0x85
github.com/iotaledger/goshimmer/packages/markers.(*Markers).ForEach(0xc013b7e810, 0xc00095d9b8)
        /goshimmer/packages/markers/marker.go:274 +0x1e2
github.com/iotaledger/goshimmer/packages/tangle.(*MarkersManager).BranchMappedByPastMarkers(0xc000193330, {0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...)
        /goshimmer/packages/tangle/booker.go:633 +0x7d
github.com/iotaledger/goshimmer/packages/tangle.(*Booker).BookMessage.func1.1(0xb7a020)
        /goshimmer/packages/tangle/booker.go:163 +0x868
github.com/iotaledger/goshimmer/packages/tangle.(*CachedMessageMetadata).Consume.func1({0x1f3a360, 0xc00279e400})
        /goshimmer/packages/tangle/message.go:1261 +0x36
github.com/iotaledger/hive.go/objectstorage.(*CachedObjectImpl).Consume(0xc00095dd20, 0xc003340df0, {0x0, 0x16462e0, 0x1})
        /go/pkg/mod/github.com/iotaledger/hive.go@v0.0.0-20211029111324-6d3d2fca5b4d/objectstorage/cached_object.go:132 +0xd7
github.com/iotaledger/goshimmer/packages/tangle.(*CachedMessageMetadata).Consume(0xc003340de0, 0xc002924380, {0x0, 0x0, 0x0})
        /goshimmer/packages/tangle/message.go:1260 +0x91
github.com/iotaledger/goshimmer/packages/tangle.(*Booker).BookMessage.func1(0xc007afb200)
        /goshimmer/packages/tangle/booker.go:103 +0xf9
github.com/iotaledger/goshimmer/packages/tangle.(*CachedMessage).Consume.func1({0x1f3a300, 0xc007afb200})
        /goshimmer/packages/tangle/message.go:761 +0x36
github.com/iotaledger/hive.go/objectstorage.(*CachedObjectImpl).Consume(0xc00095de58, 0xc003340dd0, {0x0, 0x1622cc0, 0xc00ab86301})
        /go/pkg/mod/github.com/iotaledger/hive.go@v0.0.0-20211029111324-6d3d2fca5b4d/objectstorage/cached_object.go:132 +0xd7
github.com/iotaledger/goshimmer/packages/tangle.(*CachedMessage).Consume(0xc00095de90, 0xc002924340)
        /goshimmer/packages/tangle/message.go:760 +0x76
github.com/iotaledger/goshimmer/packages/tangle.(*Booker).BookMessage(0xc000117140, {0x7e, 0x7c, 0x2a, 0xb7, 0xb3, 0xa6, 0x2c, 0x1e, 0xaa, ...})
        /goshimmer/packages/tangle/booker.go:102 +0xf8
github.com/iotaledger/goshimmer/packages/tangle.(*Booker).run.func1()
        /goshimmer/packages/tangle/booker.go:82 +0x151
created by github.com/iotaledger/goshimmer/packages/tangle.(*Booker).run
        /goshimmer/packages/tangle/booker.go:77 +0x6f

Let me know, if I can provide more information.

Cheerio, Stephan

karimodm commented 2 years ago

I believe this is solved with the Marker simplification performed as part of #1460