gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.07k stars 573 forks source link

securecookie: hash key is not set Error #1073

Closed garritfra closed 6 years ago

garritfra commented 6 years ago

Steps to Reproduce the Problem

  1. go get -u -v -tags sqlite github.com/gobuffalo/buffalo/buffalo
  2. buffalo create --db-type sqlite3
  3. buffalo db create -a
  4. buffalo dev

Expected Behavior

The Server spins up correctly and without any errors

Actual Behavior

I get the following error trace: securecookie: hash key is not set

I figured this has something to do with securecookie by gorilla, but still i have no clue how to fix this issue.

Context

``` T: %!s(i18n.TranslateFunc=0x45e12f0) asciffy: %!s(func(string) string=0x43c0080) assetPath: %!s(func(string) (string, error)=0x4594040) authenticity_token: o0N1H7HOQRUTMRp0H/k9pRpkFDcWuvctkt1td5fQj9Q= between: %!s(func(int, int) plush.Iterator=0x444bfb0) camelize: %!s(func(string) string=0x43bfba0) camelize_down_first: %!s(func(string) string=0x43bfc10) capitalize: %!s(func(string) string=0x43bfb30) contentFor: %!s(func(string, plush.HelperContext) (template.HTML, error)=0x4449d10) contentOf: %!s(func(string, plush.HelperContext) template.HTML=0x4449e50) contentType: text/html current_path: / current_route: { "method": "GET", "path": "/", "handler": "github.com/garritfra/hello_buffalo/actions.HomeHandler", "pathName": "rootPath", "aliases": [] } current_template: index.html dasherize: %!s(func(string) string=0x43bffa0) debug: %!s(func(interface {}) template.HTML=0x444b940) downcase: %!s(func(string) string=0x41435b0) env: development envOr: %!s(func(string, string) string=0x42e7f90) flash: map[] form: %!s(func(tags.Options, plush.HelperContext) (template.HTML, error)=0x444a540) form_for: %!s(func(interface {}, tags.Options, plush.HelperContext) (template.HTML, error)=0x444a5e0) groupBy: %!s(func(int, interface {}) (*plush.groupBy, error)=0x444c090) htmlEscape: %!s(func(string, plush.HelperContext) (string, error)=0x444bad0) humanize: %!s(func(string) string=0x43bfd60) imgTag: %!s(func(string, tags.Options) (template.HTML, error)=0x45940f0) inspect: %!s(func(interface {}) string=0x444ba30) javascriptTag: %!s(func(string, tags.Options) (template.HTML, error)=0x45940f0) jsEscape: %!s(func(string) string=0x431e300) json: %!s(func(interface {}) (template.HTML, error)=0x444b7b0) languages: [de-DE de en-CA en en-US en-US] len: %!s(func(interface {}) int=0x444b890) markdown: %!s(func(string, plush.HelperContext) (template.HTML, error)=0x444c680) method: GET ordinalize: %!s(func(string) string=0x43c0010) paginator: %!s(func(*pop.Paginator, map[string]interface {}, plush.HelperContext) (template.HTML, error)=0x4593c40) parameterize: %!s(func(string) string=0x43bfe40) params: map[] partial: %!s(func(string, render.Data) (template.HTML, error)=0x4594690) pluralize: %!s(func(string) string=0x43bf9e0) pluralize_with_size: %!s(func(string, int) string=0x43bfa50) range: %!s(func(int, int) plush.Iterator=0x444bf40) raw: %!s(func(string) template.HTML=0x444d9e0) request: &{GET / HTTP/1.1 %!s(int=1) %!s(int=1) map[Connection:[keep-alive] Cache-Control:[max-age=0] Upgrade-Insecure-Requests:[1] User-Agent:[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36] Accept:[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8] Accept-Language:[de-DE,de;q=0.9,en-CA;q=0.8,en;q=0.7,en-US;q=0.6] Cookie:[username-localhost-8888="2|1:0|10:1526146027|23:username-localhost-8888|44:MWY3NWM1YzA4ODc3NGI0ZmE2NTYwNWM2NjI4NjNlYjU=|fbcaa5e492d70cd0f7b6699c3b46204f213e485f7d009fbac0ef26d9d633aab3"; _xsrf=2|43e41d15|f3ebf20d21f9e16614fc6a6c12dc8d01|1526146027] Accept-Encoding:[gzip, deflate, br]] {} %!s(func() (io.ReadCloser, error)=) %!s(int64=0) [] %!s(bool=false) localhost:3000 map[] map[] %!s(*multipart.Form=) map[] 127.0.0.1:57827 / %!s(*tls.ConnectionState=) %!s(<-chan struct {}=) %!s(*http.Response=) %!s(*context.valueCtx=&{0xc4201b3e90 1 0xc4203862d0})} request_id: 8075766137-0b9d0486f4 session: &{%!s(*sessions.Session=&{ map[authenticity_token:[84 82 250 123 95 90 223 167 124 32 97 85 38 17 133 183 81 204 231 247 91 228 164 102 147 52 25 243 213 152 225 242] _flash_:[123 125] requestor_id:8075766137] 0xc4203f4000 true 0xc42036e340 _hello_buffalo_session}) %!s(*http.Request=&{GET 0xc42032e480 HTTP/1.1 1 1 map[Accept-Encoding:[gzip, deflate, br] Accept-Language:[de-DE,de;q=0.9,en-CA;q=0.8,en;q=0.7,en-US;q=0.6] Cookie:[username-localhost-8888="2|1:0|10:1526146027|23:username-localhost-8888|44:MWY3NWM1YzA4ODc3NGI0ZmE2NTYwNWM2NjI4NjNlYjU=|fbcaa5e492d70cd0f7b6699c3b46204f213e485f7d009fbac0ef26d9d633aab3"; _xsrf=2|43e41d15|f3ebf20d21f9e16614fc6a6c12dc8d01|1526146027] Connection:[keep-alive] Cache-Control:[max-age=0] Upgrade-Insecure-Requests:[1] User-Agent:[Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36] Accept:[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8]] {} 0 [] false localhost:3000 map[] map[] map[] 127.0.0.1:57827 / 0xc4201b3ec0}) %!s(*buffalo.Response=&{500 6953 0xc4203f0000})} singularize: %!s(func(string) string=0x43bfac0) status: %!s(int=200) stylesheetTag: %!s(func(string, tags.Options) (template.HTML, error)=0x45940f0) t: %!s(func(string, ...interface {}) string=0x45e27e0) tableize: %!s(func(string) string=0x43bfdd0) truncate: %!s(func(string, map[string]interface {}) string=0x444bbb0) tx: /Users/garritfra/Documents/dev/go/src/github.com/garritfra/hello_buffalo_development.sqlite?_busy_timeout=5000 typeify: %!s(func(string) string=0x43bff30) underscore: %!s(func(string) string=0x43bfcf0) until: %!s(func(int) plush.Iterator=0x444c020) upcase: %!s(func(string) string=0x4143450) yield: Buffalo - Hello Buffalo

Welcome to Buffalo (EN) [v0.11.1]

https://github.com/gobuffalo/buffalo

Documentation

Defined Routes

METHOD PATH NAME HANDLER
GET / rootPath github.com/garritfra/hello_buffalo/actions.HomeHandler
GET /widgets widgetsPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.List
POST /widgets widgetsPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.Create
GET /widgets/new newWidgetsPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.New
GET /widgets/{widget_id} widgetPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.Show
PUT /widgets/{widget_id} widgetPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.Update
DELETE /widgets/{widget_id} widgetPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.Destroy
GET /widgets/{widget_id}/edit editWidgetPath github.com/garritfra/hello_buffalo/actions.WidgetsResource.Edit
Powered by gobuffalo.io
```

Headers

´´´ Accept-Language: [de-DE,de;q=0.9,en-CA;q=0.8,en;q=0.7,en-US;q=0.6] Accept: [text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8] Cache-Control: [max-age=0] Connection: [keep-alive] Cookie: [username-localhost-8888="2|1:0|10:1526146027|23:username-localhost-8888|44:MWY3NWM1YzA4ODc3NGI0ZmE2NTYwNWM2NjI4NjNlYjU=|fbcaa5e492d70cd0f7b6699c3b46204f213e485f7d009fbac0ef26d9d633aab3"; _xsrf=2|43e41d15|f3ebf20d21f9e16614fc6a6c12dc8d01|1526146027] Upgrade-Insecure-Requests: [1] User-Agent: [Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36] ´´´

Info

Please run buffalo info and paste the information below where it says "PASTE_HERE".

``` ### Buffalo Version v0.11.1 ### App Information Pwd=/Users/garritfra/Documents/dev/go/src/github.com/garritfra/hello_buffalo Root=/Users/garritfra/Documents/dev/go/src/github.com/garritfra/hello_buffalo GoPath=/Users/garritfra/Documents/dev/go Name=hello_buffalo Bin=bin/hello_buffalo PackagePkg=github.com/garritfra/hello_buffalo ActionsPkg=github.com/garritfra/hello_buffalo/actions ModelsPkg=github.com/garritfra/hello_buffalo/models GriftsPkg=github.com/garritfra/hello_buffalo/grifts VCS=git WithPop=true WithDep=false WithWebpack=true WithYarn=false WithDocker=true WithGrifts=true ### Go Version go version go1.10.2 darwin/amd64 ### Go Env GOARCH="amd64" GOBIN="" GOCACHE="/Users/garritfra/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/garritfra/Documents/dev/go" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8_/2vlm_82n4g30sjv9py30x9wc0000gn/T/go-build143983300=/tmp/go-build -gno-record-gcc-switches -fno-common" ### Node Version v8.9.4 ### NPM Version 5.6.0 ╭─────────────────────────────────────╮ │ │ │ Update available 5.6.0 → 6.0.1 │ │ Run npm i -g npm to update │ │ │ ╰─────────────────────────────────────╯ ### Yarn Version 1.3.2 ### PostgreSQL Version PostgreSQL Not Found ### MySQL Version MySQL Not Found ### SQLite Version 3.19.3 2017-06-27 16:48:08 2b0954060fe10d6de6d479287dd88890f1bef6cc1beca11bc6cdb79f72e2377b ### Dep Version dep Not Found ### Dep Status dep Not Found ```
markbates commented 6 years ago

Duplicate of #1067