title: Celery [ERROR/MainProcess] Process 'Worker' exited with 'exitcode 1'
body: <p>I am trying to use celery==3.1.25 (Python 2.7) to run some expensive tasks separately to my main flask app. However, when I start the celery worker using <code>celery -A run.celery worker --loglevel=info</code> the process fails with:</p>
  
  <p><code>[ERROR/MainProcess] Process 'Worker' exited with 'exitcode 1'</code></p>
  
  <p>Here is my file structure:</p>
  
  <pre><code>app/
      __init__.py
      celery_functions.py
      routes.py
      ...
  run.py
  </code></pre>
  
  <p>run.py:</p>
  
  <pre><code>from app import create_app
  from app.config import Config
  from celery import Celery
  
  app = create_app('default')
  app.app_context().push()
  
  from app.routes import *
  
  if __name__ == '__main__':
      app.run(host='0.0.0.0', port=5000)
  </code></pre>
  
  <p>__init__.py:</p>
  
  <pre><code>from flask import Flask
  from flask_bootstrap import Bootstrap
  from config import Config
  
  def create_app(config_name):
      app = Flask(__name__)
      app.config.from_object(config[config_name])
      bootstrap = Bootstrap(app)
      return app
  </code></pre>
  
  <p>celery_functions.py:</p>
  
  <pre><code>import celery
  
  @celery.task(name='celery_functions.archive_repo')
  def archive_repo():
      # do something
  </code></pre>
  
  <p>routes.py:</p>
  
  <pre><code>from celery_functions import *
  
  @app.route('/archive', methods=['GET', 'POST'])
  @login_required
  def archive():
      archive_repo.delay()
  
  return ''
  </code></pre>