gobuffalo/buffalo

`buffalo dev --debug` does not work with the current version of Delve

zx42 opened this issue · 5 comments

zx42 commented

Description

I just wanted to create a fresh buffalo REST API app using SQLite on Linux. That failed pretty early.

Steps to Reproduce the Problem

  1. buffalo new --api --skip-docker --skip-webpack --vcs none --verbose --db-type sqlite3 myapp
  2. cd myapp
  3. buffalo pop create -a
  4. buffalo dev --debug

Expected Behavior

A running REST service listening on http://127.0.0.1:3000 for HTTP requests and a message in the terminal informing me about this.

Actual Behavior

I got the error message:
Stderr is not a terminal, use '-r' to specify redirects for the target process or --allow-non-terminal-interactive=true if you really want to specify a redirect for Delve

Can you please point out what I need to do differently?
Thanks a lot!

Btw. Buffalo is a GREAT piece of work!
buffalo version: INFO[0000] Buffalo version is: v0.18.8

Info

``` -> Go: Checking installation ✓ The `go` executable was found on your system at: ~/opt/go/bin/go

-> Go: Checking minimum version requirements
✓ Your version of Go, 1.18, meets the minimum requirements.

-> Go: Checking Package Management
✓ You are using Go Modules (go) for package management.

-> Go: Checking PATH
✓ Your PATH contains ~/go/bin.

-> Node: Checking installation
✘ The node executable could not be found on your system.
For help setting up your Node environment please follow the instructions for you platform at:

https://nodejs.org/en/download/

-> NPM: Checking installation
✘ The npm executable could not be found on your system.
For help setting up your NPM environment please follow the instructions for you platform at:

https://docs.npmjs.com/getting-started/configuring-your-local-environment

-> Yarn: Checking installation
✘ The yarnpkg executable could not be found on your system.
For help setting up your Yarn environment please follow the instructions for you platform at:

https://yarnpkg.com/en/docs/install

-> PostgreSQL: Checking installation
✘ The postgres executable could not be found on your system.
For help setting up your Postgres environment please follow the instructions for you platform at:

https://www.postgresql.org/download/

-> MySQL: Checking installation
✘ The mysql executable could not be found on your system.
For help setting up your MySQL environment please follow the instructions for you platform at:

https://www.mysql.com/downloads/

-> SQLite3: Checking installation
✘ The sqlite3 executable could not be found on your system.
For help setting up your SQLite3 environment please follow the instructions for you platform at:

https://www.sqlite.org/download.html

-> Cockroach: Checking installation
✘ The cockroach executable could not be found on your system.
For help setting up your Cockroach environment please follow the instructions for you platform at:

https://www.cockroachlabs.com/docs/stable/

-> Buffalo (CLI): Checking installation
✓ The buffalo executable was found on your system at: /usr/local/bin/buffalo

-> Buffalo (CLI): Checking minimum version requirements
✓ Your version of Buffalo (CLI), v0.18.8, meets the minimum requirements.

-> Buffalo: Application Details
Pwd ~/pr/dedup.work/myapp
Root ~/pr/dedup.work/myapp
GoPath ~/go
PackagePkg myapp
ActionsPkg myapp/actions
ModelsPkg myapp/models
GriftsPkg myapp/grifts
WithModules true
Name dedup-api
Bin bin/dedup-api
VCS none
WithPop true
WithSQLite true
WithDep false
WithWebpack false
WithNodeJs false
WithYarn false
WithDocker false
WithGrifts true
AsWeb false
AsAPI true
InApp true
PackageJSON {map[]}

-> Buffalo: config/buffalo-app.toml
name = "dedup-api"
bin = "bin/dedup-api"
vcs = "none"
with_pop = true
with_sqlite = true
with_dep = false
with_webpack = false
with_nodejs = false
with_yarn = false
with_docker = false
with_grifts = true
as_web = false
as_api = true

-> Buffalo: config/buffalo-plugins.toml
[[plugin]]
binary = "buffalo-pop"
go_get = "github.com/gobuffalo/buffalo-pop/v3@latest"
tags = ["sqlite"]

-> Buffalo: go.mod
module myapp

go 1.18

require (
github.com/gobuffalo/buffalo v1.0.0
github.com/gobuffalo/buffalo-pop/v3 v3.0.6
github.com/gobuffalo/envy v1.10.2
github.com/gobuffalo/grift v1.5.2
github.com/gobuffalo/mw-contenttype v1.0.1
github.com/gobuffalo/mw-forcessl v1.0.1
github.com/gobuffalo/mw-i18n/v2 v2.0.2
github.com/gobuffalo/mw-paramlogger v1.0.1
github.com/gobuffalo/pop/v6 v6.0.6
github.com/gobuffalo/suite/v4 v4.0.3
github.com/gobuffalo/x v0.1.0
github.com/rs/cors v1.8.2
github.com/unrolled/secure v1.13.0
)

require (
github.com/BurntSushi/toml v1.2.0 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/gobuffalo/events v1.4.2 // indirect
github.com/gobuffalo/fizz v1.14.2 // indirect
github.com/gobuffalo/flect v0.2.5 // indirect
github.com/gobuffalo/github_flavored_markdown v1.1.1 // indirect
github.com/gobuffalo/helpers v0.6.5 // indirect
github.com/gobuffalo/httptest v1.5.1 // indirect
github.com/gobuffalo/logger v1.0.6 // indirect
github.com/gobuffalo/meta v0.3.2 // indirect
github.com/gobuffalo/mw-csrf v1.0.1 // indirect
github.com/gobuffalo/nulls v0.4.1 // indirect
github.com/gobuffalo/plush/v4 v4.1.14 // indirect
github.com/gobuffalo/refresh v1.13.1 // indirect
github.com/gobuffalo/tags/v3 v3.1.3 // indirect
github.com/gobuffalo/validate/v3 v3.3.2 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.12.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.11.0 // indirect
github.com/jackc/pgx/v4 v4.16.1 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/joho/godotenv v1.4.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/luna-duclos/instrumentedsql v1.1.3 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-sqlite3 v1.14.14 // indirect
github.com/microcosm-cc/bluemonday v1.0.16 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/monoculum/formam v3.5.5+incompatible // indirect
github.com/nicksnyder/go-i18n v1.10.1 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d // indirect
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect
github.com/spf13/cobra v1.5.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)


</details>
sio4 commented

Hmm, interesting. What happens if you remove --debug flag?

zx42 commented

Hmm, interesting. What happens if you remove --debug flag?

The same. I thought I could get more details by adding --debug.
Can you reproduce the behavior with the latest buffalo cli (v.0.18.8)?

zx42 commented

Hmm, interesting. What happens if you remove --debug flag?

Sorry!!
I thought I had tried it without --debug also. but I hadn't.
So buffalo dev works but buffalo dev --debug gives me the error message.

sio4 commented

Yeah, as the message said, it seems like the issue is related to Delve. Will take a look tomorrow.

sio4 commented

Confirmed. Unfortunately, I think it may need more time to fix it.

The issue was introduced by the changed behavior of Delve with PR go-delve/delve#2146 but Refresh is not yet compatible with this behavior.

The workaround for this issue could be executing the debugger manually. Once you run buffalo dev, temporary binary will be created as tmp/app-build so you can start your debugging session with the command something like dlv exec tmp/app-build.