App Name And Repo Name

Hello everyone…

Must the name of github repo be the same as the app name?

For example, if the app name is plugin can the repo name be frappe_plugin or it should be plugin just like the app name?

I have reviewed bench code and it seems to be ok if the name of the repo is different than the name of the app but there is someone having a problem installing one of the plugins I created and the error he is getting is the following…

***@***.***:~/erpnext$ cd

***@***.***:~$ cd ~/frappe-bench

***@***.***:~/frappe-bench$ bench get-app
https://github.com/kid1194/frappe-active-users

A directory for the application 'frappe-active-users' already exists. Do
you want to continue and overwrite it? [y/N]: y

ERROR: [Errno 2] No such file or directory: 'apps/
https://github.com/kid1194/frappe-active-users'

Traceback (most recent call last):

  File "/usr/lib/python3.8/shutil.py", line 791, in move

    os.rename(src, real_dst)

FileNotFoundError: [Errno 2] No such file or directory: 'apps/
https://github.com/kid1194/frappe-active-users' ->
'archived/apps/frappe-active-users-2022-11-08'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/usr/local/bin/bench", line 8, in <module>

    sys.exit(cli())

  File "/usr/local/lib/python3.8/dist-packages/bench/cli.py", line 127, in
cli

    bench_command()

  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__

    return self.main(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main

    rv = self.invoke(ctx)

  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke

    return _process_result(sub_ctx.command.invoke(sub_ctx))

 File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke

    return ctx.invoke(self.callback, **ctx.params)

  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke

    return callback(*args, **kwargs)

  File "/usr/local/lib/python3.8/dist-packages/bench/commands/make.py",
line 159, in get_app

    get_app(

  File "/usr/local/lib/python3.8/dist-packages/bench/app.py", line 433, in
get_app

    app.remove()

  File "/usr/local/lib/python3.8/dist-packages/bench/utils/render.py", line
126, in wrapper_fn

    return fn(*args, **kwargs)

  File "/usr/local/lib/python3.8/dist-packages/bench/app.py", line 216, in
remove

    shutil.move(active_app_path, archived_app_path)

  File "/usr/lib/python3.8/shutil.py", line 811, in move

    copy_function(src, real_dst)

  File "/usr/lib/python3.8/shutil.py", line 435, in copy2

    copyfile(src, dst, follow_symlinks=follow_symlinks)

  File "/usr/lib/python3.8/shutil.py", line 264, in copyfile

    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:

FileNotFoundError: [Errno 2] No such file or directory: 'apps/
https://github.com/kid1194/frappe-active-users'

Best regards…

Hello The error is not related to the name of the app
rather it is not able to find the apps folder in your bench instance
Check if you are running that command at correct loactiom

@Harsh_Magiya Thanks for your reply…
This error made me question my knowledge :sweat_smile:

The user is running the bench get-app command in the frappe-bench directory which is the right way but he ends up getting this error…

As you can see, the dir already exists so bench asks to overwrite or not…

A directory for the application 'frappe-active-users' already exists. Do
you want to continue and overwrite it? [y/N]: y

After choosing to overwrite, he gets this…

ERROR: [Errno 2] No such file or directory: 'apps/
https://github.com/kid1194/frappe-active-users'

what if you remove the app/uninstall it and then do the process again?

@Harsh_Magiya I haven’t told him to do that…
I think that the problem is caused because of this bench code…

@step(title="Archiving App {repo}", success="App {repo} Archived")
	def remove(self, no_backup: bool = False):
		active_app_path = os.path.join("apps", self.name)

When the user chooses to overwrite the dir, bench calls the above method, remove method…
Here the value of self.name is the repo url while the value of self.repo is the repo name…
So os.path.join("apps", self.name) returns the apps dir followed by the repo url while if it was os.path.join("apps", self.repo) it will return the right path…

I will report this to bench…

Ohh understood…
seems like you solved the error on you own
Thats great :grin:

PS: Can you check this post too How to delete/refresh/clear child table entries/data from parent doctype while updating
Thanksss

1 Like