Error When install custom app

When i install my custom app form github
i see this error :

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/iferas93/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/iferas93/.bench/bench/commands/make.py”, line 30, in get_app
get_app(git_url, branch=branch)
File “/home/iferas93/.bench/bench/app.py”, line 73, in get_app
os.rename(os.path.join(apps_path, repo_name), os.path.join(apps_path, app_name))
OSError: [Errno 39] Directory not empty

please help me …

@iFeras93: it looks like your replica of ERPNext has already installed the application with the name you assign to the new app being installed from a github repo:

You could probably try one of the following actions

  • uninstall the existing app (if it is no more needed on your end)
  • try to assign a different name to your application (in your source code) and install it once again, using the usual set of bench commands for it
1 Like

no i need my existing app
how i can do that

@iFeras93 : just rename the new application in the source code of it, in the respective github repo. Any text editor / Python IDE will work for it. Then submit your changes to the github repo and try installing the app once again.

ok … my existing app name erpnext my github app is trustederp … where is the problem?

this my terminal lines :
bench get-app trustedERP [my app link]
INFO:bench.app:getting app TrustedERP
INFO:bench.utils:git clone [my app link] --depth 1 --origin upstream
Cloning into ‘TrustedERP’…
remote: Counting objects: 4668, done.
remote: Compressing objects: 100% (3758/3758), done.
remote: Total 4668 (delta 777), reused 4665 (delta 777), pack-reused 0
Receiving objects: 100% (4668/4668), 116.50 MiB | 1002.00 KiB/s, done.
Resolving deltas: 100% (777/777), done.
Checking connectivity… done.
Checking out files: 100% (4675/4675), done.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/iferas93/.bench/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/iferas93/.bench/bench/commands/make.py”, line 30, in get_app
get_app(git_url, branch=branch)
File “/home/iferas93/.bench/bench/app.py”, line 73, in get_app
os.rename(os.path.join(apps_path, repo_name), os.path.join(apps_path, app_name))
OSError: [Errno 39] Directory not empty

@iFeras93: it looks like you have already installed trustedERP app in your ERPNext/bench instance previously.

At this point, you should do one of the following actions

  • uninstall and delete trustedERP from your replica first and then install it once again from your newest github repo
  • rename the new app (from trustedERP to something else, using your source code editor), submit your changes to the newest github repo and install the renamed app to your ERPNext/bench instance

Hi @iFeras93 ,

The issue you have is you already installed the app in your ERPNext installation,

If the app is not loading/functioning in your installation so you need to delete it from ERPNext installation and install it again via GitHub.

To remove an app from your ERPNext next use the following:

bench --site [sitename] uninstall-app [app]

2 Likes

Sorry But i don’t understand any thing … :frowning:

i install the erpnext app … and custom it then upload it to github with name trustedERP
now when install the app form github the errpr will be appered
how i can fix this problem ?

@iFeras93: just for clarity, did you customize the core ERPNext code directly as you built your TrustedERP ? or does TrustedERP deliver some capability on top of core functionality of ERPNext code?

If the first case is true, then you actually did a fork of ERPNext (rather then a true custom app in definition of Frappe - http://frappe.github.io/frappe/user/en/ ). This might introduce a clash as bench sees your application as another ERPNext instance (and it could be the reason of the error, too … )

If this is the case, you will need to leverage all of your customization changes into a true custom app (without modifying any of the core files of ERPNext itself). By doing so, not only you will fix the current problem, you will also ensure your changes sustain and easily migrate/integrate with the newest releases of Frappe and ERPNext to go.

If it is not the case, please try to elaborate on exact set of actions that you do, before you get the error on bench get-app trustedERP [my app link] command.

I faced similar error on installing a custom app

OSError: [Errno 39] Directory not empty

Following solution worked for me. After executing below command, I was able to install custom app.

bench remove-app [app-name] Remove app from the bench entirely