'MySQL server has gone away' is raised when connection goes stale while adding to 'apscheduler_jobs'
See original GitHub issueWhen connection goes stale either because of non usage or MySQL
restart, following error is raised,
1805 2017-09-26 13:39:03,396 [ERROR] sm_lib [__init__.py:56] [write_error]: (_mysql_exceptions.OperationalError) (2006, 'MySQL server has gone away') [SQL: u'INSERT INTO apscheduler_jobs (id, next_run_time, job_state) VALUES (%s, %s, %s)'] [parameters: ('f01b7658d8ae499fb86b9038f9ffc3c6', 1506450600.0, "\x80\x02}q\x01(U\x04argsq\x02\x8a\x01\x19\x85q\x03U\x08executorq\x04U\x07defaultq\x05U\rmax_instancesq\x06K\x01U\x04funcq\x07U:aps_scheduler.scheduler.executer.campaign:campaign_triggerq\x08U\x02idq\tU f01b7658d8ae499fb86b9038f9ffc3c6q\nU\rnext_run_timeq\x0bcdatetime\ndatetime\nq\x0cU\n\x07\xe1\t\x1a\x12\x1e\x00\x00\x00\x00cpytz\n_UTC\nq\r)Rq\x0e\x86Rq\x0fU\x04nameq\x10U\x10campaign_triggerq\x11U\x12misfire_grace_timeq\x12M\x84\x03U\x07triggerq\x13capscheduler.triggers.date\nDateTrigger\nq\x14)\x81q\x15}q\x16(U\x07versionq\x17K\x01U\x08run_dateq\x18h\x0cU\n\x07\xe1\t\x1a\r'\x03\x05\x94mcpytz\n_p\nq\x19U\x07Etc/UTCq\x1a\x85Rq\x1b\x86Rq\x1cubU\x08coalesceq\x1d\x89h\x17K\x01U\x06kwargsq\
x1e}q\x1fu.")]
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
apscheduler Lost connection to MySQL server during query
I use apscheduler to execute regular job, and I got some error on it. ... To find the answer, I try some test...
Read more >Resolve the error "MySQL server has gone away" when ...
If a connection is idle for too long, then the connection might be terminated incorrectly from the client. To resolve this issue, verify...
Read more >APScheduler Documentation
Configuring the job stores and executors is done through the scheduler, as is adding, modifying and removing jobs. 1.1.4 Choosing the right ...
Read more >Version history — APScheduler 3.9.1 documentation
Fixed a problem where bound methods added as jobs via textual references were called with an unwanted extra self argument (PR by Pengjie...
Read more >7 Ways to Execute Scheduled Jobs with Python
APScheduler offers three basic scheduling systems that should meet most of your job scheduler needs: Cron-style scheduling (with optional start/end times) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pranav93 Yeah. It works well for me.
Hello! I need a bit of help here. I want to use this MySQLAlchemyJobStore instead of the default SQLAlchemyJobStore since I get this ‘2006’ error a lot. I notice function ‘ping_connection()’ is defined at the first link above. But where do I get “some_engine” from… seems that self.engine won’t work… I thought the engine gets created inside the SQLAlchemyJobStore function.
I don’t know where to start in the SQLAlchemy documentation - a concrete example would be best for me - what am I missing?