Melkeydev / go-blueprint

Go-blueprint allows users to spin up a quick Go project using a popular framework
https://docs.go-blueprint.dev/
MIT License
4.37k stars 259 forks source link

[Bug] Error committing files to git repo: exit status 128 #159

Closed songyang-dev closed 9 months ago

songyang-dev commented 10 months ago

What is the problem?

After creating a project, there is an error message saying that git commits didn't work.

Operating System

Ubuntu 22.04

Architecture Version (x86, x64, arm, etc)

5.15.133.1-microsoft-standard-WSL2

Steps to reproduce

  1. go-blueprint create
  2. Select standard library and MySQL.

Relevant log output

 What database driver do you want to use in your Go project?

> [x]  Mysql
 MySQL-Driver for Go's database/sql package

  [ ] Postgres
Go postgres driver for Go's database/sql package

  [ ] Sqlite
sqlite3 driver conforming to the built-in database/sql interface

  [ ] Mongo
The MongoDB supported driver for Go.

  [ ] None
Choose this option if you don't wish to install a specific database driver.

Press y to confirm choice.

2023/12/26 01:17:53 Error committing files to git repo: exit status 128
Error: exit status 128
songyang-dev commented 10 months ago

Furthermore, the terminal is messed up and no longer displays text responsively anymore. I'm using a Windows terminal to get into WSL.

Ujstor commented 10 months ago

I was able to reproduce this bug in WSL2. We will look into this and find some solutions.

WindowsTerminal_TvZKo83sje

@briancbarrow @limesten There is also a problem with the terminal, exactly the same as before—no visual input. Do you have any idea why this is now the case in Windows? This bug was reported before the advanced flag merge.

Bug appears only in Linux subsystem for windows, in normal win environment this is not a case.

Ujstor commented 10 months ago

@songyang-dev

configure your Username and mail for git in WSL

git config --global user.name "Your Name" git config --global user.email "youremail@yourdomain.com"

I think this will solve your issue. It worked for me

songyang-dev commented 9 months ago

@songyang-dev

configure your Username and mail for git in WSL

git config --global user.name "Your Name" git config --global user.email "youremail@yourdomain.com"

I think this will solve your issue. It worked for me

I will try this later today.

songyang-dev commented 9 months ago

@Ujstor I solved the issue by configuring my git username and email inside of WSL.

As for the terminal issue, if the go-blueprint create command fails for some reason, the terminal will still get stuck.

I tested this on version 0.5.1.

briancbarrow commented 9 months ago

@songyang-dev at what point does it get stuck? What options did you choose? We'll need a bit more info in order to try to reproduce the error.

songyang-dev commented 9 months ago

@songyang-dev at what point does it get stuck? What options did you choose? We'll need a bit more info in order to try to reproduce the error.

I chose the standard library and MySQL. The terminal gets stuck after completing the questionnaire. It only happens when there is an error during the creation process. I suspect this is because of a faulty error recovery process.

You can recreate this by deleting your git username and email from the git config on wsl.

Ujstor commented 9 months ago

if gitconfig is not present there is this error code:

2024/01/05 12:58:30 Error committing files to git repo: exit status 128 Error: exit status 128

after that you can use terminal but there is no visual input.

error is handled correctly, this behavior could occur with any error, not just with git commit. It's just speculation for now. I will try to test this. We will try to figure out the cause of the behavior.

Ujstor commented 9 months ago

Conclusion is that the spinner is causing a bug with visual input after occurrences of errors. I removed the spinner logic in create.go and bug disappeared.

@mimatache can you check what is causing this bug in spinner logic?