How to get stable version from Git?

@Fabrizio_Mazzoni, @JoEz,

pushed a fixed [hot] fixes in translation error in template by mbauskar · Pull Request #3123 · frappe/frappe · GitHub

Please try to pull the latest updates in frappe and run the bench build

Thanks, Makarand

Thanks. tried but I think there is still an issue:

@Fabrizio_Mazzoni try bench clear-cache and clean browser cache as well

@JoEz, @makarand_b I’m experiencing the same problem, even tried a new install, run the update and cleared the cache.

And I have the same doubt, that running bench update is pulling a stable version from Git, because when I compared the Git hash in the version information some days ago, it was the last commit to develop branch, far ahead from the latest release tag. So running bench update does not feel safe.

I have the same problem here, if it can help, here is what is printed in the console.
Cheers,
Guillaume

bench update should be safe as long as you are set to the master branch. Using bench switch-to-master should get you on the stable branch.

Does this mean, that default is not the master branch but develop?

It depends on how you installed it (production or developer). You can check by going into the apps folder and checking the branch for frappe and erpnext.

From frappe-bench folder:

cd apps
cd erpnext
git status
cd …
cd frappe
git status

branch should be master for both

@Ben_Cornwell_Mott
I’m following mostly the Manual Install guide: GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

It allows me to specify the master branch for frappe/bench repository, but I can’t find, where the frappe/erpnext repository is cloned to. So I could verify git status for frappe repository (=master), but not for erpnext repository.

These are my install steps:

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo

bench init frappe-bench && cd frappe-bench
bench get-app erpnext https://github.com/frappe/erpnext
bench new-site site1.local \
    --db-name mydb --mariadb-root-username myuser --mariadb-root-password mypass \
    --install-app erpnext

Then I run the update

bench switch-to-master
bench update
bench clear-cache

But after restarting supervisord and nginx, the Help -> About popup still shows:

Installed Apps
ERPNext: v8.0.0-beta (5650bf9) (develop)
Frappe Framework: v8.0.19 (master)

It’s not clear to me, how I can get ERPNext to use master.

1 Like

The erpnext repo should be in frappe-bench/apps/erpnext
Can you run a dir in the apps folder?

Thank you! There it is.

$ dir
erpnext  frappe

And cd erpnext && git status returns:

On branch develop
Your branch is up-to-date with 'upstream/develop'.
nothing to commit, working directory clean

So I’m going back to frappe-bench directory to run bench switch-to-master, which returns:

Switching for frappe
INFO:bench.utils:git config --unset-all remote.upstream.fetch
INFO:bench.utils:git config --add remote.upstream.fetch '+refs/heads/*:refs/remotes/upstream/*'
INFO:bench.utils:git fetch upstream 
INFO:bench.utils:git checkout master
Already on 'master'
Your branch is up-to-date with 'upstream/master'.
INFO:bench.utils:git merge upstream/master
Already up-to-date.
Branch master does not exist in Upstream for erpnext
Successfully switched branches for:
frappe
()
Switched to master
Please run `bench update --patch` to be safe from any differences in database schema

Strange, because it says Branch master does not exist in Upstream for erpnext.
If I run bench update then, the log shows:

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull  upstream master
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
Already up-to-date.
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git pull  upstream develop
From https://github.com/frappe/erpnext
 * branch            develop    -> FETCH_HEAD
Already up-to-date.
INFO:bench.utils:find . -name "*.pyc" -delete
Updating Python libraries...
...

So it still pulls from develop branch of the ERPNext repository.

Weird…

Try this

in frappe-bench:

cd apps
cd erpnext
git fetch upstream master
git checkout master
cd …
cd …
bench switch-to-master
bench update

[EDIT: changed git pull to git fetch]

Hmm, I’m trying this, but something is not working as it should.
I’m in the apps/erpnext directory, then I run:

$ git fetch upstream master
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 11 (delta 9), reused 6 (delta 4), pack-reused 0
Unpacking objects: 100% (11/11), done.
From https://github.com/frappe/erpnext
 * branch            master     -> FETCH_HEAD

Looks like there was a master branch, but then

$ git checkout master
error: pathspec 'master' did not match any file(s) known to git.

Looking at all available branches, it looks like just a few and no master:

$ git branch -a
* develop
  remotes/upstream/HEAD -> upstream/develop
  remotes/upstream/develop

So to make sure I’m using the right repository:

$ git remote -v
upstream	https://github.com/frappe/erpnext (fetch)
upstream	https://github.com/frappe/erpnext (push)

But that looks correct.
So where is the master branch?
This is really weird.

Could it be, that with bench get-app erpnext https://github.com/frappe/erpnext only a part of the repository is cloned?
Because it’s actually very big and trying a full clone takes much much longer than running the bench get-app command.

Looking at the Git configuration, the upstream section looks suspicious:

$ cat .git/config 
<snip>
[remote "upstream"]
	url = https://github.com/frappe/erpnext
	fetch = +refs/heads/develop:refs/remotes/upstream/develop
<snip>

In some other Git repository it would be:

[remote "origin"]
        url = git@github.com:pgRouting/pgrouting.git
        fetch = +refs/heads/*:refs/remotes/origin/*                                                                                   

So it seems, that other branches got hidden.

Well, I found out, how to get master in the script to setup a production system:

You need to specify the --branch like this:

bench get-app --branch master erpnext https://github.com/frappe/erpnext

So for me there are 2 lessons learned:

  1. By default bench get-app seems to install develop branch. In my opinion it would be better to switch the default branch.
  2. master branch means “stable”, even if there are tagged releases actually: Releases · frappe/erpnext · GitHub

Thanks guys. Was on develop. I’ll do a reinstall and then go in stable release. Missed this part!

OK. Is there still a bug in the current stable version?
I have just done a fresh install and as per instructions on this thread switched to master (stable).

Have run a git status and confirmed it is on master version both for frappe and erpnext.

Still getting the error:

Added some debug info as started bench manually to see what’s happening:

Same issue!

Yes this error is from today!

After run of:

bench update

it was upgraded the js

Then in the migration process I got the same error:

Please help us to solve this…

Awesome guys. Thanks for the fix. @krnkris you can update.

Got it!

Thank you @makarand_b, @Fabrizio_Mazzoni !

Installed Apps
ERPNext: v8.0.16 (master)
Frappe Framework: v8.0.23 (master)