Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cronjob not running #142

Open
mtlballer opened this issue Dec 16, 2023 · 3 comments
Open

Cronjob not running #142

mtlballer opened this issue Dec 16, 2023 · 3 comments

Comments

@mtlballer
Copy link

Script no longer runs automatically, but still works manually. The log shows the error below. Feel like I'm missing something simple but I can't currently find it.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
Job "maintenance (trigger: cron[month='*', day='*', day_of_week='*', hour='4', minute='0'], next run at: 2023-12-16 04:00:00 EST)" raised an exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/apscheduler/executors/base.py", line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
  File "/app/app/scripts.py", line 2044, in maintenance
    from app import db, module
  File "/app/app/module.py", line 19, in <module>
    config = Plex.query.filter(Plex.id == '1')
  File "/usr/local/lib/python3.9/site-packages/flask_sqlalchemy/model.py", line 31, in __get__
    cls, session=cls.__fsa__.session()  # type: ignore[arg-type]
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/scoping.py", line 211, in __call__
    sess = self.registry()
  File "/usr/local/lib/python3.9/site-packages/sqlalchemy/util/_collections.py", line 639, in __call__
    key = self.scopefunc()
  File "/usr/local/lib/python3.9/site-packages/flask_sqlalchemy/session.py", line 102, in _app_ctx_id
    return id(app_ctx._get_current_object())  # type: ignore[attr-defined]
  File "/usr/local/lib/python3.9/site-packages/werkzeug/local.py", line 513, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.
@UniverseXXX
Copy link

I can confirm that cronjob is not working for me either. I've tried to define both formats in settings (e.g. 10:00, 0 10 * * *).

@zbinkster
Copy link

Mine no longer works either. I did happen to look and this directory doesnt exist for me "/usr/local/lib/python3.9". Is it there for you?

@UniverseXXX
Copy link

Mine no longer works either. I did happen to look and this directory doesnt exist for me "/usr/local/lib/python3.9". Is it there for you?

It does exist in my setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants