Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Issues upgrading from v0.15.x to v0.16.x #2270

Closed
bscott opened this issue May 17, 2022 · 6 comments
Closed

Issues upgrading from v0.15.x to v0.16.x #2270

bscott opened this issue May 17, 2022 · 6 comments
Labels
question The issue's author needs more information s: fixed was fixed or solution offered

Comments

@bscott
Copy link

bscott commented May 17, 2022

Description

Attempting to upgrade from Buffalo v0.15.1 to v0.16.13

If this is a feature request, explain why it should be added. Specific use-cases are best.

For bug reports, please provide as much relevant info as possible.

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. buffalo fix
  2. docker build .

Expected Behavior

Buffalo to build successfully

What did you want to happen? Tell us a story. We love to read.

Actual Behavior

What actually happended and what, exactly, is different than expected?

Ran into an error after go tidy step, even tried a lower version of Buffalo

#15 36.01 DEBU[2022-05-17T00:55:25Z] Delete: migrations/.pop-tmp.md
#15 36.01 DEBU[2022-05-17T00:55:25Z] Delete: migrations/embed.go
#15 36.01 DEBU[2022-05-17T00:55:25Z] Exec: go mod tidy
#15 36.57 Usage:
#15 36.57   buffalo build [flags]
#15 36.57 
#15 36.57 Aliases:
#15 36.57   build, b, bill, install
#15 36.57 
#15 36.57 Flags:
#15 36.57       --build-flags strings        Additional comma-separated build flags to feed to go build
#15 36.57       --clean-assets               will delete public/assets before calling webpack
#15 36.57       --dry-run                    runs the build 'dry'
#15 36.57       --environment string         set the environment for the binary (default "development")
#15 36.57   -e, --extract-assets             extract the assets and put them in a distinct archive
#15 36.57   -h, --help                       help for build
#15 36.57       --ldflags string             set any ldflags to be passed to the go build
#15 36.57       --mod string                 -mod flag for go build
#15 36.57   -o, --output string              set the name of the binary
#15 36.57   -k, --skip-assets                skip running webpack and building assets
#15 36.57       --skip-build-deps            skip building dependencies
#15 36.57       --skip-template-validation   skip validating templates
#15 36.57   -s, --static                     build a static binary using  --ldflags '-linkmode external -extldflags "-static"'
#15 36.57   -t, --tags string                compile with specific build tags
#15 36.57   -v, --verbose                    print debugging information
#15 36.57 
#15 36.57 time="2022-05-17T00:55:26Z" level=error msg="Error: exit status 2"
------
Error error building: executor failed running [/bin/sh -c buffalo build --static -o /bin/app -v --skip-template-validation]: exit code: 255

Info

Please run buffalo info and paste the information below where it says "PASTE_HERE".

❯ buffalo info  
-> Go: Checking installation
✓ The `go` executable was found on your system at: /usr/local/go/bin/go

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

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

-> 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.16.13, meets the minimum requirements.

-> Buffalo: Application Details
Pwd         /Users/bscott/code/personal/golangflow
Root        /Users/bscott/code/personal/golangflow
GoPath      /Users/bscott/go
PackagePkg  github.com/bscott/golangflow
ActionsPkg  github.com/bscott/golangflow/actions
ModelsPkg   github.com/bscott/golangflow/models
GriftsPkg   github.com/bscott/golangflow/grifts
WithModules true
Name        golangflow
Bin         bin/golangflow
VCS         git
WithPop     true
WithSQLite  false
WithDep     false
WithWebpack true
WithNodeJs  true
WithYarn    false
WithDocker  true
WithGrifts  true
AsWeb       true
AsAPI       false
InApp       true
PackageJSON {map[build:webpack -p --progress dev:webpack --watch]}
@sio4
Copy link
Member

sio4 commented May 17, 2022

Hi @bscott
Thank you for the question.

It seems like your environment is relatively old and is not supported anymore.

As you can see here, the supported go version is currently 1.16 and 1.17 (and will be shifted to 1.17 and 1.18 soon) but your environment is buffalo cli 0.16.13 with go version 1.14.6.

I would suggest you upgrade your environment and buffalo version to the recent version.

@sio4 sio4 added the question The issue's author needs more information label May 17, 2022
@sio4
Copy link
Member

sio4 commented May 17, 2022

Even though many things are changed, most of your code could be able to be used as the same but some of the things should be upgraded by yourself even though buffalo fix will help you a lot.

@bscott
Copy link
Author

bscott commented May 17, 2022

@sio4 My env is running Go 1.14 so I can do an incremental upgrade to the latest Buffalo. I tried going from Buffalo v0.15 to 0.18 with Go v1.18 but ran into the same errors. Is going from Buffalo v0.15 to Buffalo v0.18 supported as a direct upgrade?

@bscott
Copy link
Author

bscott commented May 17, 2022

I would also add that the error message I posted, isn't very descriptive of the issue.

@bscott
Copy link
Author

bscott commented May 17, 2022

@sio4 seems I'm now down to webpack issue after updating

# github.com/XXXX/XXXXX/templates
templates/embed.plush.go:11:5: files redeclared in this block
        templates/embed.go:11:5: other declaration of files
templates/embed.plush.go:13:6: FS redeclared in this block
        templates/embed.go:13:6: other declaration of FS
 ===
/index.js:19:24)
#21 84.81  @ ./assets/js/application.js 1:0-54
#21 84.81 
#21 84.81 webpack 5.65.0 compiled with 1 error in 63752 ms
#21 84.81 npm ERR! code ELIFECYCLE
#21 84.81 npm ERR! errno 1
#21 84.81 npm ERR! buffalo@1.0.0 build: `webpack --mode production --progress`
#21 84.81 npm ERR! Exit status 1
#21 84.81 npm ERR! 
#21 84.81 npm ERR! Failed at the buffalo@1.0.0 build script.
#21 84.81 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#21 84.81 
#21 84.81 npm ERR! A complete log of this run can be found in:
#21 84.81 npm ERR!     /root/.npm/_logs/2022-05-17T02_59_59_823Z-debug.log
#21 84.81 
#21 89.77 Usage:
#21 89.77   buffalo build [flags]
#21 89.77 
#21 89.77 Aliases:
#21 89.77   build, b, bill, install
#21 89.77 
#21 89.77 Flags:
#21 89.77       --build-flags strings        Additional comma-separated build flags to feed to go build
#21 89.77       --clean-assets               will delete public/assets before calling webpack
#21 89.77       --dry-run                    runs the build 'dry'
#21 89.77       --environment string         set the environment for the binary (default "development")
#21 89.77   -e, --extract-assets             extract the assets and put them in a distinct archive
#21 89.77   -h, --help                       help for build
#21 89.77       --ldflags string             set any ldflags to be passed to the go build
#21 89.77       --mod string                 -mod flag for go build
#21 89.77   -o, --output string              set the name of the binary
#21 89.77   -k, --skip-assets                skip running webpack and building assets
#21 89.77       --skip-build-deps            skip building dependencies
#21 89.77       --skip-template-validation   skip validating templates
#21 89.77   -s, --static                     build a static binary using  --ldflags '-linkmode external -extldflags "-static"'
#21 89.77   -t, --tags string                compile with specific build tags
#21 89.77   -v, --verbose                    print debugging information
#21 89.77 
#21 89.77 time="2022-05-17T03:00:05Z" level=error msg="Error: exit status 1"
------
executor failed running [/bin/sh -c buffalo build --static -o /bin/app]: exit code: 255

@bscott bscott closed this as completed May 17, 2022
@sio4
Copy link
Member

sio4 commented May 17, 2022

For the first error, it seems like some version of the fixer (buffalo fix) did a wrong job. the file templates/embed.plush.go should be duplicated file of templates/embed.go so you can safely remove the first file (embed.plush.go).

For the second error, I am not fully sure but if you don't use webpack stuff much or if you didn't make a big change, I would recommend you create a new app (buffalo new app ...) and copy related fresh files from the new app structure. Also comparing your structure/code with a new app could be a simple way to find out which is changed. (what I usually do when I faced the similar situation :-)

@sio4 sio4 added the s: fixed was fixed or solution offered label Sep 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question The issue's author needs more information s: fixed was fixed or solution offered
Projects
None yet
Development

No branches or pull requests

2 participants