migrations.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import (
  6. "bytes"
  7. "encoding/json"
  8. "fmt"
  9. "io/ioutil"
  10. "os"
  11. "path"
  12. "path/filepath"
  13. "strings"
  14. "time"
  15. "github.com/Unknwon/com"
  16. "github.com/go-xorm/xorm"
  17. gouuid "github.com/satori/go.uuid"
  18. "gopkg.in/ini.v1"
  19. "github.com/gogits/gogs/modules/base"
  20. "github.com/gogits/gogs/modules/log"
  21. "github.com/gogits/gogs/modules/setting"
  22. )
  23. const _MIN_DB_VER = 4
  24. type Migration interface {
  25. Description() string
  26. Migrate(*xorm.Engine) error
  27. }
  28. type migration struct {
  29. description string
  30. migrate func(*xorm.Engine) error
  31. }
  32. func NewMigration(desc string, fn func(*xorm.Engine) error) Migration {
  33. return &migration{desc, fn}
  34. }
  35. func (m *migration) Description() string {
  36. return m.description
  37. }
  38. func (m *migration) Migrate(x *xorm.Engine) error {
  39. return m.migrate(x)
  40. }
  41. // The version table. Should have only one row with id==1
  42. type Version struct {
  43. Id int64
  44. Version int64
  45. }
  46. // This is a sequence of migrations. Add new migrations to the bottom of the list.
  47. // If you want to "retire" a migration, remove it from the top of the list and
  48. // update _MIN_VER_DB accordingly
  49. var migrations = []Migration{
  50. NewMigration("fix locale file load panic", fixLocaleFileLoadPanic), // V4 -> V5:v0.6.0
  51. NewMigration("trim action compare URL prefix", trimCommitActionAppUrlPrefix), // V5 -> V6:v0.6.3
  52. NewMigration("generate issue-label from issue", issueToIssueLabel), // V6 -> V7:v0.6.4
  53. NewMigration("refactor attachment table", attachmentRefactor), // V7 -> V8:v0.6.4
  54. NewMigration("rename pull request fields", renamePullRequestFields), // V8 -> V9:v0.6.16
  55. NewMigration("clean up migrate repo info", cleanUpMigrateRepoInfo), // V9 -> V10:v0.6.20
  56. NewMigration("generate rands and salt for organizations", generateOrgRandsAndSalt), // V10 -> V11:v0.8.5
  57. NewMigration("convert date to unix timestamp", convertDateToUnix), // V11 -> V12:v0.9.2
  58. }
  59. // Migrate database to current version
  60. func Migrate(x *xorm.Engine) error {
  61. if err := x.Sync(new(Version)); err != nil {
  62. return fmt.Errorf("sync: %v", err)
  63. }
  64. currentVersion := &Version{Id: 1}
  65. has, err := x.Get(currentVersion)
  66. if err != nil {
  67. return fmt.Errorf("get: %v", err)
  68. } else if !has {
  69. // If the version record does not exist we think
  70. // it is a fresh installation and we can skip all migrations.
  71. currentVersion.Version = int64(_MIN_DB_VER + len(migrations))
  72. if _, err = x.InsertOne(currentVersion); err != nil {
  73. return fmt.Errorf("insert: %v", err)
  74. }
  75. }
  76. v := currentVersion.Version
  77. if _MIN_DB_VER > v {
  78. log.Fatal(4, `Gogs no longer supports auto-migration from your previously installed version.
  79. Please try to upgrade to a lower version (>= v0.6.0) first, then upgrade to current version.`)
  80. return nil
  81. }
  82. if int(v-_MIN_DB_VER) > len(migrations) {
  83. // User downgraded Gogs.
  84. currentVersion.Version = int64(len(migrations) + _MIN_DB_VER)
  85. _, err = x.Id(1).Update(currentVersion)
  86. return err
  87. }
  88. for i, m := range migrations[v-_MIN_DB_VER:] {
  89. log.Info("Migration: %s", m.Description())
  90. if err = m.Migrate(x); err != nil {
  91. return fmt.Errorf("do migrate: %v", err)
  92. }
  93. currentVersion.Version = v + int64(i) + 1
  94. if _, err = x.Id(1).Update(currentVersion); err != nil {
  95. return err
  96. }
  97. }
  98. return nil
  99. }
  100. func sessionRelease(sess *xorm.Session) {
  101. if !sess.IsCommitedOrRollbacked {
  102. sess.Rollback()
  103. }
  104. sess.Close()
  105. }
  106. func fixLocaleFileLoadPanic(_ *xorm.Engine) error {
  107. cfg, err := ini.Load(setting.CustomConf)
  108. if err != nil {
  109. return fmt.Errorf("load custom config: %v", err)
  110. }
  111. cfg.DeleteSection("i18n")
  112. if err = cfg.SaveTo(setting.CustomConf); err != nil {
  113. return fmt.Errorf("save custom config: %v", err)
  114. }
  115. setting.Langs = strings.Split(strings.Replace(strings.Join(setting.Langs, ","), "fr-CA", "fr-FR", 1), ",")
  116. return nil
  117. }
  118. func trimCommitActionAppUrlPrefix(x *xorm.Engine) error {
  119. type PushCommit struct {
  120. Sha1 string
  121. Message string
  122. AuthorEmail string
  123. AuthorName string
  124. }
  125. type PushCommits struct {
  126. Len int
  127. Commits []*PushCommit
  128. CompareUrl string
  129. }
  130. type Action struct {
  131. ID int64 `xorm:"pk autoincr"`
  132. Content string `xorm:"TEXT"`
  133. }
  134. results, err := x.Query("SELECT `id`,`content` FROM `action` WHERE `op_type`=?", 5)
  135. if err != nil {
  136. return fmt.Errorf("select commit actions: %v", err)
  137. }
  138. sess := x.NewSession()
  139. defer sessionRelease(sess)
  140. if err = sess.Begin(); err != nil {
  141. return err
  142. }
  143. var pushCommits *PushCommits
  144. for _, action := range results {
  145. actID := com.StrTo(string(action["id"])).MustInt64()
  146. if actID == 0 {
  147. continue
  148. }
  149. pushCommits = new(PushCommits)
  150. if err = json.Unmarshal(action["content"], pushCommits); err != nil {
  151. return fmt.Errorf("unmarshal action content[%d]: %v", actID, err)
  152. }
  153. infos := strings.Split(pushCommits.CompareUrl, "/")
  154. if len(infos) <= 4 {
  155. continue
  156. }
  157. pushCommits.CompareUrl = strings.Join(infos[len(infos)-4:], "/")
  158. p, err := json.Marshal(pushCommits)
  159. if err != nil {
  160. return fmt.Errorf("marshal action content[%d]: %v", actID, err)
  161. }
  162. if _, err = sess.Id(actID).Update(&Action{
  163. Content: string(p),
  164. }); err != nil {
  165. return fmt.Errorf("update action[%d]: %v", actID, err)
  166. }
  167. }
  168. return sess.Commit()
  169. }
  170. func issueToIssueLabel(x *xorm.Engine) error {
  171. type IssueLabel struct {
  172. ID int64 `xorm:"pk autoincr"`
  173. IssueID int64 `xorm:"UNIQUE(s)"`
  174. LabelID int64 `xorm:"UNIQUE(s)"`
  175. }
  176. issueLabels := make([]*IssueLabel, 0, 50)
  177. results, err := x.Query("SELECT `id`,`label_ids` FROM `issue`")
  178. if err != nil {
  179. if strings.Contains(err.Error(), "no such column") ||
  180. strings.Contains(err.Error(), "Unknown column") {
  181. return nil
  182. }
  183. return fmt.Errorf("select issues: %v", err)
  184. }
  185. for _, issue := range results {
  186. issueID := com.StrTo(issue["id"]).MustInt64()
  187. // Just in case legacy code can have duplicated IDs for same label.
  188. mark := make(map[int64]bool)
  189. for _, idStr := range strings.Split(string(issue["label_ids"]), "|") {
  190. labelID := com.StrTo(strings.TrimPrefix(idStr, "$")).MustInt64()
  191. if labelID == 0 || mark[labelID] {
  192. continue
  193. }
  194. mark[labelID] = true
  195. issueLabels = append(issueLabels, &IssueLabel{
  196. IssueID: issueID,
  197. LabelID: labelID,
  198. })
  199. }
  200. }
  201. sess := x.NewSession()
  202. defer sessionRelease(sess)
  203. if err = sess.Begin(); err != nil {
  204. return err
  205. }
  206. if err = sess.Sync2(new(IssueLabel)); err != nil {
  207. return fmt.Errorf("sync2: %v", err)
  208. } else if _, err = sess.Insert(issueLabels); err != nil {
  209. return fmt.Errorf("insert issue-labels: %v", err)
  210. }
  211. return sess.Commit()
  212. }
  213. func attachmentRefactor(x *xorm.Engine) error {
  214. type Attachment struct {
  215. ID int64 `xorm:"pk autoincr"`
  216. UUID string `xorm:"uuid INDEX"`
  217. // For rename purpose.
  218. Path string `xorm:"-"`
  219. NewPath string `xorm:"-"`
  220. }
  221. results, err := x.Query("SELECT * FROM `attachment`")
  222. if err != nil {
  223. return fmt.Errorf("select attachments: %v", err)
  224. }
  225. attachments := make([]*Attachment, 0, len(results))
  226. for _, attach := range results {
  227. if !com.IsExist(string(attach["path"])) {
  228. // If the attachment is already missing, there is no point to update it.
  229. continue
  230. }
  231. attachments = append(attachments, &Attachment{
  232. ID: com.StrTo(attach["id"]).MustInt64(),
  233. UUID: gouuid.NewV4().String(),
  234. Path: string(attach["path"]),
  235. })
  236. }
  237. sess := x.NewSession()
  238. defer sessionRelease(sess)
  239. if err = sess.Begin(); err != nil {
  240. return err
  241. }
  242. if err = sess.Sync2(new(Attachment)); err != nil {
  243. return fmt.Errorf("Sync2: %v", err)
  244. }
  245. // Note: Roll back for rename can be a dead loop,
  246. // so produces a backup file.
  247. var buf bytes.Buffer
  248. buf.WriteString("# old path -> new path\n")
  249. // Update database first because this is where error happens the most often.
  250. for _, attach := range attachments {
  251. if _, err = sess.Id(attach.ID).Update(attach); err != nil {
  252. return err
  253. }
  254. attach.NewPath = path.Join(setting.AttachmentPath, attach.UUID[0:1], attach.UUID[1:2], attach.UUID)
  255. buf.WriteString(attach.Path)
  256. buf.WriteString("\t")
  257. buf.WriteString(attach.NewPath)
  258. buf.WriteString("\n")
  259. }
  260. // Then rename attachments.
  261. isSucceed := true
  262. defer func() {
  263. if isSucceed {
  264. return
  265. }
  266. dumpPath := path.Join(setting.LogRootPath, "attachment_path.dump")
  267. ioutil.WriteFile(dumpPath, buf.Bytes(), 0666)
  268. fmt.Println("Fail to rename some attachments, old and new paths are saved into:", dumpPath)
  269. }()
  270. for _, attach := range attachments {
  271. if err = os.MkdirAll(path.Dir(attach.NewPath), os.ModePerm); err != nil {
  272. isSucceed = false
  273. return err
  274. }
  275. if err = os.Rename(attach.Path, attach.NewPath); err != nil {
  276. isSucceed = false
  277. return err
  278. }
  279. }
  280. return sess.Commit()
  281. }
  282. func renamePullRequestFields(x *xorm.Engine) (err error) {
  283. type PullRequest struct {
  284. ID int64 `xorm:"pk autoincr"`
  285. PullID int64 `xorm:"INDEX"`
  286. PullIndex int64
  287. HeadBarcnh string
  288. IssueID int64 `xorm:"INDEX"`
  289. Index int64
  290. HeadBranch string
  291. }
  292. if err = x.Sync(new(PullRequest)); err != nil {
  293. return fmt.Errorf("sync: %v", err)
  294. }
  295. results, err := x.Query("SELECT `id`,`pull_id`,`pull_index`,`head_barcnh` FROM `pull_request`")
  296. if err != nil {
  297. if strings.Contains(err.Error(), "no such column") {
  298. return nil
  299. }
  300. return fmt.Errorf("select pull requests: %v", err)
  301. }
  302. sess := x.NewSession()
  303. defer sessionRelease(sess)
  304. if err = sess.Begin(); err != nil {
  305. return err
  306. }
  307. var pull *PullRequest
  308. for _, pr := range results {
  309. pull = &PullRequest{
  310. ID: com.StrTo(pr["id"]).MustInt64(),
  311. IssueID: com.StrTo(pr["pull_id"]).MustInt64(),
  312. Index: com.StrTo(pr["pull_index"]).MustInt64(),
  313. HeadBranch: string(pr["head_barcnh"]),
  314. }
  315. if pull.Index == 0 {
  316. continue
  317. }
  318. if _, err = sess.Id(pull.ID).Update(pull); err != nil {
  319. return err
  320. }
  321. }
  322. return sess.Commit()
  323. }
  324. func cleanUpMigrateRepoInfo(x *xorm.Engine) (err error) {
  325. type (
  326. User struct {
  327. ID int64 `xorm:"pk autoincr"`
  328. LowerName string
  329. }
  330. Repository struct {
  331. ID int64 `xorm:"pk autoincr"`
  332. OwnerID int64
  333. LowerName string
  334. }
  335. )
  336. repos := make([]*Repository, 0, 25)
  337. if err = x.Where("is_mirror=?", false).Find(&repos); err != nil {
  338. return fmt.Errorf("select all non-mirror repositories: %v", err)
  339. }
  340. var user *User
  341. for _, repo := range repos {
  342. user = &User{ID: repo.OwnerID}
  343. has, err := x.Get(user)
  344. if err != nil {
  345. return fmt.Errorf("get owner of repository[%d - %d]: %v", repo.ID, repo.OwnerID, err)
  346. } else if !has {
  347. continue
  348. }
  349. configPath := filepath.Join(setting.RepoRootPath, user.LowerName, repo.LowerName+".git/config")
  350. // In case repository file is somehow missing.
  351. if !com.IsFile(configPath) {
  352. continue
  353. }
  354. cfg, err := ini.Load(configPath)
  355. if err != nil {
  356. return fmt.Errorf("open config file: %v", err)
  357. }
  358. cfg.DeleteSection("remote \"origin\"")
  359. if err = cfg.SaveToIndent(configPath, "\t"); err != nil {
  360. return fmt.Errorf("save config file: %v", err)
  361. }
  362. }
  363. return nil
  364. }
  365. func generateOrgRandsAndSalt(x *xorm.Engine) (err error) {
  366. type User struct {
  367. ID int64 `xorm:"pk autoincr"`
  368. Rands string `xorm:"VARCHAR(10)"`
  369. Salt string `xorm:"VARCHAR(10)"`
  370. }
  371. orgs := make([]*User, 0, 10)
  372. if err = x.Where("type=1").And("rands=''").Find(&orgs); err != nil {
  373. return fmt.Errorf("select all organizations: %v", err)
  374. }
  375. sess := x.NewSession()
  376. defer sessionRelease(sess)
  377. if err = sess.Begin(); err != nil {
  378. return err
  379. }
  380. for _, org := range orgs {
  381. org.Rands = base.GetRandomString(10)
  382. org.Salt = base.GetRandomString(10)
  383. if _, err = sess.Id(org.ID).Update(org); err != nil {
  384. return err
  385. }
  386. }
  387. return sess.Commit()
  388. }
  389. type TAction struct {
  390. ID int64 `xorm:"pk autoincr"`
  391. CreatedUnix int64
  392. }
  393. func (t *TAction) TableName() string { return "action" }
  394. type TNotice struct {
  395. ID int64 `xorm:"pk autoincr"`
  396. CreatedUnix int64
  397. }
  398. func (t *TNotice) TableName() string { return "notice" }
  399. type TComment struct {
  400. ID int64 `xorm:"pk autoincr"`
  401. CreatedUnix int64
  402. }
  403. func (t *TComment) TableName() string { return "comment" }
  404. type TIssue struct {
  405. ID int64 `xorm:"pk autoincr"`
  406. DeadlineUnix int64
  407. CreatedUnix int64
  408. UpdatedUnix int64
  409. }
  410. func (t *TIssue) TableName() string { return "issue" }
  411. type TMilestone struct {
  412. ID int64 `xorm:"pk autoincr"`
  413. DeadlineUnix int64
  414. ClosedDateUnix int64
  415. }
  416. func (t *TMilestone) TableName() string { return "milestone" }
  417. type TAttachment struct {
  418. ID int64 `xorm:"pk autoincr"`
  419. CreatedUnix int64
  420. }
  421. func (t *TAttachment) TableName() string { return "attachment" }
  422. type TLoginSource struct {
  423. ID int64 `xorm:"pk autoincr"`
  424. CreatedUnix int64
  425. UpdatedUnix int64
  426. }
  427. func (t *TLoginSource) TableName() string { return "login_source" }
  428. type TPull struct {
  429. ID int64 `xorm:"pk autoincr"`
  430. MergedUnix int64
  431. }
  432. func (t *TPull) TableName() string { return "pull_request" }
  433. type TRelease struct {
  434. ID int64 `xorm:"pk autoincr"`
  435. CreatedUnix int64
  436. }
  437. func (t *TRelease) TableName() string { return "release" }
  438. type TRepo struct {
  439. ID int64 `xorm:"pk autoincr"`
  440. CreatedUnix int64
  441. UpdatedUnix int64
  442. }
  443. func (t *TRepo) TableName() string { return "repository" }
  444. type TMirror struct {
  445. ID int64 `xorm:"pk autoincr"`
  446. UpdatedUnix int64
  447. NextUpdateUnix int64
  448. }
  449. func (t *TMirror) TableName() string { return "mirror" }
  450. type TPublicKey struct {
  451. ID int64 `xorm:"pk autoincr"`
  452. CreatedUnix int64
  453. UpdatedUnix int64
  454. }
  455. func (t *TPublicKey) TableName() string { return "public_key" }
  456. type TDeployKey struct {
  457. ID int64 `xorm:"pk autoincr"`
  458. CreatedUnix int64
  459. UpdatedUnix int64
  460. }
  461. func (t *TDeployKey) TableName() string { return "deploy_key" }
  462. type TAccessToken struct {
  463. ID int64 `xorm:"pk autoincr"`
  464. CreatedUnix int64
  465. UpdatedUnix int64
  466. }
  467. func (t *TAccessToken) TableName() string { return "access_token" }
  468. type TUser struct {
  469. ID int64 `xorm:"pk autoincr"`
  470. CreatedUnix int64
  471. UpdatedUnix int64
  472. }
  473. func (t *TUser) TableName() string { return "user" }
  474. type TWebhook struct {
  475. ID int64 `xorm:"pk autoincr"`
  476. CreatedUnix int64
  477. UpdatedUnix int64
  478. }
  479. func (t *TWebhook) TableName() string { return "webhook" }
  480. func convertDateToUnix(x *xorm.Engine) (err error) {
  481. type Bean struct {
  482. ID int64 `xorm:"pk autoincr"`
  483. Created time.Time
  484. Updated time.Time
  485. Merged time.Time
  486. Deadline time.Time
  487. ClosedDate time.Time
  488. NextUpdate time.Time
  489. }
  490. var tables = []struct {
  491. name string
  492. cols []string
  493. bean interface{}
  494. }{
  495. {"action", []string{"created"}, new(TAction)},
  496. {"notice", []string{"created"}, new(TNotice)},
  497. {"comment", []string{"created"}, new(TComment)},
  498. {"issue", []string{"deadline", "created", "updated"}, new(TIssue)},
  499. {"milestone", []string{"deadline", "closed_date"}, new(TMilestone)},
  500. {"attachment", []string{"created"}, new(TAttachment)},
  501. {"login_source", []string{"created", "updated"}, new(TLoginSource)},
  502. {"pull_request", []string{"merged"}, new(TPull)},
  503. {"release", []string{"created"}, new(TRelease)},
  504. {"repository", []string{"created", "updated"}, new(TRepo)},
  505. {"mirror", []string{"updated", "next_update"}, new(TMirror)},
  506. {"public_key", []string{"created", "updated"}, new(TPublicKey)},
  507. {"deploy_key", []string{"created", "updated"}, new(TDeployKey)},
  508. {"access_token", []string{"created", "updated"}, new(TAccessToken)},
  509. {"user", []string{"created", "updated"}, new(TUser)},
  510. {"webhook", []string{"created", "updated"}, new(TWebhook)},
  511. }
  512. for _, table := range tables {
  513. log.Info("Converting table: %s", table.name)
  514. if err = x.Sync2(table.bean); err != nil {
  515. return fmt.Errorf("Sync [table: %s]: %v", table.name, err)
  516. }
  517. offset := 0
  518. for {
  519. beans := make([]*Bean, 0, 100)
  520. if err = x.Sql(fmt.Sprintf("SELECT * FROM `%s` ORDER BY id ASC LIMIT 100 OFFSET %d",
  521. table.name, offset)).Find(&beans); err != nil {
  522. return fmt.Errorf("select beans [table: %s, offset: %d]: %v", table.name, offset, err)
  523. }
  524. log.Trace("Table [%s]: offset: %d, beans: %d", table.name, offset, len(beans))
  525. if len(beans) == 0 {
  526. break
  527. }
  528. offset += 100
  529. baseSQL := "UPDATE `" + table.name + "` SET "
  530. for _, bean := range beans {
  531. valSQLs := make([]string, 0, len(table.cols))
  532. for _, col := range table.cols {
  533. fieldSQL := ""
  534. fieldSQL += col + "_unix = "
  535. switch col {
  536. case "deadline":
  537. if bean.Deadline.IsZero() {
  538. continue
  539. }
  540. fieldSQL += com.ToStr(bean.Deadline.UTC().Unix())
  541. case "created":
  542. fieldSQL += com.ToStr(bean.Created.UTC().Unix())
  543. case "updated":
  544. fieldSQL += com.ToStr(bean.Updated.UTC().Unix())
  545. case "closed_date":
  546. fieldSQL += com.ToStr(bean.ClosedDate.UTC().Unix())
  547. case "merged":
  548. fieldSQL += com.ToStr(bean.Merged.UTC().Unix())
  549. case "next_update":
  550. fieldSQL += com.ToStr(bean.NextUpdate.UTC().Unix())
  551. }
  552. valSQLs = append(valSQLs, fieldSQL)
  553. }
  554. if len(valSQLs) == 0 {
  555. continue
  556. }
  557. if _, err = x.Exec(baseSQL + strings.Join(valSQLs, ",") + " WHERE id = " + com.ToStr(bean.ID)); err != nil {
  558. return fmt.Errorf("update bean [table: %s, id: %d]: %v", table.name, bean.ID, err)
  559. }
  560. }
  561. }
  562. }
  563. return nil
  564. }
PANIC: session(release): write data/sessions/4/a/4a0cb618f79bddf9: no space left on device

PANIC

session(release): write data/sessions/4/a/4a0cb618f79bddf9: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)