[SOLVED] MYSQL connect() argument when bench update translations

hi again…

am in development branch and i am updating the translations of the Thai language, but i got the error below:

frappe@tcdc:~/frappe-bench/sites$  bench update-translations th en.csv th.csv
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 706, in update_translations
    frappe.translate.update_translations(lang, untranslated_file, translated_file)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 540, in update_translations
    write_translations_file(app, lang, full_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 567, in write_translations_file
    app_messages = get_messages_for_app(app)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/translate.py", line 257, in get_messages_for_app
    where module in ({})""".format(modules)):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 193, in sql_list
    return [r[0] for r in self.sql(query, values, debug=debug)]
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 106, in sql
    self.connect()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 52, in connect
    use_unicode=True, charset='utf8')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
TypeError: connect() argument 2 must be string, not None

Seems issue with site_config.json

Please check db_name in site_config.json

@saurabh6790 there is no problem in the db_name or db password as the system is working and we are adding details on daily basis…

Finally figured it out…

the problem was that i didnt use any site in bench, to solve it i just typed:

bench use **sitename**

then tried again and it was solved…

2 Likes