qor-example
qor-example copied to clipboard
assetFS generates an error
Hi,
I have this stack trace at startup:
WARNING: AssetFS is used before overwrite it! goroutine 1 [running, locked to thread]: runtime/debug.Stack(0xc42000e018, 0xc42057fed0, 0x1) /usr/local/go/src/runtime/debug/stack.go:24 +0xa7 runtime/debug.PrintStack() /usr/local/go/src/runtime/debug/stack.go:16 +0x22 github.com/qor/assetfs.SetAssetFS(0x6a10390, 0x51294e0) /Users/arnaud/go/src/github.com/qor/assetfs/assetfs.go:33 +0xc3 github.com/qor/qor-example/config/bindatafs.init.0() /Users/arnaud/go/src/github.com/qor/qor-example/config/bindatafs/bindatafs.go:26 +0x5d github.com/qor/qor-example/config/bindatafs.init() <autogenerated>:1 +0x104 main.init() <autogenerated>:1 +0xbb
I've also seen this before, it's not super critical unless you compile with bindatafs and can't load templates etc.
I started to convert all the implicit package level init() {}
s to Init() error
s and call them manually to get better control over this.
I'm having the same issue and cannot load templates
Full error log :
Failed to find configuration config/application.yml, using example file config/application.example.yml Failed to find configuration config/smtp.yml, using example file config/smtp.example.yml WARNING: AssetFS is used before overwrite it!
goroutine 1 [running, locked to thread]: runtime/debug.Stack(0x0, 0x0, 0x0) /usr/lib/go/src/runtime/debug/stack.go:24 +0xb1 runtime/debug.PrintStack() /usr/lib/go/src/runtime/debug/stack.go:16 +0x22 github.com/qor/assetfs.SetAssetFS(0x7f1309fc10a0, 0x1b35100) /home/mauseruser/go/src/github.com/qor/assetfs/assetfs.go:33 +0x99 github.com/qor/qor-example/config/bindatafs.init.0() /home/mauseruser/go/src/github.com/qor/qor-example/config/bindatafs/bindatafs.go:26 +0x5d Failed to create unique index for translations key & locale, got: Error 1170: BLOB/TEXT column 'key' used in key specification without a key length
(Error 1170: BLOB/TEXT column 'key' used in key specification without a key length) [2018-09-03 20:12:10]
(Error 1071: Specified key was too long; max key length is 767 bytes) [2018-09-03 20:12:10]
(Error 1071: Specified key was too long; max key length is 767 bytes)
[2018-09-03 20:12:10]
Enterprise features not enabled...
Listening on: 7000
Hi,
WARNING: AssetFS is used before overwrite it!
Reorder qor-example/main.go imports like that:
package main
import "github.com/qor/qor-example/config/bindatafs"
import (
"context"
"flag"
...
...
Failed to create unique index for translations key & locale, got: Error 1170: BLOB/TEXT column 'key' used in key specification without a key length
Change the type of the "key" column to VARCHAR(500) on translations table.
Hint: Don't try to migrate db for every startup(go run main.go). Control it by a required/notrequired switch. Because it causes a delay ~75sec on startup.