I am unable create new site or login into erpnext

$ bench new-site mysite
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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/cygnet/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/cygnet/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/cygnet/frappe-bench/apps/frappe/frappe/commands.py”, line 69, in new_site
_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/cygnet/frappe-bench/apps/frappe/frappe/commands.py”, line 87, in _new_site
install_db(root_login=mariadb_root_username, root_password=mariadb_root_password, db_name=db_name, admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/cygnet/frappe-bench/apps/frappe/frappe/installer.py”, line 32, in install_db
create_database_and_user(force, verbose)
File “/home/cygnet/frappe-bench/apps/frappe/frappe/installer.py”, line 50, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/cygnet/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 526, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/cygnet/frappe-bench/apps/frappe/frappe/database.py”, line 106, in sql
self.connect()
File “/home/cygnet/frappe-bench/apps/frappe/frappe/database.py”, line 52, in connect
use_unicode=True, charset=‘utf8’)
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”)

@purva looks like you have entered an incorrect MySQL root password.

i never set any password for mysql. Still it is going on stating this.

Did you not enter one here?

@purva how did you install erpnext. did you use the easy install script ?

@purva

You have to set mysql root password, you may have to run mysql_secure_installation to set the root password.

Yes that is what i am following. but when I started creating this new site , it is leading to ask this pwd which i didnt set at my end. I am unable to login to erpnext localhost:8000 even when i do bench start

mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

@purva please check if there is a frappe_passwords file in your home directory. It must contain the mysql root password.

Now this error once site is created by accessing localhost:8000

ImportError

ImportError: No module named shopping_cart.utils

bench start
13:28:47 system | workerbeat.1 started (pid=4711)
13:28:47 system | web.1 started (pid=4718)
13:28:47 system | redis_queue.1 started (pid=4714)
13:28:47 system | redis_socketio.1 started (pid=4708)
13:28:47 system | async_worker.1 started (pid=4720)
13:28:47 system | socketio.1 started (pid=4727)
13:28:47 system | longjob_worker.1 started (pid=4730)
13:28:47 redis_socketio.1 | [4719] 01 Apr 13:28:47.613 # Fatal error, can’t open config file ‘config/redis_socketio.conf’
13:28:47 system | redis_socketio.1 stopped (rc=1)
13:28:47 system | watch.1 started (pid=4723)
13:28:47 system | worker.1 started (pid=4713)
13:28:47 redis_queue.1 | [4725] 01 Apr 13:28:47.621 # Fatal error, can’t open config file ‘config/redis_queue.conf’
13:28:47 system | redis_queue.1 stopped (rc=1)
13:28:47 system | redis_cache.1 started (pid=4742)
13:28:47 system | sending SIGTERM to workerbeat.1 (pid 4711)
13:28:47 system | sending SIGTERM to worker.1 (pid 4713)
13:28:47 system | sending SIGTERM to web.1 (pid 4718)
13:28:47 system | sending SIGTERM to async_worker.1 (pid 4720)
13:28:47 system | sending SIGTERM to socketio.1 (pid 4727)
13:28:47 system | sending SIGTERM to redis_cache.1 (pid 4742)
13:28:47 system | sending SIGTERM to watch.1 (pid 4723)
13:28:47 system | sending SIGTERM to longjob_worker.1 (pid 4730)
13:28:47 redis_cache.1 | [4743] 01 Apr 13:28:47.647 # Fatal error, can’t open config file ‘config/redis_cache.conf’
13:28:47 system | redis_cache.1 stopped (rc=1)
13:28:47 system | web.1 stopped (rc=-15)
13:28:47 system | watch.1 stopped (rc=-15)
13:28:47 system | workerbeat.1 stopped (rc=-15)
13:28:47 system | socketio.1 stopped (rc=-15)
13:28:47 system | longjob_worker.1 stopped (rc=-15)
13:28:47 system | worker.1 stopped (rc=-15)
13:28:47 system | async_worker.1 stopped (rc=-15)

please help on above issue

Hi @purva ,
please check the your mysql is working or not?
using bench mysql command to check databases available or not.

Thank

Hi Purva,

Your setup doesn’t seem to be complete and that’s what is causing so many issues. For instance, your config files are not in place. Did you face errors during the initial installation using setup_frappe.sh?

Hello,

Presently I am also facing issue while loading. It stated as import error. ImportError: No module named shopping_cart.utils. I didn’t get any error during installation.

Your setup is problematic. You seem to have upgraded from version 4 to latest version. Did you run update with --upgrade?

Hello,

I did bench update --bench .

Did you update from v4?

WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
remote: Counting objects: 89, done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 89 (delta 10), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (89/89), done.
From https://github.com/frappe/frappe
8253932…fc5155c develop -> upstream/develop
e1adc72…3c345a6 hotfix -> upstream/hotfix
INFO:bench.utils:updating bench
WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
Already up-to-date.
WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
INFO:bench.utils:updating bench
WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
Already up-to-date.
WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
From https://github.com/frappe/frappe

  • branch develop -> FETCH_HEAD
    Updating 8253932…fc5155c
    Fast-forward
    frappe/boot.py | 9 ±
    frappe/config/desk.py | 2 ±
    frappe/core/doctype/user/user.json | 32 ±
    frappe/core/doctype/user/user.py | 8 ±
    frappe/core/notifications.py | 2 ±
    frappe/desk/doctype/todo/todo.json | 788 +++++++++±----------
    frappe/desk/doctype/todo/todo_list.js | 12 -
    frappe/desk/page/activity/activity.js | 2 ±
    frappe/desk/page/activity/activity_row.html | 5 ±
    frappe/desk/page/chat/chat.py | 4 ±
    frappe/email/doctype/email_alert/email_alert.json | 27 ±
    frappe/patches.txt | 1 +
    frappe/patches/v7_0/init.py | 0
    frappe/patches/v7_0/set_user_fullname.py | 9 +
    frappe/public/build.json | 6 ±
    frappe/public/css/avatar.css | 24 +
    frappe/public/css/sidebar.css | 4 +
    frappe/public/css/website.css | 24 +
    frappe/public/js/frappe/dom.js | 10 -
    frappe/public/js/frappe/form/footer/assign_to.js | 15 ±
    frappe/public/js/frappe/form/footer/timeline.js | 9 ±
    …/js/frappe/form/footer/timeline_item.html | 7 ±
    frappe/public/js/frappe/form/form_sidebar.html | 3 +
    frappe/public/js/frappe/form/form_viewers.js | 2 +
    frappe/public/js/frappe/form/formatters.js | 3 ±
    frappe/public/js/frappe/form/share.js | 2 +
    frappe/public/js/frappe/form/sidebar.js | 31 ±
    frappe/public/js/frappe/form/users_in_sidebar.html | 4 ±
    frappe/public/js/frappe/misc/common.js | 226 ++++++
    frappe/public/js/frappe/misc/display_image.js | 0
    frappe/public/js/frappe/misc/number_format.js | 17 ±
    frappe/public/js/frappe/misc/user.js | 40 ±
    frappe/public/js/frappe/ui/toolbar/navbar.html | 5 ±
    …/public/js/frappe/ui/toolbar/notifications.js | 2 ±
    frappe/public/js/frappe/ui/toolbar/toolbar.js | 4 ±
    frappe/public/js/legacy/clientscriptAPI.js | 8 +
    frappe/public/js/legacy/datatype.js | 31 -
    frappe/public/less/avatar.less | 29 +
    frappe/public/less/sidebar.less | 5 +
    frappe/templates/includes/navbar/navbar_login.html | 2 ±
    frappe/utils/init.py | 9 ±
    frappe/website/js/website.js | 67 ±
    42 files changed, 876 insertions(+), 614 deletions(-)
    create mode 100644 frappe/patches/v7_0/init.py
    create mode 100644 frappe/patches/v7_0/set_user_fullname.py
    create mode 100644 frappe/public/js/frappe/misc/common.js
    create mode 100644 frappe/public/js/frappe/misc/display_image.js
    /home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
    SNIMissingWarning
    /home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    WARNING: gnome-keyring:: couldn’t connect to: /run/user/1001/keyring-C9kBXd/pkcs11: Permission denied
    p11-kit: skipping module ‘gnome-keyring’ whose initialization failed: An error occurred on the device
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 162, 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/cygnet/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/cygnet/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/cygnet/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/cygnet/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/cygnet/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/cygnet/frappe-bench/apps/frappe/frappe/commands.py”, line 910, in backup
    odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, force=True)
    File “/home/cygnet/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 164, in scheduled_backup
    odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
    File “/home/cygnet/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 168, in new_backup
    delete_temp_backups(older_than = frappe.conf.keep_backups_for_hours or 48)
    File “/home/cygnet/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 181, in delete_temp_backups
    file_list = os.listdir(get_backup_path())
    OSError: [Errno 2] No such file or directory: ‘./site1.local/private/backups’
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==2.0.0’, ‘console_scripts’, ‘bench’)()
    File “/home/cygnet/bench-repo/bench/cli.py”, line 40, in cli
    bench_command()
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/cygnet/bench-repo/bench/commands/update.py”, line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/cygnet/bench-repo/bench/commands/update.py”, line 89, in _update
    backup_all_sites(bench=bench_path)
    File “/home/cygnet/bench-repo/bench/utils.py”, line 341, in backup_all_sites
    backup_site(site, bench=bench)
    File “/home/cygnet/bench-repo/bench/utils.py”, line 337, in backup_site
    run_frappe_cmd(’–site’, site, ‘backup’, bench=bench)
    File “/home/cygnet/bench-repo/bench/utils.py”, line 450, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘site1.local’, ‘backup’)

First, try switching bench-repo branch to v1.x branch and try