@Noxy_Faith (Noxy Faith) posted a new topic, subject "Issue when I run bench new-site site1.local as described by the tutorial". It read:

   Hi, guys when I run “bench new-site site1.local” I get the following error
    [code] 
        Installing frappe...
        Updating DocTypes for frappe        : [========================================]
        Traceback (most recent call last):
          File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
            "__main__", fname, loader, pkg_name)
          File "/usr/local/Cellar/python@2/2.7.14_3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
            exec code in run_globals
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
            main()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
            click.Group(commands=commands)(prog_name='bench')
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 722, in __call__
            return self.main(*args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 697, in main
            rv = self.invoke(ctx)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
            return _process_result(sub_ctx.command.invoke(sub_ctx))
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
            return _process_result(sub_ctx.command.invoke(sub_ctx))
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 895, in invoke
            return ctx.invoke(self.callback, **ctx.params)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 535, in invoke
            return callback(*args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/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 "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/commands/site.py", line 69, in _new_site
            _install_app(app, verbose=verbose, set_as_patched=not source_sql)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/installer.py", line 147, in install_app
            add_to_installed_apps(name)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/installer.py", line 168, in add_to_installed_apps
            post_install(rebuild_website)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/installer.py", line 232, in post_install
            init_singles()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/installer.py", line 253, in init_singles
            doc.save()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
            return self._save(*args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 279, in _save
            self.insert()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 245, in insert
            self.run_post_save_methods()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 887, in run_post_save_methods
            self.run_method("on_update")
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
            out = Document.hook(fn)(self, *args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 1029, in composer
            return composed(self, method, *args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 1012, in runner
            add_to_return_value(self, fn(self, *args, **kwargs))
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
            fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/core/doctype/domain_settings/domain_settings.py", line 25, in on_update
            self.restrict_roles_and_modules()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/core/doctype/domain_settings/domain_settings.py", line 30, in restrict_roles_and_modules
            active_domains = frappe.get_active_domains()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/__init__.py", line 1414, in get_active_domains
            return get_active_domains()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/core/doctype/domain_settings/domain_settings.py", line 70, in get_active_domains
            return frappe.cache().get_value("active_domains", _get_active_domains)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 72, in get_value
            val = generator()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/core/doctype/domain_settings/domain_settings.py", line 64, in _get_active_domains
            fields=["domain"], distinct=True)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/__init__.py", line 1178, in get_all
            return get_list(doctype, *args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/__init__.py", line 1151, in get_list
            return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/db_query.py", line 87, in execute
            result = self.build_and_run()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/model/db_query.py", line 111, in build_and_run
            return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug, update=self.update)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/apps/frappe/frappe/database.py", line 188, in sql
            self._cursor.execute(query)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
            result = self._query(query)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
            conn.query(q)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
            self._affected_rows = self._read_query_result(unbuffered=unbuffered)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
            result.read()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read
            first_packet = self.connection._read_packet()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
            packet.check_error()
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
            err.raise_mysql_exception(self._data)
          File "/Users/andelaeveloper/Desktop/Dev/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
            raise errorclass(errno, errval)
        pymysql.err.InternalError: (3065, u"Expression #1 of ORDER BY clause is not in SELECT list, references column 'b2ad9c72b3da46b3.tabHas Domain.modified' which is not in SELECT list; this is incompatible with DISTINCT")
        
    [/code]

Then @Noxy_Faith (Noxy Faith) said

    Hi guy's please I need your help

To which @dominik (Dominik) replied

    Hi Faith, are you running MariaDB 10+ or some Mysql version?
    
    Please post the output of:
    [code] 
        mysql -V
        
    [/code]

Then @Noxy_Faith (Noxy Faith) said

    @dominik when I run that command, I get “mysql Ver 14.14 Distrib 5.7.21, for osx10.12 (x86_64) using EditLine wrapper”

@dominik (Dominik) replied

    It seems like you have MySQL server installed instead of MariaDB which is a requirement. I am not sure this is the problem itself but it may have to do with it. Are you using homebrew?

To which @Noxy_Faith (Noxy Faith) replied

    Yes I am

After which, @dominik (Dominik) added

    So we checked your machine, you have MariaDB installed. Please uninstall and install mariadb through brew and try again. If this doesn't help lets see what else we can do.


{'source': 'discourse', 'url': 'https://discuss.erpnext.com/t/issue-when-i-run-bench-new-site-site1-local-as-described-by-the-tutorial/35172', 'title': 'Issue when I run bench new-site site1.local as described by the tutorial', 'views': 708, 'has_accepted_answer': False, 'word_count': 1160, 'like_count': 0, 'reply_count': 4, 'participant_count': 2, 'posts': 7, 'tags': '', 'author': '@Noxy_Faith (Noxy Faith)', 'participants': '@Noxy_Faith (Noxy Faith), @dominik (Dominik)', 'image_url': [None], 'created_at': '2018-03-25T15:47:30.050Z', 'last_posted_at': '2018-03-26T07:15:36.584Z'}