Run time error: Index out of range while login in as a admin

When I try to login as a admin with username admin and password admin I am facing error as

Error

<!DOCTYPE html> <html lang=“en”> <head> <meta charset=“utf-8”> <meta http-equiv=“X-UA-Compatible” content=“IE=edge,chrome=1”> <meta name=“viewport” content=“width=device-width”> <meta name=“theme-color” content="#000"> <title>Grafana - Error</title> <base href="/grafana/" /> <link rel=“stylesheet” href=“public/build/grafana…css?v”> <link rel=“icon” type=“image/png” href=“public/img/fav32.png”> <link rel=“mask-icon” href=“public/img/grafana_mask_icon.svg” color="#F05A28"> </head> <body class=“theme-”> <div class=“main-view”> <div class=“page-container”> <div class=“page-header”> <div class=“page-header__inner”> <span class=“page-header__logo”> <i class=“page-header__icon fa fa-frown-o”></i> </span> <div class=“page-header__info-block”> <h1 class=“page-header__title”> <a class=“text-link” href=“login”>Grafana</a><span> / Server Error</span><span></span> </h1> <div class=“page-header__sub-title”>Sadly something went wrong</div> </div> </div> </div> </div> <div class=“page-container page-body ng-scope” style=“padding: 2rem”> <div class=“alert”> <div class=“alert-icon”><i class=“fa fa-exclamation-triangle”></i></div> <div class=“alert-body”> <div class=“alert-title”>Server Error</div> </div> </div> <br /> <div style=“padding: 2rem 0 0”> <p>Check the Grafana server logs for the detailed error message.</p> </div> </div> </div> </body> </html>

In backend the log is

e[31mERORe[0m[09-10|05:37:53] Request error e[31mloggere[0m=context e[31muserIde[0m=107 e[31morgIde[0m=1 e[31munamee[0m=Yajana e[31merrore[0m=“runtime error: index out of range” e[31mstacke[0m="/usr/local/go/src/runtime/panic.go:505 (0x42ea66)\n/usr/local/go/src/runtime/panic.go:28 (0x42d844)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/session/file.go:118 (0x87602e)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/session/file.go:184 (0x8767e5)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/session/file.go:209 (0x876b8d)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/session/session.go:313 (0x878ed9)\n/go/src/github.com/grafana/grafana/pkg/services/session/session.go:128 (0x8d0edf)\n/go/src/github.com/grafana/grafana/pkg/api/login.go:150 (0xed5822)\n/go/src/github.com/grafana/grafana/pkg/api/login.go:121 (0xed53c9)\n/usr/local/go/src/runtime/asm_amd64.s:574 (0x45aac1)\n/usr/local/go/src/reflect/value.go:447 (0x4ce0cf)\n/usr/local/go/src/reflect/value.go:308 (0x4cd62a)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x7c98bb)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x7c9230)\n/go/src/github.com/grafana/grafana/pkg/api/common.go:37 (0xef6332)\n/usr/local/go/src/runtime/asm_amd64.s:573 (0x45aa31)\n/usr/local/go/src/reflect/value.go:447 (0x4ce0cf)\n/usr/local/go/src/reflect/value.go:308 (0x4cd62a)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x7c98bb)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x7c9230)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x7f6cd4)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x7f6bf5)\n/go/src/github.com/grafana/grafana/pkg/middleware/request_tracing.go:25 (0xad1676)\n/usr/local/go/src/runtime/asm_amd64.s:573 (0x45aa31)\n/usr/local/go/src/reflect/value.go:447 (0x4ce0cf)\n/usr/local/go/src/reflect/value.go:308 (0x4cd62a)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x7c98bb)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x7c9230)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x7f6cd4)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x7f6bf5)\n/go/src/github.com/grafana/grafana/pkg/middleware/request_metrics.go:17 (0xad0ffe)\n/usr/local/go/src/runtime/asm_amd64.s:573 (0x45aa31)\n/usr/local/go/src/reflect/value.go:447 (0x4ce0cf)\n/usr/local/go/src/reflect/value.go:308 (0x4cd62a)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x7c98bb)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x7c9230)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x7f6cd4)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x7f6bf5)\n/go/src/github.com/grafana/grafana/pkg/middleware/session.go:15 (0xad1878)\n/usr/local/go/src/runtime/asm_amd64.s:573 (0x45aa31)\n/usr/local/go/src/reflect/value.go:447 (0x4ce0cf)\n/usr/local/go/src/reflect/value.go:308 (0x4cd62a)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x7c98bb)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x7c9230)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x7f6cd4)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x7f6bf5)\n/go/src/github.com/grafana/grafana/pkg/middleware/recovery.go:146 (0xad0f17)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:79 (0x7f6ab7)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:157 (0x7c95cd)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:135 (0x7c9321)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x7f6cd4)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:112 (0x7f6bf5)\n/go/src/github.com/grafana/grafana/pkg/middleware/logger.go:34 (0xace878)\n/usr/local/go/src/runtime/asm_amd64.s:573 (0x45aa31)\n/usr/local/go/src/reflect/value.go:447 (0x4ce0cf)\n/usr/local/go/src/reflect/value.go:308 (0x4cd62a)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:177 (0x7c98bb)\n/go/src/github.com/grafana/grafana/vendor/github.com/go-macaron/inject/inject.go:137 (0x7c9230)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/context.go:121 (0x7f6cd4)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/router.go:187 (0x807758)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/router.go:294 (0x801f9b)\n/go/src/github.com/grafana/grafana/vendor/gopkg.in/macaron.v1/macaron.go:220 (0x7fb29b)\n/usr/local/go/src/net/http/server.go:2694 (0x699e52)\n/usr/local/go/src/net/http/server.go:1830 (0x696097)\n/usr/local/go/src/runtime/asm_amd64.s:2361 (0x45d2a0)\n"

`

Can somebody help me to solve this error

hello , have u solved this problem? i am looking for answer too!

@sunxinyuan Which version of Grafana are you running and could you please also paste the error from your Grafana logs (the part with a lot of filenames is what’s interesting)?

With that information, I could try to figure out what exactly is going wrong here, the original post from @yajana refers to files which has since then changed too much for that trace to be useful when debugging a recent version of Grafana :slight_smile: