0

I'm trying to create a production system with revel and go. I found dep as the version and dependency management tool.

Since this is going to be a production system, I wanted to lock down the versions I'm using, using dep. It seems to be working fine if I run the server in prod mode but fails with the error if i try to run in dev mode

CRIT 20:46:56 revel watcher.go:78: Watcher: Failed to stat watched path section=util path=/home/shaumux/go/mercury/src/bitbucket.org/dataemo/mercury/vendor/github.com/revel/revel/templates error="stat /home/shaumux/go/mercury/src/bitbucket.org/dataemo/mercury/vendor/github.com/revel/revel/templates: no such file or directory"

My Gopkg.toml looks like this

required = ["github.com/revel/cmd/revel"]

[[constraint]]
  name = "github.com/revel/modules"
  version = "0.19.0"

[[constraint]]
  name = "github.com/revel/revel"
  version = "0.19.1"

[[override]]
  branch = "master"
  name = "github.com/xeonx/timeago"

[[override]]
  branch = "master"
  name = "github.com/revel/log15"

[[override]]
  version = "0.19.0"
  name = "github.com/revel/cmd"

[prune]
  go-tests = true
  unused-packages = true
Shaumux
  • 735
  • 11
  • 25
  • Why do you think this is related to dep? The errors aren't coming from dep at all. The problem appears to be that your templates are not in the expected location. – Jonathan Hall Jun 29 '18 at 10:29
  • 1
    The errors are not related to dep directly. – Shaumux Jun 29 '18 at 10:30
  • Then why go into so much detail about something you know is unrelated to the problem? Instead, focus on the difference between your production and development environments. It looks like the problem is that your dev environment is missing templates. – Jonathan Hall Jun 29 '18 at 10:32
  • They are emitted when I do revel run . The thing is revel is not copying the template directory to the the vendor directory, I'm still not sure exactly why, I just started using this 2 days ago – Shaumux Jun 29 '18 at 10:32
  • The problem is that dep isn't copying the template directory with revel and revel finding a vendor directory isn't looking at the GOPATH – Shaumux Jun 29 '18 at 10:33
  • dep isn't supposed to copy template directories. But that's also beside the point. What is the difference between your prod and dev environments? Focus on this, since it works in one and not the other. – Jonathan Hall Jun 29 '18 at 10:34
  • There is no difference currently, I'm currently using the same codebase on the same machine which is the default skeleton with different parameters while running the server, after I did dep ensure -update. With the vendor directory present revel is looking only at the vendor directory and not the src directory in GOPATH where the template directory actually are. When I run in prod mode, everything gets compiled into a single binary so it isn't looking anywhere external – Shaumux Jun 29 '18 at 10:37
  • If there's no difference, then everything is working, congratulations! If the behavior is different between the two, then something is different. It sounds like your 'dev' and 'prod' are using entirely different binaries. This is a terrible anti-pattern. Stop doing that! – Jonathan Hall Jun 29 '18 at 12:02

0 Answers0