Error create new site: No module file_manager

Bench and . frappe-bench path are updated (I run bench update)… and I tried to create a new site and get these:

I just download bench, use bench init frappe-benchcd frappe-benchbench new-site test.local

any thoughts?

Updating DocTypes for frappe        : [========                                ]Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 33, in new_site
    db_type = db_type)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 70, in _new_site
    _install_app(app, verbose=verbose, set_as_patched=not source_sql)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 85, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/sync.py", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 65, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 133, in import_doc
    doc.insert()
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 248, in insert
    self.run_post_save_methods()
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 915, in run_post_save_methods
    self.run_method("on_update")
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 780, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1058, in composer
    return composed(self, method, *args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1041, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 774, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 275, in on_update
    self.run_module_method("on_doctype_update")
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 342, in run_module_method
    module = load_doctype_module(self.name, self.module)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 186, in load_doctype_module
    raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Prepared Report (frappe.core.doctype.prepared_report.prepared_report Error: No module named file_manager)
Installing frappe...
Updating DocTypes for frappe        : [========                                ]Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 33, in new_site
    db_type = db_type)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 70, in _new_site
    _install_app(app, verbose=verbose, set_as_patched=not source_sql)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 85, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/sync.py", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 65, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 133, in import_doc
    doc.insert()
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 248, in insert
    self.run_post_save_methods()
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 915, in run_post_save_methods
    self.run_method("on_update")
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 780, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1058, in composer
    return composed(self, method, *args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1041, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 774, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 275, in on_update
    self.run_module_method("on_doctype_update")
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 342, in run_module_method
    module = load_doctype_module(self.name, self.module)
  File "/Users/fellipeh/Developer/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py", line 186, in load_doctype_module
    raise ImportError('Module import failed for {0} ({1})'.format(doctype, module_name + ' Error: ' + str(e)))
ImportError: Module import failed for Prepared Report (frappe.core.doctype.prepared_report.prepared_report Error: No module named file_manager)

How do I get these fix? It’s already merged?

Just get the latest on that branch (develop).

Some advice: As of December 2018, if you are developing a custom app, use Staging as your base branch. It is getting more stable and bug-free every day while Develop has a lot of (big) changes and I suspect will be coming in and out of stability for a while. This prediction is based on an outsider’s perspective and not on conversations with the Frappe team. They’re a pretty transparent bunch, and I don’t think they making things unstable on purpose; I think it’s a symptom of big improvements going on, and there will be more of those.

1 Like

Thanks!

Im start to use frappe, and I'll use custom app every time.. so, how can I start using Staging branch? Because on doc jsut say: bench init name_of_dir`

Well, a couple of things:
Don’t use a custom app every time. Some changes are valuable to the community and once you get comfortable with the workflow, making enhancements ins’t terribly hard (and the process will make you a better programmer and a better person). But learning how to make changes with custom apps is a safer place to start for sure. If you have a change you think that you want to change from customer-specific to general purpose or country specific, it’s usually worth it to do this, because you’ve shifted the burden of maintaining this enhancement onto all of the other people who want it. Just be careful about customer names or really workflow specific stuff in your code in the first place. If you want help contributing a feature from your custom app, please ask for help here.

To answer your specific question:
When starting a new bench:
bench init fellipeh-bench --python python3.5 --verbose --frappe-branch staging ← Name your benches in case you want more than one
And to ensure you get the ERPNext staging branch.
bench get-app erpnext --branch staging

To switch an existing bench:
cd apps/frappe && git checkout -b staging && git pull upstream staging
cd apps/erpnext && git checkout -b staging && git pull upstream staging
bench switch-to-branch staging

The first two steps you may not need to do, but bench switch-to-branch staging doesn’t look in the remote for branches, only in the local repo, so you may need to add them yourself.

Tried to move to staging, but get these as result:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.15_1/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.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/fellipeh/Developer/frappe/devel/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>
    main()
  File "/Users/fellipeh/Developer/frappe/devel/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/Users/fellipeh/Developer/frappe/devel/env/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/devel/env/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/fellipeh/Developer/frappe/devel/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/fellipeh/Developer/frappe/devel/env/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/fellipeh/Developer/frappe/devel/env/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/fellipeh/Developer/frappe/devel/env/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/fellipeh/Developer/frappe/devel/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/fellipeh/Developer/frappe/devel/apps/frappe/frappe/commands/site.py", line 65, in _new_site
    admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
  File "/Users/fellipeh/Developer/frappe/devel/apps/frappe/frappe/installer.py", line 36, in install_db
    frappe.local.db = get_root_connection(root_login, root_password)
  File "/Users/fellipeh/Developer/frappe/devel/apps/frappe/frappe/installer.py", line 105, in get_root_connection
    frappe.local.flags.root_connection = frappe.database.Database(user=root_login, password=root_password)
AttributeError: 'module' object has no attribute 'Database'

I got it working, see the other thread on this issue.

It 's really frustrating… I just want to use a stable version of frappe… I do not want to use a ERPNext… just Frappe…

Tried every thing… and everytime, a new error… now when i run bench start get these:

10:25:14 system           | redis_socketio.1 started (pid=37620)
10:25:14 system           | redis_queue.1 started (pid=37622)
10:25:14 system           | web.1 started (pid=37623)
10:25:14 system           | socketio.1 started (pid=37624)
10:25:14 system           | watch.1 started (pid=37626)
10:25:14 system           | worker_long.1 started (pid=37631)
10:25:14 system           | worker_short.1 started (pid=37632)
10:25:14 system           | schedule.1 started (pid=37633)
10:25:14 redis_cache.1    | 37619:C 10 Dec 2018 10:25:14.381 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:25:14 redis_cache.1    | 37619:C 10 Dec 2018 10:25:14.382 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=37619, just started
10:25:14 redis_cache.1    | 37619:C 10 Dec 2018 10:25:14.382 # Configuration loaded
10:25:14 redis_cache.1    | 37619:M 10 Dec 2018 10:25:14.384 * Increased maximum number of open files to 10032 (it was originally set to 4864).
10:25:14 redis_cache.1    | 37619:M 10 Dec 2018 10:25:14.399 * Running mode=standalone, port=13000.
10:25:14 redis_cache.1    | 37619:M 10 Dec 2018 10:25:14.399 # Server initialized
10:25:14 redis_cache.1    | 37619:M 10 Dec 2018 10:25:14.399 * Ready to accept connections
10:25:14 redis_queue.1    | 37622:C 10 Dec 2018 10:25:14.382 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:25:14 redis_queue.1    | 37622:C 10 Dec 2018 10:25:14.383 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=37622, just started
10:25:14 redis_queue.1    | 37622:C 10 Dec 2018 10:25:14.383 # Configuration loaded
10:25:14 redis_queue.1    | 37622:M 10 Dec 2018 10:25:14.385 * Increased maximum number of open files to 10032 (it was originally set to 4864).
10:25:14 redis_queue.1    | 37622:M 10 Dec 2018 10:25:14.399 * Running mode=standalone, port=11000.
10:25:14 redis_queue.1    | 37622:M 10 Dec 2018 10:25:14.399 # Server initialized
10:25:14 redis_queue.1    | 37622:M 10 Dec 2018 10:25:14.400 * Ready to accept connections
10:25:14 redis_socketio.1 | 37620:C 10 Dec 2018 10:25:14.382 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:25:14 redis_socketio.1 | 37620:C 10 Dec 2018 10:25:14.384 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=37620, just started
10:25:14 redis_socketio.1 | 37620:C 10 Dec 2018 10:25:14.384 # Configuration loaded
10:25:14 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:14.386 * Increased maximum number of open files to 10032 (it was originally set to 4864).
10:25:14 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:14.400 * Running mode=standalone, port=12000.
10:25:14 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:14.400 # Server initialized
10:25:14 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:14.400 * Ready to accept connections
10:25:14 system           | worker_default.1 started (pid=37634)
10:25:15 socketio.1       | listening on *: 9000
10:25:20 web.1            |  * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
10:25:20 web.1            |  * Restarting with fsevents reloader
10:25:20 web.1            | Traceback (most recent call last):
10:25:20 web.1            |   File "/Users/fellipeh/Developer/frappe/devel/apps/frappe/frappe/utils/bench_helper.py", line 3, in <module>
10:25:20 web.1            |     import frappe
10:25:20 web.1            | ModuleNotFoundError: No module named 'frappe'
10:25:20 system           | web.1 stopped (rc=1)
10:25:20 system           | sending SIGTERM to redis_cache.1 (pid 37619)
10:25:20 system           | sending SIGTERM to redis_socketio.1 (pid 37620)
10:25:20 system           | sending SIGTERM to redis_queue.1 (pid 37622)
10:25:20 system           | sending SIGTERM to socketio.1 (pid 37624)
10:25:20 system           | sending SIGTERM to watch.1 (pid 37626)
10:25:20 system           | sending SIGTERM to schedule.1 (pid 37633)
10:25:20 system           | sending SIGTERM to worker_short.1 (pid 37632)
10:25:20 system           | sending SIGTERM to worker_long.1 (pid 37631)
10:25:20 system           | sending SIGTERM to worker_default.1 (pid 37634)
10:25:20 redis_cache.1    | 37619:signal-handler (1544444720) Received SIGTERM scheduling shutdown...
10:25:20 redis_queue.1    | 37622:signal-handler (1544444720) Received SIGTERM scheduling shutdown...
10:25:20 redis_socketio.1 | 37620:signal-handler (1544444720) Received SIGTERM scheduling shutdown...
10:25:20 worker_long.1    | 10:25:20 Warm shut down requested
10:25:20 system           | socketio.1 stopped (rc=-15)
10:25:20 worker_short.1   | 10:25:20 Warm shut down requested
10:25:20 system           | schedule.1 stopped (rc=-15)
10:25:20 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:20.540 # User requested shutdown...
10:25:20 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:20.540 * Removing the pid file.
10:25:20 redis_socketio.1 | 37620:M 10 Dec 2018 10:25:20.540 # Redis is now ready to exit, bye bye...
10:25:20 system           | redis_socketio.1 stopped (rc=0)
10:25:20 system           | worker_default.1 stopped (rc=-15)
10:25:20 redis_cache.1    | 37619:M 10 Dec 2018 10:25:20.553 # User requested shutdown...
10:25:20 redis_cache.1    | 37619:M 10 Dec 2018 10:25:20.553 * Removing the pid file.
10:25:20 redis_cache.1    | 37619:M 10 Dec 2018 10:25:20.554 # Redis is now ready to exit, bye bye...
10:25:20 system           | redis_cache.1 stopped (rc=0)
10:25:20 redis_queue.1    | 37622:M 10 Dec 2018 10:25:20.574 # User requested shutdown...
10:25:20 redis_queue.1    | 37622:M 10 Dec 2018 10:25:20.574 * Removing the pid file.
10:25:20 redis_queue.1    | 37622:M 10 Dec 2018 10:25:20.575 # Redis is now ready to exit, bye bye...
10:25:20 system           | redis_queue.1 stopped (rc=0)
10:25:20 watch.1          | yarn run v1.12.3
10:25:20 system           | watch.1 stopped (rc=-15)
10:25:20 system           | worker_long.1 stopped (rc=0)
10:25:20 system           | worker_short.1 stopped (rc=0)

But, new-app, new-site… install-app all works fine…

I do not know if I need to use master branch or ** staging** branch…

using bench switch-to-master I got these error:

fellipeh@glenfiddich:[~/Developer/frappe/devel]: $ bench switch-to-master
remote: Enumerating objects: 32, done.
remote: Counting objects: 100% (32/32), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 35 (delta 23), reused 25 (delta 21), pack-reused 3
Unpacking objects: 100% (35/35), done.
From https://github.com/frappe/frappe
   cfa2e7613..7598c37a2  develop       -> upstream/develop
   dc2cc5c17..58d0e8507  staging-fixes -> upstream/staging-fixes
Switching for frappe
INFO:bench.utils:git config --unset-all remote.upstream.fetch
INFO:bench.utils:git config --add remote.upstream.fetch '+refs/heads/*:refs/remotes/upstream/*'
INFO:bench.utils:git fetch upstream
INFO:bench.utils:git checkout master
Branch master set up to track remote branch master from upstream.
Switched to a new branch 'master'
INFO:bench.utils:git merge upstream/master
Already up-to-date.
Successfully switched branches for:
frappe
()
Switched to master
Please run bench update --patch to be safe from any differences in database schema
fellipeh@glenfiddich:[~/Developer/frappe/devel]: $ bench start
10:26:30 system           | redis_socketio.1 started (pid=37732)
10:26:30 system           | redis_cache.1 started (pid=37731)
10:26:30 system           | redis_queue.1 started (pid=37734)
10:26:30 system           | web.1 started (pid=37736)
10:26:30 system           | socketio.1 started (pid=37737)
10:26:30 system           | watch.1 started (pid=37740)
10:26:30 system           | schedule.1 started (pid=37741)
10:26:30 system           | worker_short.1 started (pid=37743)
10:26:30 system           | worker_long.1 started (pid=37745)
10:26:30 system           | worker_default.1 started (pid=37746)
10:26:30 redis_cache.1    | 37731:C 10 Dec 2018 10:26:30.683 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:26:30 redis_cache.1    | 37731:C 10 Dec 2018 10:26:30.683 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=37731, just started
10:26:30 redis_cache.1    | 37731:C 10 Dec 2018 10:26:30.683 # Configuration loaded
10:26:30 redis_cache.1    | 37731:M 10 Dec 2018 10:26:30.685 * Increased maximum number of open files to 10032 (it was originally set to 4864).
10:26:30 redis_cache.1    | 37731:M 10 Dec 2018 10:26:30.688 * Running mode=standalone, port=13000.
10:26:30 redis_cache.1    | 37731:M 10 Dec 2018 10:26:30.688 # Server initialized
10:26:30 redis_cache.1    | 37731:M 10 Dec 2018 10:26:30.688 * Ready to accept connections
10:26:30 redis_socketio.1 | 37732:C 10 Dec 2018 10:26:30.693 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:26:30 redis_socketio.1 | 37732:C 10 Dec 2018 10:26:30.693 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=37732, just started
10:26:30 redis_socketio.1 | 37732:C 10 Dec 2018 10:26:30.693 # Configuration loaded
10:26:30 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:30.695 * Increased maximum number of open files to 10032 (it was originally set to 4864).
10:26:30 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:30.697 * Running mode=standalone, port=12000.
10:26:30 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:30.697 # Server initialized
10:26:30 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:30.697 * Ready to accept connections
10:26:30 redis_queue.1    | 37734:C 10 Dec 2018 10:26:30.700 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10:26:30 redis_queue.1    | 37734:C 10 Dec 2018 10:26:30.700 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=37734, just started
10:26:30 redis_queue.1    | 37734:C 10 Dec 2018 10:26:30.700 # Configuration loaded
10:26:30 redis_queue.1    | 37734:M 10 Dec 2018 10:26:30.702 * Increased maximum number of open files to 10032 (it was originally set to 4864).
10:26:30 redis_queue.1    | 37734:M 10 Dec 2018 10:26:30.759 * Running mode=standalone, port=11000.
10:26:30 redis_queue.1    | 37734:M 10 Dec 2018 10:26:30.759 # Server initialized
10:26:30 redis_queue.1    | 37734:M 10 Dec 2018 10:26:30.759 * Ready to accept connections
10:26:31 socketio.1       | listening on *: 9000
10:26:31 worker_short.1   | Usage: bench [OPTIONS] COMMAND [ARGS]...
10:26:31 worker_short.1   | Try "bench --help" for help.
10:26:31 worker_short.1   |
10:26:31 worker_short.1   | Error: No such command "worker".
10:26:31 worker_long.1    | Usage: bench [OPTIONS] COMMAND [ARGS]...
10:26:31 worker_long.1    | Try "bench --help" for help.
10:26:31 worker_long.1    |
10:26:31 worker_long.1    | Error: No such command "worker".
10:26:31 schedule.1       | Usage: bench [OPTIONS] COMMAND [ARGS]...
10:26:31 schedule.1       | Try "bench --help" for help.
10:26:31 schedule.1       |
10:26:31 schedule.1       | Error: No such command "schedule".
10:26:31 watch.1          | Usage: bench [OPTIONS] COMMAND [ARGS]...
10:26:31 watch.1          | Try "bench --help" for help.
10:26:31 watch.1          |
10:26:31 watch.1          | Error: No such command "watch".
10:26:31 web.1            | Usage: bench [OPTIONS] COMMAND [ARGS]...
10:26:31 web.1            | Try "bench --help" for help.
10:26:31 web.1            |
10:26:31 web.1            | Error: No such command "serve".
10:26:31 worker_default.1 | Usage: bench [OPTIONS] COMMAND [ARGS]...
10:26:31 worker_default.1 | Try "bench --help" for help.
10:26:31 worker_default.1 |
10:26:31 worker_default.1 | Error: No such command "worker".
10:26:31 system           | worker_short.1 stopped (rc=2)
10:26:31 system           | sending SIGTERM to redis_cache.1 (pid 37731)
10:26:31 system           | sending SIGTERM to redis_socketio.1 (pid 37732)
10:26:31 system           | sending SIGTERM to redis_queue.1 (pid 37734)
10:26:31 system           | sending SIGTERM to web.1 (pid 37736)
10:26:31 system           | sending SIGTERM to socketio.1 (pid 37737)
10:26:31 system           | sending SIGTERM to watch.1 (pid 37740)
10:26:31 system           | sending SIGTERM to schedule.1 (pid 37741)
10:26:31 system           | sending SIGTERM to worker_long.1 (pid 37745)
10:26:31 system           | sending SIGTERM to worker_default.1 (pid 37746)
10:26:31 redis_cache.1    | 37731:signal-handler (1544444791) Received SIGTERM scheduling shutdown...
10:26:31 redis_socketio.1 | 37732:signal-handler (1544444791) Received SIGTERM scheduling shutdown...
10:26:31 redis_queue.1    | 37734:signal-handler (1544444791) Received SIGTERM scheduling shutdown...
10:26:31 system           | worker_default.1 stopped (rc=-15)
10:26:31 system           | socketio.1 stopped (rc=-15)
10:26:31 system           | worker_long.1 stopped (rc=-15)
10:26:31 system           | schedule.1 stopped (rc=-15)
10:26:31 system           | web.1 stopped (rc=-15)
10:26:31 system           | watch.1 stopped (rc=-15)
10:26:31 redis_queue.1    | 37734:M 10 Dec 2018 10:26:31.998 # User requested shutdown...
10:26:31 redis_queue.1    | 37734:M 10 Dec 2018 10:26:31.998 * Removing the pid file.
10:26:31 redis_queue.1    | 37734:M 10 Dec 2018 10:26:31.999 # Redis is now ready to exit, bye bye...
10:26:32 system           | redis_queue.1 stopped (rc=0)
10:26:32 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:32.021 # User requested shutdown...
10:26:32 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:32.021 * Removing the pid file.
10:26:32 redis_socketio.1 | 37732:M 10 Dec 2018 10:26:32.022 # Redis is now ready to exit, bye bye...
10:26:32 system           | redis_socketio.1 stopped (rc=0)
10:26:32 redis_cache.1    | 37731:M 10 Dec 2018 10:26:32.023 # User requested shutdown...
10:26:32 redis_cache.1    | 37731:M 10 Dec 2018 10:26:32.024 * Removing the pid file.
10:26:32 redis_cache.1    | 37731:M 10 Dec 2018 10:26:32.024 # Redis is now ready to exit, bye bye...
10:26:32 system           | redis_cache.1 stopped (rc=0)

run bench setup requirements then bench update --patch and try again

1 Like

I just tried this and got:

bench update --patch
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 26 (delta 16), reused 15 (delta 12), pack-reused 1
Unpacking objects: 100% (26/26), done.
From https://github.com/frappe/frappe
   19453b886..8c0fead00  staging-fixes -> upstream/staging-fixes
Backing up sites...
Patching sites...
Migrating erpnext.example.org
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
Syncing help database...

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for erpnext:

Is it essential that the erpnext user is a sudoer?

No. But if you have the password for account erpnext, enter it and let it run

1 Like

Thanks, I created a password for the account and continued without adding erpnext to the sudo group and this generated this error:

[sudo] password for erpnext: 
erpnext is not in the sudoers file.  This incident will be reported.
Traceback (most recent call last):
  File "/home/erpnext/.local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/erpnext/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/home/erpnext/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/.bench/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
  File "/home/erpnext/.bench/bench/commands/update.py", line 100, in _update
    restart_supervisor_processes(bench_path=bench_path)
  File "/home/erpnext/.bench/bench/utils.py", line 389, in restart_supervisor_processes
    supervisor_status = subprocess.check_output(['sudo', 'supervisorctl', 'status'], cwd=bench_path)
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['sudo', 'supervisorctl', 'status']' returned non-zero exit status 1

I then added erpnext to the sudo group, exited, did a su - erpnext again to ensure that the updated groups were loaded and then I got:

bench update --patch
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 25 (delta 16), reused 19 (delta 16), pack-reused 2
Unpacking objects: 100% (25/25), done.
From https://github.com/frappe/frappe
   7598c37a2..a60cb001f  develop         -> upstream/develop
   dc2cc5c17..306ca0f44  staging         -> upstream/staging
   8c0fead00..306ca0f44  staging-fixes   -> upstream/staging-fixes
 * [new tag]             v11.0.3-beta.35 -> v11.0.3-beta.35
Backing up sites...
Patching sites...
Migrating erpnext.example.org
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
Syncing help database...
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: ERROR (no such file)
frappe-bench-workers:frappe-bench-frappe-default-worker-0: ERROR (no such file)
frappe-bench-workers:frappe-bench-frappe-long-worker-0: ERROR (no such file)
frappe-bench-workers:frappe-bench-frappe-short-worker-0: ERROR (no such file)
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()

And I have:

tail /var/log/supervisor/supervisord.log 
2018-12-10 12:08:33,210 INFO spawnerr: can't find command 'None'
2018-12-10 12:08:33,210 INFO gave up: frappe-bench-frappe-short-worker-0 entered FATAL state, too many start retries too quickly
2018-12-10 13:07:11,741 INFO waiting for frappe-bench-frappe-web to stop
2018-12-10 13:07:11,743 INFO waiting for frappe-bench-node-socketio to stop
2018-12-10 13:07:11,758 INFO stopped: frappe-bench-node-socketio (terminated by SIGTERM)
2018-12-10 13:07:12,264 INFO stopped: frappe-bench-frappe-web (exit status 0)
2018-12-10 13:07:13,284 INFO spawned: 'frappe-bench-frappe-web' with pid 4792
2018-12-10 13:07:13,304 INFO spawned: 'frappe-bench-node-socketio' with pid 4793
2018-12-10 13:07:14,308 INFO success: frappe-bench-frappe-web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2018-12-10 13:07:14,308 INFO success: frappe-bench-node-socketio entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

So this appear to have solved some, but not all of the problems I reported in another thread

Same error… and a new one:

Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python3.7/site-packages (18.1)
INFO:bench.utils:./env/bin/pip install -q -r /Users/fellipeh/Developer/frappe/bench-repo/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpbr/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe_io/requirements.txt
Updating node packages...
INFO:bench.utils:yarn install
yarn install v1.12.3
[1/4] 🔍  Resolving packages...
success Already up-to-date.
✨  Done in 0.49s.

$ bench start

13:09:37 system           | redis_cache.1 started (pid=669)
13:09:37 system           | redis_socketio.1 started (pid=670)
13:09:37 system           | socketio.1 started (pid=674)
13:09:37 system           | web.1 started (pid=673)
13:09:37 system           | watch.1 started (pid=675)
13:09:37 system           | schedule.1 started (pid=678)
13:09:37 system           | worker_short.1 started (pid=679)
13:09:37 system           | worker_long.1 started (pid=681)
13:09:37 redis_queue.1    | 672:C 10 Dec 2018 13:09:37.592 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13:09:37 redis_queue.1    | 672:C 10 Dec 2018 13:09:37.594 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=672, just started
13:09:37 redis_queue.1    | 672:C 10 Dec 2018 13:09:37.594 # Configuration loaded
13:09:37 redis_queue.1    | 672:M 10 Dec 2018 13:09:37.596 * Increased maximum number of open files to 10032 (it was originally set to 4864).
13:09:37 redis_socketio.1 | 670:C 10 Dec 2018 13:09:37.592 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13:09:37 redis_socketio.1 | 670:C 10 Dec 2018 13:09:37.595 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=670, just started
13:09:37 redis_socketio.1 | 670:C 10 Dec 2018 13:09:37.595 # Configuration loaded
13:09:37 redis_socketio.1 | 670:M 10 Dec 2018 13:09:37.597 * Increased maximum number of open files to 10032 (it was originally set to 4864).
13:09:37 redis_cache.1    | 669:C 10 Dec 2018 13:09:37.592 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
13:09:37 redis_cache.1    | 669:C 10 Dec 2018 13:09:37.595 # Redis version=5.0.2, bits=64, commit=00000000, modified=0, pid=669, just started
13:09:37 redis_cache.1    | 669:C 10 Dec 2018 13:09:37.595 # Configuration loaded
13:09:37 redis_cache.1    | 669:M 10 Dec 2018 13:09:37.597 * Increased maximum number of open files to 10032 (it was originally set to 4864).
13:09:37 redis_cache.1    | 669:M 10 Dec 2018 13:09:37.612 * Running mode=standalone, port=13001.
13:09:37 redis_cache.1    | 669:M 10 Dec 2018 13:09:37.612 # Server initialized
13:09:37 redis_queue.1    | 672:M 10 Dec 2018 13:09:37.612 * Running mode=standalone, port=11001.
13:09:37 redis_queue.1    | 672:M 10 Dec 2018 13:09:37.612 # Server initialized
13:09:37 redis_socketio.1 | 670:M 10 Dec 2018 13:09:37.613 * Running mode=standalone, port=12001.
13:09:37 redis_socketio.1 | 670:M 10 Dec 2018 13:09:37.613 # Server initialized
13:09:37 redis_cache.1    | 669:M 10 Dec 2018 13:09:37.614 * Ready to accept connections
13:09:37 redis_queue.1    | 672:M 10 Dec 2018 13:09:37.615 * Ready to accept connections
13:09:37 redis_socketio.1 | 670:M 10 Dec 2018 13:09:37.615 * Ready to accept connections
13:09:37 system           | worker_default.1 started (pid=683)
13:09:39 socketio.1       | listening on *: 9001
13:09:43 web.1            |  * Running on http://0.0.0.0:8001/ (Press CTRL+C to quit)
13:09:43 web.1            |  * Restarting with fsevents reloader
13:09:43 web.1            | Traceback (most recent call last):
13:09:43 web.1            |   File "/Users/fellipeh/Developer/frappe/fellipeh-bench/apps/frappe/frappe/utils/bench_helper.py", line 3, in <module>
13:09:43 web.1            |     import frappe
13:09:43 web.1            | ModuleNotFoundError: No module named 'frappe'
13:09:43 system           | web.1 stopped (rc=1)
13:09:43 system           | sending SIGTERM to redis_cache.1 (pid 669)
13:09:43 system           | sending SIGTERM to redis_socketio.1 (pid 670)
13:09:43 system           | sending SIGTERM to redis_queue.1 (pid 672)
13:09:43 system           | sending SIGTERM to socketio.1 (pid 674)
13:09:43 system           | sending SIGTERM to watch.1 (pid 675)
13:09:43 system           | sending SIGTERM to schedule.1 (pid 678)
13:09:43 system           | sending SIGTERM to worker_short.1 (pid 679)
13:09:43 system           | sending SIGTERM to worker_long.1 (pid 681)
13:09:43 system           | sending SIGTERM to worker_default.1 (pid 683)
13:09:43 redis_cache.1    | 669:signal-handler (1544454583) Received SIGTERM scheduling shutdown...
13:09:43 redis_socketio.1 | 670:signal-handler (1544454583) Received SIGTERM scheduling shutdown...
13:09:43 redis_queue.1    | 672:signal-handler (1544454583) Received SIGTERM scheduling shutdown...
13:09:43 worker_short.1   | 13:09:43 Warm shut down requested
13:09:43 redis_queue.1    | 672:M 10 Dec 2018 13:09:43.881 # User requested shutdown...
13:09:43 redis_queue.1    | 672:M 10 Dec 2018 13:09:43.882 * Removing the pid file.
13:09:43 system           | socketio.1 stopped (rc=-15)
13:09:43 redis_queue.1    | 672:M 10 Dec 2018 13:09:43.882 # Redis is now ready to exit, bye bye...
13:09:43 system           | redis_queue.1 stopped (rc=0)
13:09:43 worker_long.1    | 13:09:43 Warm shut down requested
13:09:43 system           | schedule.1 stopped (rc=-15)
13:09:43 worker_default.1 | 13:09:43 Warm shut down requested
13:09:43 worker_short.1   | Traceback (most recent call last):
13:09:43 worker_short.1   |   File "/Users/fellipeh/Developer/frappe/fellipeh-bench/env/lib/python3.7/site-packages/redis/connection.py", line 484, in connect
13:09:43 worker_short.1   |     sock = self._connect()
13:09:43 worker_short.1   |   File "/Users/fellipeh/Developer/frappe/fellipeh-bench/env/lib/python3.7/site-packages/redis/connection.py", line 541, in _connect
13:09:43 worker_short.1   |     raise err
13:09:43 worker_short.1   |   File "/Users/fellipeh/Developer/frappe/fellipeh-bench/env/lib/python3.7/site-packages/redis/connection.py", line 529, in _connect
13:09:43 worker_short.1   |     sock.connect(socket_address)
13:09:43 worker_short.1   | ConnectionRefusedError: [Errno 61] Connection refused 

I do not understand why it’s so dificult to get the ** stable** version of frappe… It’s supposed to be easy to do that…

“/env/lib/python3.7”

Possibly this explains your problem?

Works now… But I need to do these steps to work:

  1. bench init fellipeh-bench –python python2.7 --verbose --frappe-branch staging
  2. cd fellipeh-bench/apps/frappe
  3. git checkout -b staging
  4. git pull upstream staging
  5. bench switch-to-branch staging
  6. bench update --patch

I need to specify the python on bench init… if I do not specify bench try to use my default 3.7… not 2.7…

works fine now!