question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When running the tests, I am obtaining "There is 1 other session using the database" with Postgresql

See original GitHub issue

Hello!

As the title says, almost everytime I run the tests I get

OperationalError: database "database_name" is being accessed by other users
DETAIL:  There is 1 other session using the database

I was not getting it until I start using django-blog-zinnia in my project.

Searching through internet, I found https://code.djangoproject.com/ticket/22420#comment:8

according to that comment, that person was also using django-blog-zinnia. Is there a chance that this error is produced by blog-zinnia?

Thank you!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
mick88commented, May 31, 2016

This appears to be caused by directory pingers, which run on a secondary thread. I fixed this by disabling them in my settings.py:

# this fixes the issue
ZINNIA_SAVE_PING_DIRECTORIES = False
# This doesnt seem to make a difference for me, but I also disabled it for good measure
ZINNIA_PING_EXTERNAL_URLS = False
1reaction
Fantomas42commented, Mar 22, 2017

Hello,

in https://github.com/Fantomas42/django-blog-zinnia/commit/3c86754dbb65f99fbb88b60adf1e576467c0e3c1 the Thread functionality is totally disabled in the tests, the issue should not occurs anymore.

Regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] PostgreSQL ERROR: There is 1 other session using ...
In PostgreSQL, if you have active connection to the database and if you try to DROP the database, you will get the following...
Read more >
There is 1 other session using the database AWS RDS ...
When I try to remove the postgressql database using ansible module "postgresql_db" I am getting below error. FAILED!
Read more >
PostgreSQL DROP Database DETAIL: There is 1 other ...
So the short answer is there is 1 active connection opened to target db, so it cannot delete the selected database until the...
Read more >
List sessions / active connections in PostgreSQL database
You can see session list on our test server. sample results. Using pgAdmin. In the Browser pane, select our database (1) and then...
Read more >
9.26. System Administration Functions - PostgreSQL
PostgreSQL allows database sessions to synchronize their snapshots. A snapshot determines which data is visible to the transaction that is using the snapshot....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found