Install Frappe & ERPNext v13 beta from scratch 100% guarantee(22 steps) on ubuntu 20.04

Thanks will test …

@Aditya_Bagarka, from a security perspective try to avoid the user frappe. Every installation guide I have seen so far is using frappe as a user… that becomes a bit too common and easy and can be the source of security breach. Don’t give the other side an easy fight :wink:

Please, someone can help me with the issue below, I have v13 installed and can’t execute the schedule, My Email Campaign doesn’t update and the e-mails are not being sent.

Below, is the image of an email campaign I’m at the finish date already, but the status don’t change.

I tried to force schedule with the command below:

bench execute erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status

but nothing is happening.

Error :

Command ‘git --version’ returned non-zero exit status 127
ERROR: there was a problem while creating myfrappe
Do you wan to rollback this change ? [Y/N ]

why … ?

Thank you, after spending a day on trying to install, i got it working by following your steps to the T. :clap:

Getting below error at step no 17

Traceback (most recent call last):
File “/usr/local/bin/virtualenv”, line 7, in
from virtualenv import main
ImportError: cannot import name ‘main’

Getting frappe

$ git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --branch version-13-beta --depth 1 --origin upstream

Cloning into ‘frappe’…

remote: Enumerating objects: 3050, done.

remote: Counting objects: 100% (3050/3050), done.

remote: Compressing objects: 100% (2871/2871), done.

remote: Total 3050 (delta 403), reused 1088 (delta 109), pack-reused 0

Receiving objects: 100% (3050/3050), 13.11 MiB | 10.22 MiB/s, done.

Resolving deltas: 100% (403/403), done.

Installing frappe

$ myfrappe/env/bin/python -m pip install -q -U -e myfrappe/apps/frappe

[Errno 2] No such file or directory: ‘myfrappe/env/bin/python’: ‘myfrappe/env/bin/python’

ERROR: There was a problem while creating myfrappe

Do you want to rollback these changes? [y/N]: y

Rolling back Bench “myfrappe”

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config

Hi,

@adals, I must say, that this is the only guide that has worked on me for installing on Ubuntu 20.04.

And I have also learned a lot during the installation phase, i.e. understanding what is being done and installed at each step.

There is only one query I have. After the successful installation we have to manually run the command: bench start
Is there a way where we can make bench auto-start upon OS boot? That’ll be really helpful

Thanks

I think what you want is to run the following command at the end:

sudo bench setup production [USER]

(where [USER] is the username you use to log into the server at the command line)

That should put everything in place to have everything start up automatically. Just remember to reboot he server after you have run the command to make sure the server automatically startes everything even after a reboot.

Hope this helps.

BKM :nerd_face:

Hi,

Yes, i’ve already run that command and also rebooted the server, but bench did not start up automatically. I still had to start it up manually

I have the same error.
How did you resolve it?

I’m trying to install Frappe latest version with a slight modification of installing node v14+ instead of 12+ in Step 4.

No issues until Step 20.

But at Step 21, I’m facing this issue:

Please make sure that Redis Queue runs @ redis://localhost:11000
Traceback (most recent call last):
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/connection.py", line 559, in connect
    sock = self._connect()
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/connection.py", line 615, in _connect
    raise err
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/connection.py", line 603, in _connect
    sock.connect(socket_address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/tenacity/__init__.py", line 407, in __call__
    result = fn(*args, **kwargs)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/utils/background_jobs.py", line 271, in get_redis_conn
    redis_connection = RedisQueue.get_connection(**cred)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/utils/redis_queue.py", line 24, in get_connection
    conn.ping()
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/client.py", line 1378, in ping
    return self.execute_command('PING')
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/client.py", line 898, in execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/connection.py", line 1192, in get_connection
    connection.connect()
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/redis/connection.py", line 563, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting to localhost:11000. Connection refused.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
    main()
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/commands/__init__.py", line 26, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/commands/site.py", line 654, in uninstall
    remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/installer.py", line 242, in remove_app
    drop_doctypes = _delete_modules(modules, dry_run=dry_run)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/installer.py", line 280, in _delete_modules
    _delete_linked_documents(module_name, doctype_link_field_map, dry_run=dry_run)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/installer.py", line 300, in _delete_linked_documents
    frappe.delete_doc(doctype, record, ignore_on_trash=True, force=True)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/__init__.py", line 960, in delete_doc
    frappe.model.delete_doc.delete_doc(doctype, name, force, ignore_doctypes, for_reload,
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/model/delete_doc.py", line 116, in delete_doc
    frappe.enqueue('frappe.model.delete_doc.delete_dynamic_links',
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/__init__.py", line 1684, in enqueue
    return frappe.utils.background_jobs.enqueue(*args, **kwargs)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/utils/background_jobs.py", line 58, in enqueue
    q = get_queue(queue, is_async=is_async)
  File "/home/ubuntu/myfrappe/apps/frappe/frappe/utils/background_jobs.py", line 235, in get_queue
    return Queue(generate_qname(qtype), connection=get_redis_conn(), is_async=is_async)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/tenacity/__init__.py", line 324, in wrapped_f
    return self(f, *args, **kw)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/tenacity/__init__.py", line 404, in __call__
    do = self.iter(retry_state=retry_state)
  File "/home/ubuntu/myfrappe/env/lib/python3.8/site-packages/tenacity/__init__.py", line 361, in iter
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f2788a71610 state=finished raised ConnectionError>]

should I run bench start in a separate terminal before Step 21?

got this issue resolved by running bench start in an another terminal.

but, then i started facing this issue:

finally got to resolve the issue by running bench migrate and got frappe up & running after so many days!

thank you . i just replaced these commands because i got error that can’t create a folder .

su - USER
cd
git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
bench init --frappe-branch version-13 myfrappe