Getting this error while installing erpNext

Hi,

This is Ram. Trying out ERPNext installation on Cent OS 6.

I tried manual way to install it but it triggers errors.

After I executed the following command

sudo pip install -e bench-repo

the error was

Cleaning up…
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/semantic-version
Storing debug log for failure in /root/.pip/pip.log

After I checked the log, I found this

tail -f /root/.pip/pip.log
status = self.run(options, args)
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/commands/install.py”, line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/req.py”, line 1229, in prepare_files
req_to_install.run_egg_info()
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/req.py”, line 325, in run_egg_info
command_desc=‘python setup.py egg_info’)
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/util.py”, line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/semantic-version

I am trying to understand what went wrong.

But not able to understand this.

Please help me in installing it.

Regards.
Ram

Still am not able to know why the install failed but,

You’re using Python 2.6, ERPNext needs Python2.7

Can you try using the automated script? GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

Hey Hi, Thanks for the quick reply. It did well.

I updated Python to 2.7 and I could able to install it upto DB import.

During the step “bench new-site site1.local”, giving errors. Pasted the errors. Sorry for pasting such a big error list

MySQL root password:
Created user site1.local
Created database site1.local
Granted privileges to user site1.local and database site1.local
Starting database import…
ERROR 1064 (42000) at line 10: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘(6) DEFAULT NULL,
modified datetime(6) DEFAULT NULL,
modified_by varchar’ at line 3
Imported from database /var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/data/Framework.sql
Traceback (most recent call last):
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/env/bin/frappe”, line 9, in
load_entry_point(‘frappe==4.4.6’, ‘console_scripts’, ‘frappe’)()
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 53, in main
return run(fn, parsed_args)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 81, in run
out = globals().get(fn)(*args.get(fn), **args)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 67, in new_fn
return fn(*args, **new_kwargs)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 328, in install
_install(db_name, root_login, root_password, source_sql, admin_password, force, site_config, reinstall, quiet, install_apps)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 311, in _install
install_app(“frappe”, verbose=verbose, set_as_patched=not source_sql)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/installer.py”, line 90, in install_app
frappe.clear_cache()
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/init.py”, line 287, in clear_cache
frappe.sessions.clear_cache()
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/sessions.py”, line 49, in clear_cache
for sess in frappe.db.sql(“”“select user, sid from tabSessions”“”, as_dict=1):
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/apps/frappe/frappe/database.py”, line 121, in sql
self._cursor.execute(query)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/var/www/html/erpnext.flask.com/public_html/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, “Table ‘site1.local.tabSessions’ doesn’t exist”)
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/root/bench-repo/bench/cli.py”, line 29, in cli
return bench()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/root/bench-repo/bench/cli.py”, line 89, in new_site
_new_site(site)
File “/root/bench-repo/bench/utils.py”, line 76, in new_site
exec_cmd(“{frappe} --install {site} {site}”.format(frappe=get_frappe(bench=bench), site=site), cwd=os.path.join(bench, ‘sites’))
File “/root/bench-repo/bench/utils.py”, line 59, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘/var/www/html/erpnext.flask.com/public_html/frappe-bench/env/bin/frappe --install site1.local site1.local’ returned non-zero exit status 1

Actually I am using the MySQL Database.

Here is the MySQL conf setting /etc/my.cnf

The MySQL server

[mysqld]
default-storage-engine=MyISAM
#skip-innodb
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 16K
max_allowed_packet = 4M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K

Can’t I use MySQL instead mariDB?

I have checked the MySQL, site1.local DB was created with only table _Auth.

Please help me in resolving this issue.

Ram

Not at the moment because time precision support. If you look at the trace, it is failing exactly because of that.

Any reason why you want to use MySQL instead of MariaDB?

Again lots of thanks for the reply.

I am on Cent OS 6.5 on VPS. Already there are other application running on it.

The normal installation of MariaDB (using yum) seems to be replacing MySQL. So thought MySQL will be used.

Let me try out mariaDB and see what I get.

Will update you shortly.

Ram

As MariaDB is drop in replacement, your other app might run on MariaDB too. Also, I recommend that you ERPNext on VPS dedicated to it…

Hi,

As you said I installed MariaDB and Python 2.7.

But here is the output

bench init frappe-bench
Already using interpreter /usr/local/bin/python2.7
Initialized empty Git repository in /var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/.git/
remote: Counting objects: 61372, done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 61372 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (61372/61372), 25.18 MiB | 15.35 MiB/s, done.
Resolving deltas: 100% (43416/43416), done.
installing frappe
Command python setup.py egg_info failed with error code 1 in /var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/env/build/mysql-python
Storing debug log for failure in /root/.pip/pip.log
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/root/bench-repo/bench/cli.py”, line 29, in cli
return bench()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/root/bench-repo/bench/cli.py”, line 68, in init
no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch)
File “/root/bench-repo/bench/utils.py”, line 47, in init
get_app(‘frappe’, frappe_path, branch=frappe_branch, bench=path)
File “/root/bench-repo/bench/app.py”, line 35, in get_app
install_app(app, bench=bench)
File “/root/bench-repo/bench/app.py”, line 53, in install_app
find_links=find_links))
File “/root/bench-repo/bench/utils.py”, line 59, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘frappe-bench/env/bin/pip install -q -e frappe-bench/apps/frappe’ returned non-zero exit status 1

Waiting for your valuable reply.

Regards.
Ram

MariaDB 5.5.40 has a bug,

run bench patch mariadb-config as root and init the bench again (after removing the previous dir)

Hi,

Is it bench patch mariadb-config ?

Because it says

Usage: bench [OPTIONS] COMMAND [ARGS]…

Error: No such command “mariadb-config”.

Where am I going wrong? Please help me.

Ram

Yes, maybe your bench repo is not up to date,

As root, run

su - frappe
cd ~/bench-repo
git pull

Then try the patch command.

Hi,

I did this after entering to bench-repo/

then

git pull
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 14 (delta 2), reused 8 (delta 2)
Unpacking objects: 100% (14/14), done.
From GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
3d9875b…3633897 master → origin/master

  • [new branch] v0.9wip → origin/v0.9wip
    Updating 3d9875b…3633897
    Fast-forward
    README.md | 4 ++++
    1 files changed, 4 insertions(+), 0 deletions(-)

Then executed the following command

bench patch mariadb-config

But again the same output
Usage: bench [OPTIONS] COMMAND [ARGS]…

Error: No such command “patch”.

Please help me to resolve this.

Ram

I think your bench is not installed in editable mode,
Try the following as root

pip-2.7 uninstall bench
pip-2.7 install -e /home/frappe/bench-repo
bench patch mariadb-config

Thanks for the quick support.

Here is what i got

After this
pip-2.7 uninstall bench
-bash: pip-2.7: command not found

So I did
pip uninstall bench

Here is the error log

Traceback (most recent call last):
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/basecommand.py”, line 122, in main
status = self.run(options, args)
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/commands/uninstall.py”, line 59, in run
requirement_set.uninstall(auto_confirm=options.yes)
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/req.py”, line 1035, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File “/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/req.py”, line 505, in uninstall
raise UninstallationError(“Cannot uninstall requirement %s, not installed” % (self.name,))
UninstallationError: Cannot uninstall requirement bench, not installed

Sorry for troubling like this…

But your help will be highly appreciated.

Ram

Hi,

I am sorry. Please ignore my previous thread/post.

After executing the below line, got error list which is pasted below

bench patch mariadb-config
/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/patches/fix-mariadb.sh: line 6: mysql_config: command not found
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/cli.py”, line 29, in cli
return bench()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/cli.py”, line 338, in _patch_mariadb_config
exec_cmd(os.path.join(repo_dir, ‘patches’, ‘fix-mariadb.sh’), cwd=os.path.join(repo_dir, ‘patches’))
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/utils.py”, line 59, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/patches/fix-mariadb.sh’ returned non-zero exit status 127

How can I resolve this?

Ram

The “pip” you used was for Python 2.6, we need to use pip for Python 2.6

Does, pip2.7 work for you?

Hi,

I used pip2.7.

See this

/usr/local/bin/pip2.7 install -e /var/www/html/erpnext.ideaflask.com/public_html/bench-repo

The above command executed and gave this output

Obtaining file:///var/www/html/erpnext.ideaflask.com/public_html/bench-repo
Running setup.py (path:/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/setup.py) egg_info for package from file:///var/www/html/erpnext.ideaflask.com/public_html/bench-repo

file bench.py (for module bench) not found

Requirement already satisfied (use --upgrade to upgrade): Click in /usr/local/lib/python2.7/site-packages (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): jinja2 in /usr/local/lib/python2.7/site-packages (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/site-packages (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/site-packages/requests-2.4.3-py2.7.egg (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): honcho in /usr/local/lib/python2.7/site-packages (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): semantic-version in /usr/local/lib/python2.7/site-packages (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): GitPython==0.3.2.RC1 in /usr/local/lib/python2.7/site-packages (from bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): markupsafe in /usr/local/lib/python2.7/site-packages (from jinja2->bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): gitdb>=0.5.1 in /usr/local/lib/python2.7/site-packages (from GitPython==0.3.2.RC1->bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): async>=0.6.1 in /usr/local/lib/python2.7/site-packages (from gitdb>=0.5.1->GitPython==0.3.2.RC1->bench==0.1)
Requirement already satisfied (use --upgrade to upgrade): smmap>=0.8.0 in /usr/local/lib/python2.7/site-packages (from gitdb>=0.5.1->GitPython==0.3.2.RC1->bench==0.1)
Installing collected packages: bench
Running setup.py develop for bench

file bench.py (for module bench) not found
Creating /usr/local/lib/python2.7/site-packages/bench.egg-link (link to .)
Adding bench 0.1 to easy-install.pth file
Installing bench script to /usr/local/bin

Installed /var/www/html/erpnext.ideaflask.com/public_html/bench-repo

Successfully installed bench

Later did this
bench patch mariadb-config

Output:
/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/patches/fix-mariadb.sh: line 6: mysql_config: command not found
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/cli.py”, line 29, in cli
return bench()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/cli.py”, line 338, in _patch_mariadb_config
exec_cmd(os.path.join(repo_dir, ‘patches’, ‘fix-mariadb.sh’), cwd=os.path.join(repo_dir, ‘patches’))
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/utils.py”, line 59, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/patches/fix-mariadb.sh’ returned non-zero exit status 127

Is there anything wrong that I am doing?

Ram

You haven’t installed all mariadb related packages,

sudo apt-get install  mariadb-common libmariadbclient-dev 

Hi,

Now i cleared those steps but stuck while adding the site

bench new-site site1.local
MySQL root password:
Traceback (most recent call last):
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/env/bin/frappe”, line 9, in
load_entry_point(‘frappe==4.5.0’, ‘console_scripts’, ‘frappe’)()
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 53, in main
return run(fn, parsed_args)
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 81, in run
out = globals().get(fn)(*args.get(fn), **args)
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 67, in new_fn
return fn(*args, **new_kwargs)
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 328, in install
_install(db_name, root_login, root_password, source_sql, admin_password, force, site_config, reinstall, quiet, install_apps)
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/cli.py”, line 309, in _install
admin_password = admin_password, verbose=verbose, force=force, site_config=site_config, reinstall=reinstall)
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/installer.py”, line 30, in install_db
create_database_and_user(force, verbose)
File “/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/apps/frappe/frappe/installer.py”, line 50, in create_database_and_user
raise Exception(“Database %s already exists” % (db_name,))
Exception: Database site1.local already exists
Error: None
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/cli.py”, line 29, in cli
return bench()
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/cli.py”, line 89, in new_site
_new_site(site)
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/utils.py”, line 76, in new_site
exec_cmd(“{frappe} --install {site} {site}”.format(frappe=get_frappe(bench=bench), site=site), cwd=os.path.join(bench, ‘sites’))
File “/var/www/html/erpnext.ideaflask.com/public_html/bench-repo/bench/utils.py”, line 59, in exec_cmd
subprocess.check_call(cmd, cwd=cwd, shell=True)
File “/usr/local/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘/var/www/html/erpnext.ideaflask.com/public_html/frappe-bench/env/bin/frappe --install site1.local site1.local’ returned non-zero exit status 1

Can you please help me?

Ram

Hey hi,

Any hope on this issue?

Waiting for your valuable info.

Ram

Hello Ram,

Trace show “site1.local” you have already created. follow next step as per our documentation. I’m sure your instance will be up and running.

Sunil
Nescode (http://nescode.com)
Partner for ERPNext