gobuffalo / buffalo

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

When using dep `/bin/app migrate` errors with argument error #1140

Closed drnic closed 6 years ago

drnic commented 6 years ago

This issue is a recreation of #1123 which was closed but fix did not turn out to fix issue for me.

Steps to Reproduce the Problem

Please describe in painful detail what you did (so others can play along with you) to get to this point. This includes things like the exact command(s) you used, or the curl command you used, that sort of thing.

  1. Using the app developed following https://gobuffalo.io/en/docs/generators tutorial
  2. buffalo create -a && buffalo db migrate works as expected and the app runs fine
  3. buffalo drop -a && buffalo build && bin/buffalo_testapp migrate fails

Expected Behavior

Migrations should have run.

Actual Behavior

$ bin/buffalo_testapp migrate
DEBU[2018-06-21T16:54:55+10:00] select count(*) as row_count from (SELECT schema_migration.* FROM schema_migration AS schema_migration WHERE version = $1) a $1="20180621060932"

0.0430 seconds
2018/06/21 16:54:55 Failed to run migrations: error processing 20180621060932_create_users.up.fizz: could not fizz the migration 20180621060932_create_users.up.fizz: parse error: function run error: function wants argument type fizz.Options but received type map[string]interface {}

Info

``` ### Buffalo Version v0.12.0 ### App Information Pwd=/Users/drnic/Projects/gopath/src/buffalo_testapp Root=/Users/drnic/Projects/gopath/src/buffalo_testapp GoPath=/Users/drnic/Projects/gopath Name=buffalo_testapp Bin=bin/buffalo_testapp PackagePkg=buffalo_testapp ActionsPkg=buffalo_testapp/actions ModelsPkg=buffalo_testapp/models GriftsPkg=buffalo_testapp/grifts VCS=git WithPop=true WithSQLite=false WithDep=true WithWebpack=true WithYarn=true WithDocker=true WithGrifts=true ### Go Version go version go1.10.3 darwin/amd64 ### Go Env GOARCH="amd64" GOBIN="" GOCACHE="/Users/drnic/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/drnic/Projects/gopath" GORACE="" GOROOT="/usr/local/Cellar/go/1.10.3/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/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/wd/xnncwqp96rj0v1y2nms64mq80000gn/T/go-build344015229=/tmp/go-build -gno-record-gcc-switches -fno-common" ### Node Version v10.4.1 ### NPM Version 6.1.0 ### Yarn Version 1.7.0 ### PostgreSQL Version pg_ctl (PostgreSQL) 10.4 ### SQLite Version 3.19.3 2017-06-27 16:48:08 2b0954060fe10d6de6d479287dd88890f1bef6cc1beca11bc6cdb79f72e2377b ### Dep Version dep: version : devel build date : git hash : go version : go1.9.2 go compiler : gc platform : darwin/amd64 ### Dep Status PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED dmitri.shuralyov.com/text/kebabcase branch master branch master 40e40b4 40e40b4 1 github.com/BurntSushi/toml v0.3.0 v0.3.0 b26d9c3 b26d9c3 1 github.com/ajg/form v1.5 v1.5 cc29540 cc29540 1 github.com/cockroachdb/cockroach-go branch master branch master 59c0560 59c0560 1 github.com/davecgh/go-spew v1.1.0 v1.1.0 346938d 346938d 1 github.com/dustin/go-humanize branch master branch master 02af396 02af396 1 github.com/fatih/color v1.7.0 v1.7.0 5b77d2a 5b77d2a 1 github.com/fatih/structs v1.0 v1.0 a720dfa a720dfa 1 github.com/fsnotify/fsnotify v1.4.7 v1.4.7 c282820 c282820 1 github.com/go-sql-driver/mysql v1.4.0 v1.4.0 d523deb d523deb 1 github.com/gobuffalo/buffalo v0.12.0 v0.12.0 7dd791f 7dd791f 8 github.com/gobuffalo/envy v1.6.3 v1.6.3 2d0f467 2d0f467 1 github.com/gobuffalo/makr v1.1.0 v1.1.0 2f752af 2f752af 1 github.com/gobuffalo/packr v1.11.1 v1.11.1 bd47f28 bd47f28 1 github.com/gobuffalo/plush v3.7.7 v3.7.7 2ec029f 2ec029f 5 github.com/gobuffalo/pop v4.5.10 v4.5.10 fb309e2 fb309e2 6 github.com/gobuffalo/suite v2.1.1 v2.1.1 e2e0134 e2e0134 2 github.com/gobuffalo/tags v2.0.6 v2.0.6 1b65be1 1b65be1 3 github.com/gobuffalo/uuid v2.0.0 v2.0.0 3a9fb6c 3a9fb6c 1 github.com/gobuffalo/validate v2.0.0 v2.0.0 42d8db6 42d8db6 2 github.com/gobuffalo/x branch master branch master 11ca13c 11ca13c 1 github.com/gorilla/context v1.1.1 v1.1.1 08b5f42 08b5f42 1 github.com/gorilla/mux v1.6.2 v1.6.2 e3702be e3702be 1 github.com/gorilla/securecookie v1.1.1 v1.1.1 e59506c e59506c 1 github.com/gorilla/sessions v1.1.1 v1.1.1 03b6f63 03b6f63 1 github.com/jmoiron/sqlx branch master branch master 0dae4fe 0dae4fe 2 github.com/joho/godotenv v1.2.0 v1.2.0 a79fa1e a79fa1e 1 github.com/lib/pq branch master branch master 90697d6 90697d6 2 github.com/markbates/going v1.0.0 v1.0.0 0576708 0576708 3 github.com/markbates/grift v1.0.0 v1.0.0 76f9361 76f9361 1 github.com/markbates/hmax v1.0.0 v1.0.0 800e180 800e180 1 github.com/markbates/inflect v1.0.0 v1.0.0 dd7de90 dd7de90 1 github.com/markbates/refresh v1.4.0 v1.4.0 fab0ab1 fab0ab1 2 github.com/markbates/sigtx v1.0.0 v1.0.0 daa2e5f daa2e5f 1 github.com/markbates/willie v1.0.0 v1.0.0 6793494 6793494 1 github.com/mattn/anko v0.0.5 v0.0.5 9bd0532 9bd0532 5 github.com/mattn/go-colorable v0.0.9 v0.0.9 167de6b 167de6b 1 github.com/mattn/go-isatty v0.0.3 v0.0.3 0360b2a 0360b2a 1 github.com/mattn/go-sqlite3 v1.9.0 v1.9.0 25ecb14 25ecb14 1 github.com/microcosm-cc/bluemonday branch master branch master 995366f 995366f 1 github.com/mitchellh/go-homedir branch master branch master 3864e76 3864e76 1 github.com/monoculum/formam v3.0 v3.0 99ca9dc 99ca9dc 1 github.com/nicksnyder/go-i18n v1.10.0 v1.10.0 0dc1626 0dc1626 4 github.com/pelletier/go-toml v1.2.0 v1.2.0 c01d127 c01d127 1 github.com/pkg/errors v0.8.0 v0.8.0 645ef00 645ef00 1 github.com/pmezard/go-difflib v1.0.0 v1.0.0 792786c 792786c 1 github.com/russross/blackfriday branch master branch master 11635eb 11635eb 1 github.com/serenize/snaker branch master branch master a683aaf a683aaf 1 github.com/sergi/go-diff v1.0.0 v1.0.0 1744e29 1744e29 1 github.com/shurcooL/github_flavored_markdown branch master branch master 8913699 8913699 1 github.com/shurcooL/go branch master branch master 9e1955d 9e1955d 4 github.com/shurcooL/go-goon branch master branch master 37c2f52 37c2f52 1 github.com/shurcooL/graphql branch master branch master 62c9ce0 62c9ce0 1 github.com/shurcooL/highlight_diff branch master branch master 09bb405 09bb405 1 github.com/shurcooL/highlight_go branch master branch master 78fb10f 78fb10f 1 github.com/shurcooL/octicon branch master branch master c42b0e3 c42b0e3 1 github.com/shurcooL/sanitized_anchor_name branch master branch master 86672fc 86672fc 1 github.com/sirupsen/logrus v1.0.5 v1.0.5 c155da1 c155da1 1 github.com/sourcegraph/annotate branch master branch master f4cad6c f4cad6c 1 github.com/sourcegraph/syntaxhighlight branch master branch master bd320f5 bd320f5 1 github.com/stretchr/testify v1.2.2 v1.2.2 f35b8ab f35b8ab 3 golang.org/x/crypto branch master branch master 7f39a6f 7f39a6f 3 golang.org/x/net branch master branch master db08ff0 db08ff0 3 golang.org/x/sync branch master branch master 1d60e46 1d60e46 1 golang.org/x/sys branch master branch master ad87a3a ad87a3a 2 google.golang.org/appengine v1.1.0 v1.1.0 b1f2635 b1f2635 1 gopkg.in/yaml.v2 v2.2.1 v2.2.1 5420a8b 5420a8b 1 ```
markbates commented 6 years ago

@drnic you missed an important step to repo this; you have to be using dep, see the script below. Now that I can repo, I should be able to fix.

FROM gobuffalo/buffalo:latest

RUN mkdir -p $GOPATH/src/github.com/markbates

WORKDIR $GOPATH/src/github.com/markbates

RUN buffalo new --skip-webpack coke --db-type=sqlite3

WORKDIR $GOPATH/src/github.com/markbates/coke

RUN buffalo db create -a -d
RUN buffalo g resource widget name
RUN buffalo b -d

# works fine:
RUN ./bin/coke migrate

RUN buffalo db drop -a -d
RUN buffalo db create -a -d

RUN dep init -v
RUN buffalo b -d

# fails
RUN ./bin/coke migrate
markbates commented 6 years ago

Update: The fix for this is here https://github.com/gobuffalo/pop/pull/130

markbates commented 6 years ago

@drnic the temporary work around, until that PR is merged, is to use the following in your Gopkg.toml:

[[constraint]]
  name = "github.com/gobuffalo/pop"
  branch = "fizz-less"
markbates commented 6 years ago

@drnic fixed with the release of pop v4.5.11 https://github.com/gobuffalo/pop/releases/tag/v4.5.11. Update your dependencies and you'll be good to go.

drnic commented 6 years ago

In production there is no dep nor buffalo, there is only the coke CLI. Are you saying I need my git repo, dep and buffalo CLIs in production to use Buffalo? Actually, I'm not sure what the "missed an important step" is in the example above.

Will try upgrading pop.

markbates commented 6 years ago

No, you don’t need all that. I assumed you were using dep because the output you pasted from buffalo shows dep information.

drnic commented 6 years ago

Ah gotcha.

Upgraded to pop 4.5.11 and it works; hurray!

markbates commented 6 years ago

Yay! Sorry about all that. That anko package, and it’s maintainer, have been hard to deal with. Thankfully it’s gone now. On Jun 27, 2018, 6:36 PM -0400, Dr Nic Williams notifications@github.com, wrote:

Ah gotcha. Upgraded to pop 4.5.11 and it works; hurray! — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.