Bench new-site error(Cant connect to DB)

Hi
i am getting the following error when i try yo create the site.



WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

MySQL root password: 
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/srv/bench/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/srv/bench/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/srv/bench/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/srv/bench/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/srv/bench/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/srv/bench/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/srv/bench/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/srv/bench/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/srv/bench/frappe-bench/apps/frappe/frappe/commands/site.py", line 34, in new_site
    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
  File "/srv/bench/frappe-bench/apps/frappe/frappe/commands/site.py", line 65, in _new_site
    admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
  File "/srv/bench/frappe-bench/apps/frappe/frappe/installer.py", line 38, in install_db
    create_database_and_user(force, verbose)
  File "/srv/bench/frappe-bench/apps/frappe/frappe/installer.py", line 62, in create_database_and_user
    if force or (db_name not in dbman.get_database_list()):
  File "/srv/bench/frappe-bench/apps/frappe/frappe/model/db_schema.py", line 555, in get_database_list
    return [d[0] for d in self.db.sql("SHOW DATABASES")]
  File "/srv/bench/frappe-bench/apps/frappe/frappe/database.py", line 165, in sql
    self.connect()
  File "/srv/bench/frappe-bench/apps/frappe/frappe/database.py", line 115, in connect
    charset='utf8mb4', use_unicode = True, conv = conversions, local_infile = self.local_infile)
TypeError: __init__() takes 1 positional argument but 4 positional arguments (and 4 keyword-only arguments) were given

can someone help me to install site? i have tried both 10.3 and 10.4v mariadb.

I ran into this issue. I think pymysql only wants keyword arguments. I edited apps/frappe/frappe/database.py around line 110 to something like this:

    self._conn = pymysql.connect(host=self.host, user=self.user or '', password=self.password or '',charset='utf8mb4', use_unicode = True, ssl=self.ssl, conv = conversions, local_infile = self.local_infile)
else:
    self._conn = pymysql.connect(host=self.host, user=self.user or '', password=self.password or '', charset='utf8mb4', use_unicode = True, conv = conversions, local_infile = self.local_infile)

Now I have another error but it is a different one.
pymysql.err.OperationalError: (1054, "Unknown column 'gcalendar_sync_id' in 'field list'")
I’ll open a new thread if I have to.

Try a

bench migrate

Which version of PyMySQL are you using? The syntax has changed in the latest version (1.0.2). Consider downgrading to 0.9.3.

2 Likes

i did a downgrade to PyMySQL version 0.10.1 release date Sep 10, 2020 (PyMySQL · PyPI)

worked… i use v12