-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Issue: Bug report
Version: v5.x
bench get-app --soft-link /home/frappe/bench/my_folder/my_app
Got error when I tried to install app using --soft-link options.
Traceback (most recent call last):
File "/home/frappe/.local/bin/bench", line 8, in <module>
sys.exit(cli())
^^^^^
File "/home/frappe/.bench/bench/cli.py", line 132, in cli
bench_command()
File "/home/frappe/.local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/frappe/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappe/.bench/bench/commands/make.py", line 167, in get_app
get_app(
File "/home/frappe/.bench/bench/app.py", line 385, in get_app
git_url = app.url
^^^^^^^
File "/home/frappe/.bench/bench/app.py", line 173, in url
return self.get_http_url()
^^^^^^^^^^^^^^^^^^^
File "/home/frappe/.bench/bench/app.py", line 176, in get_http_url
return f"https://{self.remote_server}/{self.org}/{self.repo}.git"
^^^^^^^^
AttributeError: 'App' object has no attribute 'org'
INFO: A newer version of bench is available: 5.19.0 → 5.24.1
Problems:
- The problems arise on
get_app
function trying to getapp.url
.
Line 687 in 8fcbac0
git_url = app.url |
- It's because app class doesn't get set up properly.
App.on_disk
should be true, but because of if not self.is_repo:
force setup_details
to exit too early.
Lines 86 to 90 in 8fcbac0
def setup_details(self): | |
# support for --no-git | |
if not self.is_repo: | |
self.repo = self.app_name = self.name | |
return |
App.on_disk
should be setup on elif os.path.exists(self.mount_path):
Lines 98 to 100 in 8fcbac0
elif os.path.exists(self.mount_path): | |
self.on_disk = True | |
self._setup_details_from_mounted_disk() |
- When tried to access
app.url
it'll tried to get url fromAppMeta.get_http_url()
sinceApp.on_disk
doesn't get setup properly.
Lines 149 to 155 in 8fcbac0
@property | |
def url(self): | |
if self.is_url or self.from_apps or self.on_disk: | |
return self.name | |
if self.use_ssh: | |
return self.get_ssh_url() |
App.get_http_url()
will throw an error, since it shouldn't get called in the first place.
self.org
is missing
Lines 159 to 160 in 8fcbac0
def get_http_url(self): | |
return f"https://{self.remote_server}/{self.org}/{self.repo}.git" |