Expect User old_user but current user is: new_user

Ok so I made some changes to a terrible Gogs deployment made by a intern and since then our dev can’t push anymore.

First, the Gogs was setup under a user “it2” and I moved to “git” user. This was done by moving the gogs and gogs-repositories from /home/it2/go/src/github.com/gogits/gogs/ to the /home/git/gogs/ folder and reconfiguring the custom app.ini file. After the latest version of Gogs was unpack over that folder. I have also change INSTALL_LOCK to false before restart service so the install page comes up. And the RUN_USER was changed from it2 to git in the process.

Now everything works well but our dev when they push, they get an error msg:

I’m not sure what the original version was but we’re running 0.11.91 on Ubuntu 18.04.3 LTS with mysql Ver 14.14 Distrib 5.7.28

What can I do to solve this? Seems this error is quite common online but nothing I’ve tried solved it…


Found it! Has nothing to do with the app itself but the repos instead!

From the gogs-repositories I ran these:

grep -RiIl '/home/it2/go/src/github.com/gogits/gogs' | xargs sed -i "s|/home/it2/go/src/github.com/gogits/gogs|/home/git/gogs|"
grep -RiIl '/home/it2/go/src/github.com/gogits/gogs/custom/conf/app.ini' | xargs sed -i "s|/home/it2/go/src/github.com/gogits/gogs/custom/conf/app.ini|/home/git/gogs/custom/conf/app.ini|"

Problem solved! I hope this will help someone out there :slight_smile:

1 Like