Geeting error when running the code....bench --site library install-app library_management

Installing library_management…
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/site.py”, line 166, in install_app
_install_app(app, verbose=context.verbose)
File “/home/ashin/frappe-bench/apps/frappe/frappe/installer.py”, line 75, in install_app
frappe.only_for(“System Manager”)
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 508, in only_for
myroles = set(get_roles())
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 388, in get_roles
return get_user().get_roles()
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/user.py”, line 61, in get_roles
self.roles = get_roles(self.name)
File “/home/ashin/frappe-bench/apps/frappe/frappe/permissions.py”, line 310, in get_roles
roles = frappe.cache().hget(“roles”, user, get)
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
value = generator()
File “/home/ashin/frappe-bench/apps/frappe/frappe/permissions.py”, line 305, in get
return [r[0] for r in frappe.db.sql(“select name from tabRole”)] # return all available roles
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 165, in sql
self._cursor.execute(query)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 516, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 727, in _read_query_result
result.read()
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 1066, in read
first_packet = self.connection._read_packet()
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 683, in _read_packet
packet.check_error()
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, “Table ‘_00299a408dc3498a.tabRole’ doesn’t exist”)

guyzzz help me with the issue.
thanks in advance

Hello,

Did you create a new site for the app and have you set it as the current site?

Can you check the site_config.json file of the site you’re using? If the database name is the same as the one shown in the error (_00299a408dc3498a), then the site may not have been created successfully.

Regards,
littlehera

ashin@ashin-VirtualBox:~/frappe-bench$ bench new-site library
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/site.py”, line 33, in new_site
db_type = db_type)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/site.py”, line 66, in _new_site
source_sql=source_sql,force=force, reinstall=reinstall, db_type=db_type)
File “/home/ashin/frappe-bench/apps/frappe/frappe/installer.py”, line 36, in install_db
setup_database(force, source_sql, verbose)
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/init.py”, line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py”, line 17, in setup_database
raise Exception(“Database %s already exists” % (db_name,))
Exception: Database _00299a408dc3498a already exists

yes i have created it.


ashin@ashin-VirtualBox:~/frappe-bench$ bench --site library install-app library_management

Installing library_management…
Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/site.py”, line 166, in install_app
_install_app(app, verbose=context.verbose)
File “/home/ashin/frappe-bench/apps/frappe/frappe/installer.py”, line 75, in install_app
frappe.only_for(“System Manager”)
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 508, in only_for
myroles = set(get_roles())
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 388, in get_roles
return get_user().get_roles()
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/user.py”, line 61, in get_roles
self.roles = get_roles(self.name)
File “/home/ashin/frappe-bench/apps/frappe/frappe/permissions.py”, line 310, in get_roles
roles = frappe.cache().hget(“roles”, user, get)
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 173, in hget
value = generator()
File “/home/ashin/frappe-bench/apps/frappe/frappe/permissions.py”, line 305, in get
return [r[0] for r in frappe.db.sql(“select name from tabRole”)] # return all available roles
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 165, in sql
self._cursor.execute(query)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 516, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 727, in _read_query_result
result.read()
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 1066, in read
first_packet = self.connection._read_packet()
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/connections.py”, line 683, in _read_packet
packet.check_error()
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/ashin/frappe-bench/env/lib/python3.5/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, “Table ‘_00299a408dc3498a.tabRole’ doesn’t exist”)

this is the error i’m getting.

thank you :slight_smile:

I think either the site may not have been properly created or the library management app needs frappe/erpnext installed but the frappe/erpnext was not installed to the site. :sweat_smile:

If the site wasn’t properly created (or it was created but with errors), you can try creating a new site. Then, install the app on the new site.

For the second one, try bench --site library install-app erpnext before running bench --site library install-app library_management.

By the way, what frappe and erpnext versions are you currently on? And do you know what frappe and erpnext versions were used to develop the library_management app?

1 Like

hello ,
i’m very new this environment of developing , i have just followed the frappe.io and github instructions to create the app. so i dnt knw where i went wrong.
i wish you can help me out with issue.
thank you
:wink:

You can get the frappe, erpnext and app versions by typing bench version in your frappe-bench folder. :slight_smile:

By the way, try creating a new site then installing your new app in the new site. If it works, maybe there’s a problem with the first site (which you can just delete/drop if you don’t need it anymore).

hello this is the version currently im working on.
ashin@ashin-VirtualBox:~/frappe-bench$ bench version
frappe 12.x.x-develop
fatal: Not a git repository (or any of the parent directories): .git
library_management 0.0.1
fatal: Not a git repository (or any of the parent directories): .git
meeting 0.0.1

thank you :slight_smile:

can i anyone help me with this issueee…

ashin@ashin-VirtualBox:~/frappe-bench$ bench --site site1.local install-app erpnext
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/ashin/frappe-bench/apps/frappe/frappe/commands/site.py”, line 166, in install_app
_install_app(app, verbose=context.verbose)
File “/home/ashin/frappe-bench/apps/frappe/frappe/installer.py”, line 53, in install_app
frappe.clear_cache()
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 539, in clear_cache
frappe.cache_manager.clear_user_cache()
File “/home/ashin/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 29, in clear_user_cache
clear_global_cache()
File “/home/ashin/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 37, in clear_global_cache
clear_website_cache()
File “/home/ashin/frappe-bench/apps/frappe/frappe/website/render.py”, line 289, in clear_cache
for method in frappe.get_hooks(“website_clear_cache”):
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 911, in get_hooks
hooks = _dict(cache().get_value(“app_hooks”, load_app_hooks))
File “/home/ashin/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 72, in get_value
val = generator()
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 889, in load_app_hooks
for app in [app_name] if app_name else get_installed_apps(sort=True):
File “/home/ashin/frappe-bench/apps/frappe/frappe/init.py”, line 853, in get_installed_apps
installed = json.loads(db.get_global(“installed_apps”) or “[]”)
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 683, in get_global
return self.get_default(key, user)
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 687, in get_default
d = self.get_defaults(key, parent)
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 705, in get_defaults
defaults = frappe.defaults.get_defaults(parent)
File “/home/ashin/frappe-bench/apps/frappe/frappe/defaults.py”, line 71, in get_defaults
globald = get_defaults_for()
File “/home/ashin/frappe-bench/apps/frappe/frappe/defaults.py”, line 198, in get_defaults_for
where parent = %s order by creation"“”, (parent,), as_dict=1)
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 120, in sql
self.connect()
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/database.py”, line 73, in connect
self._conn = self.get_connection()
File “/home/ashin/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 85, in get_connection
local_infile = frappe.conf.local_infile)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/init.py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 327, in init
self.connect()
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 598, in connect
self._request_authentication()
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 862, in _request_authentication
auth_packet = self._process_auth(plugin_name, auth_packet)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 933, in _process_auth
pkt = self._read_packet()
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 683, in _read_packet
packet.check_error()
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/ashin/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1045, u"Access denied for user ‘_1bd3e0294da19198’@‘localhost’ (using password: YES)")

thanks in advancee…

cd to sites/site1.local
nano site_config.json

Check the database name. If the database name does not match with: “_1bd3e0294da19198”, access mysql using root using mysql -u root -p.

Show databases. If _1bd3e0294da19198 is one of the databases, then you might want to drop that database manually.

2 Likes