Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-42463

Panic 'assignment to entry in nil map' observed if no settings passed

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      Build: 7.0.0 build 3594

      Create handler without setting 

      curl --location --request POST 'http://10.112.205.102:8096/api/v1/functions/test/' \
      --header 'Authorization: Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==' \
      --header 'Content-Type: application/json' \
      --data-raw '[
          {
              "appcode": "function OnUpdate(doc, meta) {\n    log('\''document'\'', doc);\n    dst_bucket[meta.id] = '\''hello world'\'';\n}\nfunction OnDelete(doc) {\n}",
              "depcfg": {
                  "buckets": [
                      {
                          "alias": "dst_bucket",
                          "bucket_name": "dst_bucket",
                          "scope_name": "dst_bucket",
                          "collection_name": "dst_bucket",
                          "access": "rw"
                      }
                  ],
                  "curl": [],
                  "source_bucket": "src_bucket",
                  "source_scope": "_default",
                  "source_collection": "_default",
                  "metadata_bucket": "metadata",
                  "metadata_scope": "_default",
                  "metadata_collection": "_default"
              },
              "appname": "test"
          }
      ]' 

       
      2020/11/03 11:19:08 http: panic serving 10.112.205.1:62646: assignment to entry in nil map
      2020/11/03 11:19:08 http: panic serving 10.112.205.1:62646: assignment to entry in nil mapgoroutine 39540 [running]:net/http.(*conn).serve.func1(0xc0006ea320) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/net/http/server.go:1767 +0x139panic(0x1445d40, 0x17400c0) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/runtime/panic.go:679 +0x1b2github.com/couchbase/eventing/service_manager.(*ServiceMgr).addDefaultTimerPartitionsIfMissing(...) /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/service_manager/http_handlers.go:3108github.com/couchbase/eventing/service_manager.(*ServiceMgr).functionsHandler(0xc000352000, 0x176a5a0, 0xc0007380e0, 0xc00072a600) /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/eventing/service_manager/http_handlers.go:2948 +0x4ec0net/http.HandlerFunc.ServeHTTP(0xc00032d8c0, 0x176a5a0, 0xc0007380e0, 0xc00072a600) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/net/http/server.go:2007 +0x44net/http.(*ServeMux).ServeHTTP(0xc00030cf80, 0x176a5a0, 0xc0007380e0, 0xc00072a600) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/net/http/server.go:2387 +0x1bdnet/http.serverHandler.ServeHTTP(0xc0000ea2a0, 0x176a5a0, 0xc0007380e0, 0xc00072a600) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/net/http/server.go:2802 +0xa4net/http.(*conn).serve(0xc0006ea320, 0x176df20, 0xc0027c5a00) /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/net/http/server.go:1890 +0x875created by net/http.(*Server).Serve /home/couchbase/.cbdepscache/exploded/x86_64/go-1.13.7/go/src/net/http/server.go:2928 +0x384 

      Expected: Appropriate error message with a list of all necessary settings. we should check for all the necessary settings and the rest of the setting should have default values. 

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vinayaka.kamath Vinayaka Kamath (Inactive)
            vikas.chaudhary Vikas Chaudhary
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty