django via heroku auth_user error - django

I'm trying to deploy my first small django app to heroku. I'm following a tutorial from djangogirls: http://tutorial.djangogirls.org
I'm able to create the app and login as admin on my local computer. When I deploy to heroku and try to login as admin, I get an error saying there is no such table for auth_user:
OperationalError at /admin/login/
no such table: auth_user
Request Method: POST
Request URL: https://intense-river-2803.herokuapp.com/admin/login/?next=/admin/
Django Version: 1.7.5
Exception Type: OperationalError
Exception Value:
no such table: auth_user
Exception Location: /app/.heroku/python/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py in execute, line 485
Python Executable: /app/.heroku/python/bin/python
Python Version: 2.7.9
Python Path:
['/app',
'/app/.heroku/python/bin',
'/app/.heroku/python/lib/python2.7/site-packages/setuptools-11.3.1-py2.7.egg',
'/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg',
'/app',
'/app/.heroku/python/lib/python27.zip',
'/app/.heroku/python/lib/python2.7',
'/app/.heroku/python/lib/python2.7/plat-linux2',
'/app/.heroku/python/lib/python2.7/lib-tk',
'/app/.heroku/python/lib/python2.7/lib-old',
'/app/.heroku/python/lib/python2.7/lib-dynload',
'/app/.heroku/python/lib/python2.7/site-packages']
Server time: Sat, 28 Feb 2015 15:40:42 -0800
I think I'm able to migrate the database ok, but createsuperuser is a problem.
(env) C:\Users\dougw_000\SkyDrive\MyDjangoSite>heroku run python manage.py migra
te
Running `python manage.py migrate` attached to terminal... up, run.4246
Operations to perform:
Apply all migrations: sessions, contenttypes, blog, admin, auth
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying blog.0001_initial... OK
Applying sessions.0001_initial... OK
(env) C:\Users\dougw_000\SkyDrive\MyDjangoSite>heroku run python manage.py creat
esuperuser
Running `python manage.py createsuperuser` attached to terminal... up, run.3724
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/_
_init__.py", line 385, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/_
_init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/b
ase.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/auth/mana
gement/commands/createsuperuser.py", line 55, in execute
return super(Command, self).execute(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/b
ase.py", line 338, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/auth/mana
gement/commands/createsuperuser.py", line 88, in handle
default_username = get_default_username()
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/auth/mana
gement/__init__.py", line 174, in get_default_username
auth_app.User._default_manager.get(username=default_username)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/manager
.py", line 92, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.p
y", line 351, in get
num = len(clone)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.p
y", line 122, in __len__
self._fetch_all()
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.p
y", line 966, in _fetch_all
self._result_cache = list(self.iterator())
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/query.p
y", line 265, in iterator
for row in compiler.results_iter():
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/com
piler.py", line 700, in results_iter
for rows in self.execute_sql(MULTI):
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/models/sql/com
piler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils
.py", line 81, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils
.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/utils.py", lin
e 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/utils
.py", line 65, in execute
return self.cursor.execute(sql, params)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/sqlit
e3/base.py", line 485, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user
(env) C:\Users\dougw_000\SkyDrive\MyDjangoSite>

Firstly, find and delete all pyc files locally. Tell your .gitignore file to ignore pyc files in the future and finally push your changes to heroku.
So, to remove the pyc files, in a UNIX like system (linux, OSX), run this command in your terminal inside your djangogirls folder:
find . -name "*.pyc" -exec rm -rf {} \;
Then go to your .gitignore file and add this line:
*.pyc
Then do:
git add -A .
git commit -m "Remove pyc files"
git push heroku master
The tutorial ommits to tell you to add "*.pyc" to your gitignore and this confuses Heroku, a lot.
I had the same issue and this is how I solved it.
Let me know if it worked!

Related

SQLite objects created in a thread can only be used in that same thread with Django 2.2.2 and ipdb

I updated my Django project to version 2.2.2 and now when I call to ipdb for debugging, the server tell me that error. If I go back to Django 2.2.1, the error disappears.
System check identified no issues (0 silenced).
June 06, 2019 - 08:19:36
Django version 2.2.2, using settings 'laserapp.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
> /home/lynde/public_html/laserapp/gestion/views.py(192)get_context_data()
191 import ipdb; ipdb.set_trace()
--> 192 context = super(ResumeOrderCodeView, self).get_context_data(**kwargs)
193 try:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 60, in execute
super().execute(*args, **options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 95, in handle
self.run(**options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 585, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 570, in start_django
reloader.run(django_main_thread)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 288, in run
self.run_loop()
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 294, in run_loop
next(ticker)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 334, in tick
for filepath, mtime in self.snapshot_files():
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 350, in snapshot_files
for file in self.watched_files():
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 249, in watched_files
yield from iter_all_python_module_files()
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/django/utils/autoreload.py", line 120, in iter_modules_and_files
sys_file_paths.append(module.__file__)
AttributeError: module '__main__' has no attribute '__file__'
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev#python.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/IPython/core/history.py", line 780, in writeout_cache
self._writeout_input_cache(conn)
File "/home/lynde/public_html/env/laser/lib/python3.6/site-packages/IPython/core/history.py", line 764, in _writeout_input_cache
(self.session_number,)+line)
sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. The object was created in thread id 140030717908736 and this is thread id 140031011022656.
Can somebody know what's the problem there? I'm using django runserver in local machine, with celery and postgresql database.
Thanks!! :)
Try using the --reload flag to run runserver.
./manage.py runserver --noreload
It stops the server reloading on code changes but I think avoids the issue you're having.

Django migrations issues with foreign dependency

I am trying to deal with an "it works on my machine" type of problem. I have a django project using jenkins which fails on migrations. The step is triggered with this command: python manage.py test -v 2 --noinput and there goes traceback:
Applying gloodny.0020_auto_20180314_1338... OK
Applying openinghours.0001_initial... OK
Applying payu_payment.0002_auto_20171222_1407... OK
Applying sessions.0001_initial... OK
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 30, in run_from_argv
super(Command, self).run_from_argv(argv)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 74, in execute
super(Command, self).execute(*args, **options)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/management/commands/test.py", line 90, in handle
failures = test_runner.run_tests(test_labels)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/test/runner.py", line 532, in run_tests
old_config = self.setup_databases()
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/test/runner.py", line 482, in setup_databases
self.parallel, **kwargs
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/test/runner.py", line 726, in setup_databases
serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True),
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 78, in create_test_db
self.connection._test_serialized_contents = self.serialize_db_to_string()
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 122, in serialize_db_to_string
serializers.serialize("json", get_objects(), indent=None, stream=out)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/serializers/__init__.py", line 129, in serialize
s.serialize(queryset, **options)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/core/serializers/base.py", line 79, in serialize
for count, obj in enumerate(queryset, start=1):
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/backends/base/creation.py", line 118, in get_objects
for obj in queryset.iterator():
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 52, in __iter__
results = compiler.execute_sql()
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 848, in execute_sql
cursor.execute(sql, params)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/utils.py", line 95, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/var/lib/jenkins/workspace/papuportal/env/local/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "openinghours_company" does not exist
LINE 1: ...mpany"."slug", "openinghours_company"."logo" FROM "openingho...
This is caused by openinghours django library.
Problem I am facing is more complicated since locally those migrations run without error:
Applying gloodny.0020_auto_20180314_1338... OK
Applying gloodny.0021_auto_20180320_1426... OK
Applying gloodny.0022_auto_20180320_1550... OK
Applying openinghours.0001_initial... OK
Applying openinghours.0002_auto_20180320_1426... OK
Applying payu_payment.0002_auto_20171222_1407... OK
Applying sessions.0001_initial... OK
Applying thumbnail.0001_initial... OK
I have set OPENINGHOURS_PREMISES_MODEL settings variable to a model I actually have, I have also tried to add a dependency:
dependencies = [
('payu_payment', '0001_initial'),
('openinghours', '0002_auto_20180320_1426'),
]
but then the build failed with this error:
Migration payu_payment.0002_auto_20171222_1407 dependencies reference nonexistent parent node (u'openinghours', u'0002_auto_20180320_1426')
How can I fix those migrations?
EDIT I fixed a typo pointed out in comments, but now I can run tests with command mentioned above locally and on jenkins I get the same error.

Heroku Django Postgres syncdb error

Heroko Config
DATABASE_URL: postgres://xxxxxxxx:xxxxxxxxxx#ec2-54-243-215-140.compute-1.amazonaws.com:5432/xxxxxxxxx
HEROKU_POSTGRESQL_GOLD_URL: postgres://yyyyyyyyyyy:yyyyyyyyyyyyy#ec2-54-243-243-20.compute-1.amazonaws.com:5432/yyyyyyyyyy
HEROKU_POSTGRESQL_YELLOW_URL: postgres://zzzzzzzzzz:zzzzzzzzzzzz#ec2-54-243-215-140.compute-1.amazonaws.com:5432/zzzzzzzzz
settings.py
DATABASES = {'default': dj_database_url.config(default='postgres://xxxxxxxx:xxxxxxxxxx#ec2-54-243-215-140.compute-1.amazonaws.com:5432/xxxxxxxxx'),}
heroku run python manage.py syncdb
Running `python manage.py syncdb` attached to terminal... up, run.4673
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 60, in handle_noargs
tables = connection.introspection.table_names()
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/__init__.py", line 910, in table_names
return self.get_table_list(cursor)
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/introspection.py", line 33, in get_table_list
AND pg_catalog.pg_table_is_visible(c.oid)""")
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute
return self.cursor.execute(query, args)
django.db.utils.DatabaseError: current transaction is aborted, commands ignored until end of transaction block
Many do not speak English and therefore can not explanation. What's the problem?
The error you have posted merely means that there was a previous error in the transaction and the transaction has already aborted. You cannot fix this problem by troubleshooting this error. You must find out what your real problem is and try to fix it.
To do this, check your PostgreSQL logs, and search backwards from this error until you come to a different error. That will be the error that terminated the transaction and you can work on fixing that one instead. This error however is meaningless from a troubleshooting perspective. Find your real problem and fix it.

GSWD Heroku Django manage.py issue

I worked my way through a great django tutorial online, but am having an issue with the final heroku deployment.
Here is the django tutorial:
http://gettingstartedwithdjango.com/en/lessons/introduction-and-launch/
The issue I have is with the last call to heroku:
heroku python manage.py syncdb
Here is the error I get:
(blog-venv)vagrant#precise64:/vagrant/projects/microblog$ heroku run python manage.py syncdb
Running `python manage.py syncdb` attached to terminal... up, run.2530
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
cursor = connection.cursor()
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/__init__.py", line 306, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 177, in _cursor
self.connection = Database.connect(**conn_params)
File "/app/.heroku/python/lib/python2.7/site-packages/psycopg2/__init__.py", line 178, in connect
return _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
(blog-venv)vagrant#precise64:/vagrant/projects/microblog$
Any thoughts
As far as I know ( git intermediate level knowledge ) If you forgot to add locals.py to the .gitignore file and committed it then the git repository will have the locals.py file still in it .
You have to remove the file from git repository since it was included in previous commits.
git rm --cached microblog/settings/local.py
Then add microblog/settings/local.py to .gitignore and commit the changes.
Once heroku sees the correct DATABASES setting . Then syncdb works fine
DATABASES = {'default' : dj_database_url.config() }
did you add:
microblog/settings/local.py
to the .gitignore file ?
if that doesn't work try commenting out the DATABASES = {....} bit in the local.py file and see if that works
https://github.com/kennethlove/gswd-transcripts/blob/master/lesson-01.md

django/postgres: Transaction managed block ended with pending COMMIT/ROLLBACK

I want to run manage.py sqldiff myapp (command from django extension), but I get the following error:
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django_extensions/management/commands/sqldiff.py", line 596, in handle
sqldiff_instance.find_differences()
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 222, in inner
self.__exit__(None, None, None)
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 207, in __exit__
self.exiting(exc_value, self.using)
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 302, in exiting
leave_transaction_management(using=using)
File "/usr/local/lib/python2.7/dist-packages/django/db/transaction.py", line 56, in leave_transaction_management
connection.leave_transaction_management()
File "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 115, in leave_transaction_management
raise TransactionManagementError("Transaction managed block ended with "
django.db.transaction.TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
manage.py runserver, shell, shell_plus all work fine, but the sqldiff command chokes. I have tried:
restart postgres server
manually connect to postgres from shell via psycopg2, ran
connection.rollback(), and connection.commit()
but the error persists.
Any ideas on what can be done are welcome!
Cheers,
Hoff
I updated an issue with sqldiff causing similar problems. Your best bet is probably to obtain django-extensions from the github repository and do a bit of investigation. Edit sqldiff.py and comment out the transaction code decorating the find_differences method:
# #transaction.commit_manually
def find_differences(self):
...
# transaction.rollback() # reset transaction
...
# transaction.commit()
Now your real problem should be revealed, no longer masked by the transaction exception.