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.

`no such table: main.catalogue_product__old` when creating a new product

See original GitHub issue

Hi, I’ve ran into a really strange error which I’m not able to debug. On a fresh django-oscar installation (tested with 1.6.4 and 2.0-dev) I’m getting this when I add new product via the dashboard:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/utils.py", line 85, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 296, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: main.catalogue_product__old

I guess there is some bug in the migrations? I looked into this quite some time and couldn’t find the problem.

I prepared a minimal example:

minimalexample.zip

In the extracted folder, run the following commands to init the project and get the same error:

# I tried both the system's pip and virtual envs
pip install django-oscar
python manage.py migrate
# sets up superuser "admin" (admin@admin.de) with password "admin"
python manage.py loaddata data/auth.json
# this triggers the error
python manage.py loaddata data/catalogue.json

This bug also appears when creating a new product via the dashboard in both oscar 2.0 and 1.6.4… Any ideas?

Issue Analytics

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

github_iconTop GitHub Comments

20reactions
armansamimicommented, Mar 17, 2020

I did this in pycharm and it did work:

pip install Django --upgrade

Then

python manage.py migrate python manage.py makemigrations ‘app_name’ python manage.py migrate

0reactions
825icommented, Oct 22, 2020

I did this in pycharm and it did work:

pip install Django --upgrade

Then

python manage.py migrate python manage.py makemigrations ‘app_name’ python manage.py migrate

Man I could KISS you! I have spent 14 hours trying to debug this problem with another Django app because after 3 days of writing the web server crashes when trying to write to the database. This crash caused over one hundred exceptions to be thrown and I didn’t even know where on earth to start.

You are an absolute saint! This fixed my problem one hundred percent and I don’t have a single error now. Oh my days! There is a god!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django - No such table: main.auth_user__old - Stack Overflow
Create the new db.sqlite3 in your root folder. Re-run migrations: python3 manage.py makemigrations python3 manage.py migrate.
Read more >
error - no such table - Using Django
I'm trying to make an e-mail authorization and get an error when creating superuser. What's wrong? application 'www' models.py.
Read more >
OperatorError no such table : Forums - PythonAnywhere
when I go to my site. I am using sqlite3 and python 2.7. It seems like this is a common error and I...
Read more >
subject:"No such Table Error" - The Mail Archive
You're probably right though, if the current database has issues but not the new one, the old one might have somehow been corrupted......
Read more >
How to fix the problem no such table: main.auth_user__old?
Here is the error: dpaste.com/0CM2P00 It appears after trying to add any record in the ... are those projects that build from 17...
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