No module named frappe.celery_app

Hi,

While Starting Bench I am getting following error. Need proper suggestions.

compaq@ubuntu:~/frappe-bench$ bench start
17:30:48 system           | redis_socketio.1 started (pid=7633)
17:30:48 redis_socketio.1 | [7639] 17 Apr 17:30:48.340 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
17:30:48 redis_socketio.1 |                 _._                                                  
17:30:48 redis_socketio.1 |            _.-``__ ''-._                                             
17:30:48 redis_socketio.1 |       _.-``    `.  `_.  ''-._           Redis 2.8.4 (00000000/0) 64 bit
17:30:48 redis_socketio.1 |   .-`` .-```.  ```\/    _.,_ ''-._                                   
17:30:48 redis_socketio.1 |  (    '      ,       .-`  | `,    )     Running in stand alone mode
17:30:48 redis_socketio.1 |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 12000
17:30:48 redis_socketio.1 |  |    `-._   `._    /     _.-'    |     PID: 7639
17:30:48 redis_socketio.1 |   `-._    `-._  `-./  _.-'    _.-'                                   
17:30:48 redis_socketio.1 |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
17:30:48 redis_socketio.1 |  |    `-._`-._        _.-'_.-'    |           http://redis.io        
17:30:48 redis_socketio.1 |   `-._    `-._`-.__.-'_.-'    _.-'                                   
17:30:48 redis_socketio.1 |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
17:30:48 redis_socketio.1 |  |    `-._`-._        _.-'_.-'    |                                  
17:30:48 redis_socketio.1 |   `-._    `-._`-.__.-'_.-'    _.-'                                   
17:30:48 redis_socketio.1 |       `-._    `-.__.-'    _.-'                                       
17:30:48 redis_socketio.1 |           `-._        _.-'                                           
17:30:48 redis_socketio.1 |               `-.__.-'                                               
17:30:48 redis_socketio.1 | 
17:30:48 redis_socketio.1 | [7639] 17 Apr 17:30:48.340 # Server started, Redis version 2.8.4
17:30:48 redis_socketio.1 | [7639] 17 Apr 17:30:48.341 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
17:30:48 redis_socketio.1 | [7639] 17 Apr 17:30:48.341 * The server is now ready to accept connections on port 12000
17:30:48 system           | socketio.1 started (pid=7638)
17:30:48 system           | workerbeat.1 started (pid=7631)
17:30:48 system           | redis_cache.1 started (pid=7637)
17:30:48 redis_cache.1    | [7654] 17 Apr 17:30:48.361 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
17:30:48 redis_cache.1    |                 _._                                                  
17:30:48 redis_cache.1    |            _.-``__ ''-._                                             
17:30:48 redis_cache.1    |       _.-``    `.  `_.  ''-._           Redis 2.8.4 (00000000/0) 64 bit
17:30:48 redis_cache.1    |   .-`` .-```.  ```\/    _.,_ ''-._                                   
17:30:48 redis_cache.1    |  (    '      ,       .-`  | `,    )     Running in stand alone mode
17:30:48 redis_cache.1    |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 13000
17:30:48 redis_cache.1    |  |    `-._   `._    /     _.-'    |     PID: 7654
17:30:48 redis_cache.1    |   `-._    `-._  `-./  _.-'    _.-'                                   
17:30:48 redis_cache.1    |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
17:30:48 redis_cache.1    |  |    `-._`-._        _.-'_.-'    |           http://redis.io        
17:30:48 redis_cache.1    |   `-._    `-._`-.__.-'_.-'    _.-'                                   
17:30:48 redis_cache.1    |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
17:30:48 redis_cache.1    |  |    `-._`-._        _.-'_.-'    |                                  
17:30:48 redis_cache.1    |   `-._    `-._`-.__.-'_.-'    _.-'                                   
17:30:48 redis_cache.1    |       `-._    `-.__.-'    _.-'                                       
17:30:48 redis_cache.1    |           `-._        _.-'                                           
17:30:48 redis_cache.1    |               `-.__.-'                                               
17:30:48 redis_cache.1    | 
17:30:48 redis_cache.1    | [7654] 17 Apr 17:30:48.362 # Server started, Redis version 2.8.4
17:30:48 redis_cache.1    | [7654] 17 Apr 17:30:48.362 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
17:30:48 redis_cache.1    | [7654] 17 Apr 17:30:48.362 * The server is now ready to accept connections on port 13000
17:30:48 system           | longjob_worker.1 started (pid=7652)
17:30:48 system           | worker.1 started (pid=7641)
17:30:48 system           | watch.1 started (pid=7642)
17:30:48 system           | async_worker.1 started (pid=7647)
17:30:48 system           | web.1 started (pid=7653)
17:30:48 system           | redis_queue.1 started (pid=7651)
17:30:48 redis_queue.1    | [7661] 17 Apr 17:30:48.380 # Unable to set the max number of files limit to 10032 (Operation not permitted), setting the max clients configuration to 3984.
17:30:48 redis_queue.1    |                 _._                                                  
17:30:48 redis_queue.1    |            _.-``__ ''-._                                             
17:30:48 redis_queue.1    |       _.-``    `.  `_.  ''-._           Redis 2.8.4 (00000000/0) 64 bit
17:30:48 redis_queue.1    |   .-`` .-```.  ```\/    _.,_ ''-._                                   
17:30:48 redis_queue.1    |  (    '      ,       .-`  | `,    )     Running in stand alone mode
17:30:48 redis_queue.1    |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 11000
17:30:48 redis_queue.1    |  |    `-._   `._    /     _.-'    |     PID: 7661
17:30:48 redis_queue.1    |   `-._    `-._  `-./  _.-'    _.-'                                   
17:30:48 redis_queue.1    |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
17:30:48 redis_queue.1    |  |    `-._`-._        _.-'_.-'    |           http://redis.io        
17:30:48 redis_queue.1    |   `-._    `-._`-.__.-'_.-'    _.-'                                   
17:30:48 redis_queue.1    |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
17:30:48 redis_queue.1    |  |    `-._`-._        _.-'_.-'    |                                  
17:30:48 redis_queue.1    |   `-._    `-._`-.__.-'_.-'    _.-'                                   
17:30:48 redis_queue.1    |       `-._    `-.__.-'    _.-'                                       
17:30:48 redis_queue.1    |           `-._        _.-'                                           
17:30:48 redis_queue.1    |               `-.__.-'                                               
17:30:48 redis_queue.1    | 
17:30:48 redis_queue.1    | [7661] 17 Apr 17:30:48.399 # Server started, Redis version 2.8.4
17:30:48 redis_queue.1    | [7661] 17 Apr 17:30:48.399 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
17:30:48 redis_queue.1    | [7661] 17 Apr 17:30:48.399 * The server is now ready to accept connections on port 11000
17:30:49 longjob_worker.1 | /home/compaq/frappe-bench/sites/../env/bin/python: No module named frappe.celery_app
17:30:49 async_worker.1   | /home/compaq/frappe-bench/sites/../env/bin/python: No module named frappe.celery_app
17:30:49 worker.1         | /home/compaq/frappe-bench/sites/../env/bin/python: No module named frappe.celery_app
17:30:49 system           | longjob_worker.1 stopped (rc=1)
17:30:49 system           | sending SIGTERM to redis_socketio.1 (pid 7633)
17:30:49 system           | sending SIGTERM to workerbeat.1 (pid 7631)
17:30:49 system           | sending SIGTERM to worker.1 (pid 7641)
17:30:49 system           | sending SIGTERM to redis_queue.1 (pid 7651)
17:30:49 system           | sending SIGTERM to web.1 (pid 7653)
17:30:49 system           | sending SIGTERM to async_worker.1 (pid 7647)
17:30:49 system           | sending SIGTERM to socketio.1 (pid 7638)
17:30:49 system           | sending SIGTERM to redis_cache.1 (pid 7637)
17:30:49 system           | sending SIGTERM to watch.1 (pid 7642)
17:30:49 redis_queue.1    | [7661 | signal handler] (1460893549) Received SIGTERM, scheduling shutdown...
17:30:49 redis_cache.1    | [7654 | signal handler] (1460893549) Received SIGTERM, scheduling shutdown...
17:30:49 redis_socketio.1 | [7639 | signal handler] (1460893549) Received SIGTERM, scheduling shutdown...
17:30:49 system           | web.1 stopped (rc=-15)
17:30:49 system           | socketio.1 stopped (rc=-15)
17:30:49 system           | watch.1 stopped (rc=-15)
17:30:49 system           | workerbeat.1 stopped (rc=-15)
17:30:49 system           | async_worker.1 stopped (rc=-15)
17:30:49 system           | worker.1 stopped (rc=-15)
17:30:49 redis_socketio.1 | [7639] 17 Apr 17:30:49.842 # User requested shutdown...
17:30:49 redis_socketio.1 | [7639] 17 Apr 17:30:49.842 # Redis is now ready to exit, bye bye...
17:30:49 system           | redis_socketio.1 stopped (rc=-15)
17:30:49 redis_cache.1    | [7654] 17 Apr 17:30:49.864 # User requested shutdown...
17:30:49 redis_cache.1    | [7654] 17 Apr 17:30:49.864 # Redis is now ready to exit, bye bye...
17:30:49 system           | redis_cache.1 stopped (rc=-15)
17:30:49 redis_queue.1    | [7661] 17 Apr 17:30:49.883 # User requested shutdown...
17:30:49 redis_queue.1    | [7661] 17 Apr 17:30:49.883 # Redis is now ready to exit, bye bye...
17:30:49 system           | redis_queue.1 stopped (rc=-15)
compaq@ubuntu:~/frappe-bench$

resolved

@koshish How you resolved this I have the same problem

@hereabdulla please open the link below. You will find a file named celery_app.py

Download the file and save it in frappe-bench/apps/frappe/frappe

@koshish Thanks for your Reply.It worked :grinning:

Hi @koshish and @hereabdulla, that’s not the right solution for this problem. It’ll create problems next time you try to update.

First delete that file you downloaded

Try doing this, go to the bench-repo folder and then do git checkout develop, followed up git reset origin/develop --hard and then go to the frappe-bench folder and run bench setup procfile

Now try doing bench start

thanks @vjFaLk for the timely suggestion!..

Hi @vjFaLk we are facing the same issue here with a freshly installed mac. However I do not want to switch to develop branch because we prefer to develop on a stable branch. Could you provide a solution and please also update the setup instructions because this happens when installing the current frappe according to the setup.

This discussion also seems to be going on here: I can not up the application - #3 by satvaras_company with the same proposed solution

Go to the bench-repo directory, run git checkout develop and then inside frappe-bench run bench setup procfile

But again I dont think this is a solution to the problem of how to develop locally based on your stable release?

In both the scenarios the users were using the develop branch of ERPNext. In fact, this error shouldn’t come up in the master branch. Can you make sure that your new setup has the master branches for erpnext, frappe and bench-repo?

No @vjFaLk I actually wasn’t, that is strange. I installed with the normal instructions that are given and wasn’t aware that it would set up as develop rather than master. The normal setup creates it exactly like my setup, so the normal setup breaks with the problem these users described. Maybe that should be reconsidered?

➜ bench-repo git:(master)
➜ frappe git:(develop)
➜ erpnext git:(develop)

So what do I need to do to move frappe and erpnext to master @vjFaLk ?

I want to develop on master branch.

Ah I see, you did the developer setup I believe? (without --setup-production) It comes with the develop branches. I’m unsure of the cause of people having issues with the update, but it’s mostly been smooth.

Now there’s a problem, the difference between master and develop at this point is significant, because of which there are database differences that make it a bit of a task to move back from develop to master if you’ve migrated once.

Two ways you can do this :

  1. The less-hassley way, but you have to destroy your site
  • bench switch-to-master
  • bench drop-site [current-site-name]
  • bench new-site [new-site-name]
  • bench --site [new-site-name] install-app erpnext
  • bench update
  1. More hassle, but you get to keep your site
  • bench use [your-site]
  • bench switch-to-master
  • Run bench mysql. You should get in the SQL shell
  • Run ALTER TABLE tabDocType DROP COLUMN track_seen;
  • And then run ALTER TABLE tabDocType DROP COLUMN quick_entry;
  • Exit the SQL shell, and run bench update

Thank you @vjFaLk I do not need to save my site so I will go with route 1.
I have dripped the site with bench drop-site successfully. However running bench switch-to-master throws an error:

➜  frappe-bench bench switch-to-master
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/Users/dominik/Dev/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/dominik/Dev/bench-repo/bench/commands/update.py", line 122, in switch_to_master
    switch_to_master(upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 181, in switch_to_master
    switch_branch('master', apps=apps, bench=bench, upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 152, in switch_branch
    version_upgrade = is_version_upgrade(bench=bench, branch=branch)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 99, in is_version_upgrade
    raise Exception("Current branch of 'frappe' not in upstream")
Exception: Current branch of 'frappe' not in upstream

Are you in a branch in frappe that isn’t a remote branch (develop /master)? You can just go to the folder and do git checkout master and run the command again

Not that I can see, I am basically still fresh after installing and havent done anything yet other than the setup instructions and bench update.

➜  frappe-bench cd apps/erpnext
➜  erpnext git:(develop) cd ..
➜  apps cd frappe
➜  frappe git:(develop)
➜  frappe git:(develop) git checkout master
error: pathspec 'master' did not match any file(s) known to git.

This is pretty odd.

Instead of going back and forth with commands, can I remotely help you out with this? Teamviewer maybe?

Thank you for the offer. I have sent you a PM with the credentials since I dont know your email address. Also my colleague is getting frustrated on another topic ERPnext Fresh Setup to MacOs - Common Problems that is related to this.

Alright, the issue is being caused by shallow clones of the repos. Try going in the frappe and erpnext directory and doing git fetch --unshallow and then bench switch-to-master

executed git fetch --unshallow both on apps/frappe and apps/erpnext and then went back to frappe bench to run bench switch-to-master the result does not differ:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/Users/dominik/Dev/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/dominik/Dev/bench-repo/bench/commands/update.py", line 122, in switch_to_master
    switch_to_master(upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 181, in switch_to_master
    switch_branch('master', apps=apps, bench=bench, upgrade=upgrade)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 152, in switch_branch
    version_upgrade = is_version_upgrade(bench=bench, branch=branch)
  File "/Users/dominik/Dev/bench-repo/bench/app.py", line 99, in is_version_upgrade
    raise Exception("Current branch of 'frappe' not in upstream")
Exception: Current branch of 'frappe' not in upstream