Search code examples
gorevel

Revel doesn't start when i enable module.jobs


I get below error when i enable module.jobs in app.conf Tried redownloading the modules package.

Vendored in the cron package. no avail.

INFO 2017/05/01 18:51:12 main.go:32: Running revel server
panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
panic(0xbd1b00, 0xc4201e7c20)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)
/usr/local/go/src/reflect/value.go:1670 +0x224
github.com/company/project/vendor/github.com/revel/revel.findControllers(0x137d2c0, 0xcaba60, 0xc4202a26e0, 0x4, 0x10)
/root/git/go/src/github.com/company/project/vendor/github.com/revel/revel/controller.go:329 +0x9f2
github.com/company/projectvendor/github.com/revel/revel.RegisterController(0xca73e0, 0x0, 0xc420028118, 0x1, 0x1)
/root/git/go/src/github.com/company/project/vendor/github.com/revel/revel/controller.go:414 +0x219
main.main()
/root/git/go/src/github.com/company/project/web/app/tmp/main.go:90 +0xbd0

It doesn't even get to my init section of the app. The second I disable the module.jobs line in app.conf revel works fine.

EDIT Line 90

 revel.RegisterController((*controllers0.Jobs)(nil),
    []*revel.MethodType{
        &revel.MethodType{
            Name: "Status",
            Args: []*revel.MethodArg{
            },
            RenderArgNames: map[int][]string{
                28: []string{
                    "entries",
                },
            },
        },

    })

Solution

  • Apparently this was because i was vendoring in half of the packages. i didn't have the entire modules repo vendored in, after fixing that it worked.

    Jobs got enabled without having it in the config file though. all i had to do was create a jobs folder and a go file that had the job in it.