133

Using the buffalo framework, after bootstraping it via buffalo new <project_name>

I am trying to run buffalo dev Expecting to see:

project running on port 3000

But I am getting those error messages instead

actions/app.go:4:2: missing go.sum entry for module providing package github.com/gobuffalo/buffalo (imported by sc_api/actions); to add:go get sc_api/actions

actions/app.go:13:2: missing go.sum entry for module providing package github.com/gobuffalo/mw-csrf (imported by sc_api/actions); to add: go get sc_api/actions

actions/app.go has been generated by buffalo, but in case you are wondering the error does match the import statement in this file.

// app.go
package actions

import (
    "github.com/gobuffalo/buffalo"  // 1rst line
    "github.com/gobuffalo/envy"
    forcessl "github.com/gobuffalo/mw-forcessl"
    paramlogger "github.com/gobuffalo/mw-paramlogger"
    "github.com/unrolled/secure"

    "sc_api/models"

    "github.com/gobuffalo/buffalo-pop/v2/pop/popmw"
    csrf "github.com/gobuffalo/mw-csrf"  // 2nd line
    i18n "github.com/gobuffalo/mw-i18n"
    "github.com/gobuffalo/packr/v2"
)

What does it mean ? How do I fix it ?

3 Answers 3

336

It seems the issue has nothing to do with Buffalo and more with my lack of understanding of Go in general.

running go mod tidy solved the issue

This command goes through the go.mod file to resolve dependencies:

  • delete the packages that are not needed
  • download those needed
  • update the go.sum

I am still unsure which of those actions did the trick... but the project runs now.

ps: I'll let the in-depth explanation/correction to the Go wizard out here.

5
  • 16
    Total go noob here too, this helped me! Oct 25, 2021 at 16:54
  • Cool, faced same issue & it helped :)
    – R Sun
    Dec 9, 2021 at 14:36
  • Update dependencies and broke my code, now I can't get it back to its original state
    – Anthony
    Aug 19, 2022 at 17:40
  • Thanks this I am new on go, so forget to run this in existing project when get you clone a new projects. Jun 2 at 12:30
  • go mod tidy -e worked for me. Jul 27 at 20:16
12

i got the same issue when building a docker image. i tried go mod tidy and also go get -t . as suggested here https://github.com/golang/go/issues/44129. both didnt worked for me though but updating my docker builder to version 1.18 worked.

1
  • I had the same issue while using FROM golang:1.16-alpine as builder in dockerfile, upgrading the version to 1.18 solved the issue.
    – avijit
    Feb 1 at 0:24
11

I use go mod tidy -e solved the problem. The -e flag (added in Go 1.16) causes go mod tidy to attempt to proceed despite errors encountered while loading packages.The more about mod tidy: https://go.dev/ref/mod#go-mod-tidy

1
  • saved xmas and it's not even xmas thank you Mar 28 at 13:58

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.