Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3056

v1.13.0 introduces panics and thus breaking change 

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Context

      v1.13.0 introduces panics and thus breaking change, i reverted to v1.12.1 and it works normally again.
      Error message is: `interface conversion: interface is nil, not bsoncodec.ValueEncoder`

      location of panic: https://github.com/mongodb/mongo-go-driver/compare/v1.12.2...v1.13.0#diff-47bf0c01e00c33986c6fe19d7b1aaee2df975f5b2aad923a29f07192fda9cb05R45 

      ```
      goroutine 292 [running]:
      runtime/debug.Stack()
      /usr/local/go/src/runtime/debug/stack.go:24 +0x5e
      github.com/adhocore/module/web.errlogc(0xc00090a480, {0xc0004bdb58?, 0x1, 0xc000000b40?})
      ~/projects/my/module/web/helper.go:297 +0xcc
      github.com/adhocore/module/web.errlog(0xc18500?, {0xc0004bdb58, 0x1, 0x1})
      ~/projects/my/module/web/helper.go:282 +0x39
      github.com/adhocore/module/web.errorx(0xc000209800, {0x7f77785800b8?, 0xc000300390})
      ~/projects/my/module/web/helper.go:175 +0x66e
      github.com/adhocore/module/web.bootstrap.func2(0x10?, {0xc17300?, 0xc000300390?})
      ~/projects/my/module/web/app.go:150 +0x3e
      github.com/adhocore/module/web.bootstrap.New.func3.1()
      ~/go/pkg/mod/github.com/gofiber/fiber/v2@v2.51.0/middleware/recover/recover.go:31 +0x72
      panic({0xc17300?, 0xc000300390?})
      /usr/local/go/src/runtime/panic.go:914 +0x21f
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*typeEncoderCache).LoadOrStore(...)
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/codec_cache.go:45
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*Registry).storeTypeEncoder(0xc00032e2a0?, {0xf48e88?, 0xc17100?}, {0x0, 0x0})
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/registry.go:416 +0x77
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*Registry).LookupEncoder(0xc00032e2a0, {0xf48e88, 0xc17100})
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/registry.go:411 +0x1fa
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).describeStructSlow(0xc0001db4c0, 0xcc0380?, {0xf48e88, 0xcce820}, 0x0, 0x0)
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/struct_codec.go:515 +0x225
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).describeStruct(0xc0001db4c0, 0x1c?, {0xf48e88?, 0xcce820}, 0x53?, 0x5c?)
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/struct_codec.go:483 +0x9a
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).DecodeValue(0xc0001db4c0, {0xc00032e2a0, 0x0,

      {0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0, 0x0, ...}, ...)
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/struct_codec.go:282 +0x111
      go.mongodb.org/mongo-driver/bson/bsoncodec.(*PointerCodec).DecodeValue(0xc0001db500, {0xc00032e2a0, 0x0, {0x0, 0x0}

      , {0x0, 0x0}, 0x0, 0x0, 0x0, ...}, ...)
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/pointer_codec.go:91 +0x2ab
      go.mongodb.org/mongo-driver/bson.(*Decoder).Decode(0xc0006a00f0, {0xbc92a0, 0xc0003e8108})
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/decoder.go:134 +0x3e3
      go.mongodb.org/mongo-driver/mongo.(*Cursor).Decode(0x7f777857e6b0?, {0xbc92a0, 0xc0003e8108})
      ~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/mongo/cursor.go:275 +0x8e
      github.com/adhocore/module/model.(*Scrip).fromCursor(0xc00035e1c0, 0xf40328?)
      ~/projects/my/module/model/scrip.go:150 +0x6b
      github.com/adhocore/module/model.(*Stocks).loadScrips(0xc000aaac60, 0x0, {0x0, 0x0, 0x0})
      ~/projects/my/module/model/stocks.go:234 +0x2a9
      ```

      Definition of done

      What must be done to consider the task complete?

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            qingyang.hu@mongodb.com Qingyang Hu
            Reporter:
            jiten.adhikary@gmail.com Jitendra Adhikari
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: