Error when bench update - AttributeError: 'App' object has no attribute 'tag'

Here is the current version.

{
	"frappe": "15.100.1",
	"erpnext": "15.98.1"
}

bench version is 5.29.1

Getting the following error when using “bench update”.

Any advice on how to solve this?

yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 2.60s.
Installing erpnext
$ uv pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/erpnext  --python /home/erpnext/frappe-bench/env/bin/python
$ yarn install --check-files
yarn install v1.22.22
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.10s.
ERROR: 'App' object has no attribute 'tag'
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/commands/update.py", line 59, in update
    update(
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/bench.py", line 500, in update
    bench.setup.requirements()
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/bench.py", line 506, in requirements
    app = App(path_to_app, bench=self.bench, to_clone=False).install(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 256, in install
    tag=self.tag,
        ^^^^^^^^
AttributeError: 'App' object has no attribute 'tag'

I can now confirm it is my custom app that is causing the problem.

The strange thing is that the custom app was working fine for about six months.
It survived through multiple “bench update”. Not sure what changed.

Any advice on how to fix this? Or what the error message is say?

The error ‘App object has no attribute tag’ is caused by bench 5.29.1 introducing a breaking change. Your custom app likely has no git tags.

run this inside your custom app folder:

cd ~/frappe-bench/apps/your_custom_app
git tag v0.0.1

Then retry bench update.

If that doesn’t work, also check that your app has a version field in pyproject.toml or setup.cfg.

Thank you very much for replying.

I just did a git clone of the custom app. Then cd into the custom app.

Run the following as adviced.

git tag v0.0.1

The did “bench update”. Sorry to trouble you again but am getting this error now.
I did search for setup.cfg but could not find the file. In the pyproject.toml file there is no version number.
So I went into frappe and erpnext apps to see how the version number looks like so that I can do the same but could not find the version number. Checkout this error.

Hope you got time to continue to help me.

Installing erpnext
$ uv pip install --quiet --upgrade -e /home/erpnext/frappe-bench/apps/erpnext  --python /home/erpnext/frappe-bench/env/bin/python
$ yarn install --check-files
yarn install v1.22.22
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.07s.
ERROR: not enough values to unpack (expected 3, got 2)
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1442, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1363, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1830, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1226, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 794, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/commands/update.py", line 59, in update
    update(
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/bench.py", line 500, in update
    bench.setup.requirements()
  File "/usr/local/lib/python3.12/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/bench.py", line 506, in requirements
    app = App(path_to_app, bench=self.bench, to_clone=False).install(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 185, in __init__
    super().__init__(name, branch, *args, **kwargs)
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 85, in __init__
    self.setup_details()
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 96, in setup_details
    self._setup_details_from_mounted_disk()
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 121, in _setup_details_from_mounted_disk
    self.__setup_details_from_git(self.git_repo.remotes[0].url)
  File "/usr/local/lib/python3.12/dist-packages/bench/app.py", line 145, in __setup_details_from_git
    self.remote_server, self.org, _repo = name.replace(protocal, "").rsplit("/", 2)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)

git remote -v

please share you output after using this command

Thank you very much for helping.

The name of the custom app is “pvanthony”

$ git remote -v
origin	github_pvanthony:pvanthonySoftware/erpnext_app_pvanthony.git (fetch)
origin	github_pvanthony:pvanthonySoftware/erpnext_app_pvanthony.git (push)

Please note the following.

  • the repo is not public in github
  • the app name is “pvanthony” in frappe-bench/app
  • I have already set the app not to be updated using “bench exclude-app pvanthony”
  • tried downgrading bench using the following command.
    sudo -H pip3 install frappe-bench==5.25.11 --upgrade --break-system-packages
    but still get the same error
  • I am a beginner and not very knowledgeable.
1 Like

Thank you for the advice on checking git.

Looks like my config in .git was causing the problem.

One was the tag was missing. Which you helped me fix. Thank you again for helping. I would have never figured it out.

The next thing you pointed me to was again on the git. So I checked the config in .git.

It seems that bench was expecting a format like the following.

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = git@github.com:bglazier/unigreenscheme.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
	remote = origin
	merge = refs/heads/main

I was using

url = github_pvanthony:pvanthonySoftware/erpnext_app_pvanthony.git

github_pvanthony was a shortcut from the ssh config file to github with my ssh key.

Once I changed from “github_pvanthony” to “git@github.com”, bench update worked without errors.

Thank you, @tcbinfotech , for helping. I do appreciate it very much.

1 Like

Thank