Bench new-site gameplan.xxxx failure

I’m a newbie to frappe. I am trying to setup a development enviroment following the below link.
Installing Frappe/ERPNext (develop branch) on MacOS (Apple Silicon) for Development. I’ve completed successfully till step 2.4. As I am trying to setup ERPNext I went on with setting a newsite with gamplan.
I executed the command
:arrow_forward: bench new-site gameplan.dair

Below is the error output :

MySQL root password: 

Installing frappe...
Syntax error in query:
INSERT INTO `__global_search` (`doctype`,`name`,`content`,`published`,`title`,`route`) VALUES ({'doctype': 'DocType', 'name': 'DocType State', 'content': 'Name : DocType State', 'published': 0, 'title': 'DocType State', 'route': None}) ON DUPLICATE KEY UPDATE `content`=VALUES(`content`),`published`=VALUES(`published`),`title`=VALUES(`title`),`route`=VALUES(`route`) 
Traceback (most recent call last):
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/connection.py", line 699, in connect
    sock = self.retry.call_with_retry(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/retry.py", line 46, in call_with_retry
    return do()
           ^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/connection.py", line 700, in <lambda>
    lambda: self._connect(), lambda error: self.disconnect(error)
            ^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/connection.py", line 1002, in _connect
    raise err
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/connection.py", line 990, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/global_search.py", line 429, in sync_value_in_queue
    frappe.cache.lpush("global_search_queue", json.dumps(value))
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/redis_wrapper.py", line 152, in lpush
    super().lpush(self.make_key(key), value)
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/commands/core.py", line 2706, in lpush
    return self.execute_command("LPUSH", name, *values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/client.py", line 1266, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/connection.py", line 1457, in get_connection
    connection.connect()
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/redis/connection.py", line 705, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 61 connecting to 127.0.0.1:13000. Connection refused.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/bench_helper.py", line 114, in <module>
    main()
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/bench_helper.py", line 20, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/commands/site.py", line 76, in new_site
    _new_site(
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/installer.py", line 107, in _new_site
    install_app(app, verbose=verbose, set_as_patched=not source_sql, force=False)
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/installer.py", line 286, in install_app
    out = frappe.get_attr(before_install)()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/install.py", line 11, in before_install
    frappe.reload_doc("core", "doctype", "doctype_state")
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/__init__.py", line 1362, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/modules/utils.py", line 203, in reload_doc
    return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/modules/import_file.py", line 57, in import_files
    return import_file(
           ^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/modules/import_file.py", line 65, in import_file
    return import_file_by_path(
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/modules/import_file.py", line 148, in import_file_by_path
    import_doc(
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/modules/import_file.py", line 245, in import_doc
    doc.insert()
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/model/document.py", line 310, in insert
    self.run_post_save_methods()
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/model/document.py", line 1133, in run_post_save_methods
    update_global_search(self)
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/global_search.py", line 285, in update_global_search
    sync_value_in_queue(value)
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/global_search.py", line 432, in sync_value_in_queue
    sync_values((value,))
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/utils/global_search.py", line 423, in sync_values
    query.run()
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/query_builder/utils.py", line 87, in execute_query
    result = frappe.db.sql(query, params, *args, **kwargs)  # nosemgrep
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/apps/frappe/frappe/database/database.py", line 217, in sql
    self._cursor.execute(query, values)
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/connections.py", line 558, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/connections.py", line 822, in _read_query_result
    result.read()
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/connections.py", line 1200, in read
    first_packet = self.connection._read_packet()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/connections.py", line 772, in _read_packet
    packet.raise_for_error()
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/Users/genxgem/Explore/dair-dev/env/lib/python3.11/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''doctype': 'DocType', 'name': 'DocType State', 'content': 'Name : DocType Sta...' at line 1")

Any help will be appriciated.

Looks like there’s a syntax error on frappe’s develop branch. Seems to be unrelated to your setup.

It’ll probably be fixed within a couple of days.

I have the same error while installing ERPNext. Please reply if you find a solution.

Most likely your redis process is not started.

Hi:

Same here. Issue raised.

Solved!

@avc how you solved this issue?