Install app from Gitlab instead of Github. Is it possible?

giltab.com is automatically changed to github.com from the repo url whenever I try to get an app from my Gitlab repository. Why does that happen? What should I do to get my app from gitlab.com ? Or frappe/bench forcing me to use github.com instead of any other git repositories???

Whenever I run following command, gitlab.com is automatically changed to github.com. I do not want to clone from github.com I want to clone my app from gitlab.com or some other custom git repo. How???

$ bench get-app git@gitlab.com:erpnext-apps/my_custom_app.git

git clone git@github.com:erpnext-apps/my_custom_app.git --depth 1 --origin upstream
Cloning into ‘my_custom_app’…
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR:
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 117, in cli
raise e
File “/usr/local/lib/python3.8/dist-packages/bench/cli.py”, line 107, in cli
bench_command()
File “/usr/local/lib/python3.8/dist-packages/click/core.py”, line 1128, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/click/core.py”, line 1053, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.8/dist-packages/click/core.py”, line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.8/dist-packages/click/core.py”, line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.8/dist-packages/click/core.py”, line 754, in invoke
return __callback(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/commands/make.py”, line 142, in get_app
get_app(
File “/usr/local/lib/python3.8/dist-packages/bench/app.py”, line 350, in get_app
app.get()
File “/usr/local/lib/python3.8/dist-packages/bench/utils/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.8/dist-packages/bench/app.py”, line 155, in get
self.bench.run(
File “/usr/local/lib/python3.8/dist-packages/bench/bench.py”, line 43, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.8/dist-packages/bench/utils/init.py”, line 126, in exec_cmd
raise CommandFailedError
bench.exceptions.CommandFailedError

I also noticed the same thing last week. I had to workaround by downloading and installing my Apps manually.

I haven’t had time to debug yet, and see whether Bench or Frappe repositories are the culprits.

It seems this was a known issue and has been fixed in frappe-bench v5.7.4. Upgrade frappe-bench and there should be no issue.

Upgrade bench using :

$ pip install -U frappe-bench

References:

  1. Bench get-app bitbucket requires github account - #4 by gavindsouza
  2. Bench get-app always use github.com even if we use different git server such as gitlab · Issue #1228 · frappe/bench · GitHub

Hi @brian_pond. Obviously the remote git server was hard-coded in bench CLI. It seems the issue is now fixed in frappe-bench v5.7.4. I was able to get an app from my Gitlab’s repo by using the latest bench version (ie. v5.7.4).

1 Like