Skip to content

segment builder fields not working #75

Description

@devilankur18

While creating a new segment, if any field is added, the query to validate it fails, also if its saved by mistake, it completely crashed the beam_segments server, until that segment record is deleted.

I am attached all the information below. Please help me fix the issue.

Crash log at the beam_segments after adding the key value in the fields.


beam_segments_1       | 2020/07/14 13:14:31 [INFO] params req_id=pKwh7hOPno-86 table_name=users
beam_segments_1       | 2020/07/14 13:14:31 [INFO] payload req_id=pKwh7hOPno-86 raw={"criteria":{"nodes":[{"nodes":[{"key":"pageview","negation":false,"type":"criteria","values":{"action":"load","count":{"gte":10},"fields":["utm_campaign: ele2020"],"timespan":{"interval":{"lt":{"unit":"day","value":-30}},"type":"interval"}}}],"operator":"AND","type":"operator"}],"version":"1"},"table_name":"users"}
beam_segments_1       | 2020/07/14 13:14:31 key: fields, v: [utm_campaign: ele2020]
beam_segments_1       | 2020/07/14 13:14:31 [EROR] uncaught error req_id=pKwh7hOPno-86 err=panic: interface conversion: interface {} is []interface {}, not map[string]interface {}
beam_segments_1       | panic(0xae1840, 0xc0003a71d0)
beam_segments_1       |         /usr/local/go/src/runtime/panic.go:679 +0x1b2
beam_segments_1       | github.com/remp2020/remp/Beam/go/model.(*SegmentDB).BuildRules(0xc000204180, 0xc0002d6d80, 0x11b, 0x120, 0xc0000e85a0, 0x11b, 0x0, 0xc000470b00)
beam_segments_1       |         /go/src/github.com/remp2020/remp/Beam/go/model/segment_builder.go:159 +0x1ce6
beam_segments_1       | github.com/remp2020/remp/Beam/go/cmd/segments/controller.(*SegmentController).Count(0xc000277280, 0xc0003a6e10, 0xc7d2c8, 0xb889c0)
beam_segments_1       |         /go/src/github.com/remp2020/remp/Beam/go/cmd/segments/controller/segment.go:183 +0x24c
beam_segments_1       | github.com/remp2020/remp/Beam/go/cmd/segments/app.MountSegmentsController.func3(0xc975c0, 0xc0003a6de0, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0xc975c0, 0xc0003a6de0)
beam_segments_1       |         /go/src/github.com/remp2020/remp/Beam/go/cmd/segments/app/controllers.go:1034 +0x16d
beam_segments_1       | github.com/remp2020/remp/Beam/go/cmd/segments/app.handleSegmentsOrigin.func1(0xc975c0, 0xc0003a6de0, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0x42ce6a, 0x0)
beam_segments_1       |         /go/src/github.com/remp2020/remp/Beam/go/cmd/segments/app/controllers.go:1183 +0x3a8
beam_segments_1       | github.com/goadesign/goa.(*Controller).MuxHandler.func1.1(0xc975c0, 0xc0003a6ba0, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0xc000117320, 0x4e0e8a)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/service.go:254 +0xc9
beam_segments_1       | github.com/goadesign/goa/middleware.Recover.func1.1(0xc975c0, 0xc0003a6ba0, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0x0, 0x0)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/middleware/recover.go:37 +0xb2
beam_segments_1       | github.com/goadesign/goa/middleware.ErrorHandler.func1.1(0xc975c0, 0xc0003a6ba0, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0x7e73ed, 0xc000470c80)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/middleware/error_handler.go:21 +0x96
beam_segments_1       | github.com/goadesign/goa/middleware.LogResponse.func1.1(0xc975c0, 0xc0003a6ba0, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0x2, 0x2)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/middleware/log_response.go:39 +0x15d
beam_segments_1       | github.com/goadesign/goa/middleware.LogRequest.func1.1(0xc975c0, 0xc0003a6b70, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0xc00046c240, 0xc975c0)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/middleware/log_request.go:75 +0xc81
beam_segments_1       | github.com/goadesign/goa/middleware.RequestIDWithHeaderAndLengthLimit.func1.1(0xc975c0, 0xc0003a6990, 0xc94ac0, 0xc0004f2c40, 0xc000168300, 0x0, 0xc975c0)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/middleware/request_id.go:63 +0x130
beam_segments_1       | github.com/goadesign/goa.(*Controller).MuxHandler.func1(0xc95080, 0xc0003b4540, 0xc000168300, 0xc0003a6900)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/service.go:287 +0x39a
beam_segments_1       | github.com/goadesign/goa.(*mux).Handle.func1(0xc95080, 0xc0003b4540, 0xc000168300, 0x0)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/mux.go:59 +0x1c5
beam_segments_1       | github.com/dimfeld/httptreemux.(*TreeMux).ServeLookupResult(0xc0001aa000, 0xc95080, 0xc0003b4540, 0xc000168300, 0xc8, 0xc00039e980, 0x0, 0x0)
beam_segments_1       |         /go/pkg/mod/github.com/dimfeld/httptreemux@v4.0.0+incompatible/router.go:237 +0xe8
beam_segments_1       | github.com/dimfeld/httptreemux.(*TreeMux).ServeHTTP(0xc0001aa000, 0xc95080, 0xc0003b4540, 0xc000168300)
beam_segments_1       |         /go/pkg/mod/github.com/dimfeld/httptreemux@v4.0.0+incompatible/router.go:258 +0x109
beam_segments_1       | github.com/goadesign/goa.(*mux).ServeHTTP(0xc00001e040, 0xc95080, 0xc0003b4540, 0xc000168300)
beam_segments_1       |         /go/pkg/mod/github.com/goadesign/goa@v1.2.0/mux.go:85 +0x4c
beam_segments_1       | net/http.serverHandler.ServeHTTP(0xc0002c22a0, 0xc95080, 0xc0003b4540, 0xc000168300)
beam_segments_1       |         /usr/local/go/src/net/http/server.go:2802 +0xa4
beam_segments_1       | net/http.(*conn).serve(0xc00026e320, 0xc97500, 0xc0004f2b40)
beam_segments_1       |         /usr/local/go/src/net/http/server.go:1890 +0x875
beam_segments_1       | created by net/http.(*Server).Serve
beam_segments_1       |         /usr/local/go/src/net/http/server.go:2928 +0x384

Screenshot
Screenshot 2020-07-14 at 6 40 39 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions