dagobah icon indicating copy to clipboard operation
dagobah copied to clipboard

InvalidRequestError

Open zhenlongbai opened this issue 9 years ago • 1 comments

I use chrome wihch used utf-8 when I change the task , it show the follow error . If I change the backend to MongoDB ,would I solve the problem?

[brdwork@recbox04 site-packages]$ sudo dagobahd /usr/local/lib/python2.7/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability. _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning) Logging output to /home/brdwork/logs/dagobah.log Logger initialized at level INFO Package pysqlite has version 2.6.3 which is later than specified version 2.6.0. If you experience issues, try downgrading to version 2.6.0. Package sqlalchemy has version 0.9.9 which is later than specified version 0.9.4. If you experience issues, try downgrading to version 0.9.4. Package alembic has version 0.7.4 which is later than specified version 0.6.4. If you experience issues, try downgrading to version 0.6.4. INFO [alembic.migration] Context impl SQLiteImpl. INFO [alembic.migration] Will assume non-transactional DDL. WARNI [root] Email.auth_required is True but Email.user is None. Emailing of reports will be disabled. Starting app on 0.0.0.0:9876 Exception in thread Thread-3: Traceback (most recent call last): File "/usr/local/lib/python2.7/threading.py", line 551, in __bootstrap_inner self.run() File "/usr/local/lib/python2.7/threading.py", line 755, in run self.function(_self.args, *_self.kwargs) File "/usr/local/lib/python2.7/site-packages/dagobah/core/core.py", line 824, in check_complete complete_time=datetime.utcnow()) File "/usr/local/lib/python2.7/site-packages/dagobah/core/core.py", line 1027, in _task_complete self.parent_job._complete_task(self.name, **kwargs) File "/usr/local/lib/python2.7/site-packages/dagobah/core/core.py", line 529, in _complete_task self._commit_run_log() File "/usr/local/lib/python2.7/site-packages/dagobah/core/core.py", line 624, in _commit_run_log self.backend.commit_log(self.run_log) File "/usr/local/lib/python2.7/site-packages/dagobah/backend/sqlite.py", line 201, in commit_log self.session.commit() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 788, in commit self.transaction.commit() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 384, in commit self._prepare_impl() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 364, in _prepare_impl self.session.flush() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1985, in flush self._flush(objects) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2103, in _flush transaction.rollback(_capture_exception=True) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in exit compat.reraise(exc_type, exc_value, exc_tb) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2067, in _flush flush_context.execute() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 372, in execute rec.execute(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 526, in execute uow File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 60, in save_obj mapper, table, update) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 518, in _emit_update_statements execute(statement, params) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 841, in execute return meth(self, multiparams, params) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 938, in _execute_clauseelement compiled_sql, distilled_params File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1070, in _execute_context context) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1271, in _handle_dbapi_exception exc_info File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1063, in _execute_context context) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 442, in do_execute cursor.execute(statement, parameters) ProgrammingError: (ProgrammingError) You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. u'UPDATE dagobah_log_task SET start_time=?, complete_time=?, success=?, return_code=?, stdout=?, stderr=?, save_date=? WHERE dagobah_log_task.id = ?' ('2015-04-15 10:46:00.764890', '2015-04-15 10:46:03.305422', False, 127, '', '/bin/sh: /usr/local/bin/php: \xe6\xb2\xa1\xe6\x9c\x89\xe9\x82\xa3\xe4\xb8\xaa\xe6\x96\x87\xe4\xbb\xb6\xe6\x88\x96\xe7\x9b\xae\xe5\xbd\x95\n', '2015-04-15 10:46:03.319551', 91)

ERROR [root] This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (ProgrammingError) You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. u'UPDATE dagobah_log_task SET start_time=?, complete_time=?, success=?, return_code=?, stdout=?, stderr=?, save_date=? WHERE dagobah_log_task.id = ?' ('2015-04-15 10:46:00.764890', '2015-04-15 10:46:03.305422', False, 127, '', '/bin/sh: /usr/local/bin/php: \xe6\xb2\xa1\xe6\x9c\x89\xe9\x82\xa3\xe4\xb8\xaa\xe6\x96\x87\xe4\xbb\xb6\xe6\x88\x96\xe7\x9b\xae\xe5\xbd\x95\n', '2015-04-15 10:46:03.319551', 91) Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/dagobah/daemon/util.py", line 47, in wrapper result = fn(_args, *_kwargs) File "/usr/local/lib/python2.7/site-packages/dagobah/daemon/api.py", line 148, in delete_job dagobah.delete_job(args['job_name']) File "/usr/local/lib/python2.7/site-packages/dagobah/core/core.py", line 215, in delete_job self.backend.delete_job(job.job_id) File "/usr/local/lib/python2.7/site-packages/dagobah/backend/sqlite.py", line 152, in delete_job job = self.session.query(DagobahJob).filter_by(id=job_id).one() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2398, in one ret = list(self) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2441, in iter return self._execute_and_instances(context) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2454, in _execute_and_instances close_with_result=True) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2445, in _connection_from_session **kw) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 880, in connection execution_options=execution_options) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 885, in _connection_for_bind engine, execution_options) File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 305, in _connection_for_bind self._assert_active() File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 214, in _assert_active % self._rollback_exception InvalidRequestError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (ProgrammingError) You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. u'UPDATE dagobah_log_task SET start_time=?, complete_time=?, success=?, return_code=?, stdout=?, stderr=?, save_date=? WHERE dagobah_log_task.id = ?' ('2015-04-15 10:46:00.764890', '2015-04-15 10:46:03.305422', False, 127, '', '/bin/sh: /usr/local/bin/php: \xe6\xb2\xa1\xe6\x9c\x89\xe9\x82\xa3\xe4\xb8\xaa\xe6\x96\x87\xe4\xbb\xb6\xe6\x88\x96\xe7\x9b\xae\xe5\xbd\x95\n', '2015-04-15 10:46:03.319551', 91) ERROR [dagobah.daemon.daemon] Exception on /api/delete_job [POST]

zhenlongbai avatar Apr 16 '15 02:04 zhenlongbai

Thanks for the detailed report. I think UTF-8 is something which we should be able to handle. Really we probably need to do a pass over the whole application to make sure it plays nicely with non-ASCII encodings.

thieman avatar Apr 16 '15 03:04 thieman