You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Applying part.0033_auto_20200404_0445... OK
Applying part.0034_auto_20200404_1238...Could not generate Part thumbnails
Traceback (most recent call last):
File "/home/pi/inventree/inventree-env/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql)
psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
I've tried DROP USER, DROP DATABASE and re-created them; and have blown away the entire install folder and newly cloned from GitHub, same error same place.
Local permissions error? Missing image files? Cooties in my OS?
Might be due to running a postgresql database - I cannot replicate here.. Can you please try the following: Change the contents of https://github.com/inventree/InvenTree/blob/master/InvenTree/part/migrations/0034_auto_20200404_1238.py to:
# Generated by Django 2.2.10 on 2020-04-04 12:38fromdjango.dbimportmigrationsfromdjango.db.utilsimportOperationalError, ProgrammingErrorfrompart.modelsimportPartfromstdimage.utilsimportrender_variationsdefcreate_thumbnails(apps, schema_editor):
""" Create thumbnails for all existing Part images. """# Do not apply this migrationreturn""" try: for part in Part.objects.all(): # Render thumbnail for each existing Part if part.image: try: part.image.render_variations() except FileNotFoundError: print("Missing image:", part.image()) # The image is missing, so clear the field part.image = None part.save() except (OperationalError, ProgrammingError): # Migrations have not yet been applied - table does not exist print("Could not generate Part thumbnails") """classMigration(migrations.Migration):
dependencies= [
('part', '0033_auto_20200404_0445'),
]
operations= [
migrations.RunPython(create_thumbnails),
]
Activity
SchrodingersGat commentedon Apr 25, 2020
Might be due to running a postgresql database - I cannot replicate here.. Can you please try the following: Change the contents of
https://github.com/inventree/InvenTree/blob/master/InvenTree/part/migrations/0034_auto_20200404_1238.pyto:and then see if it runs properly?
SchrodingersGat commentedon Apr 25, 2020
I setup a postgresql test instance and got the same issue on my end. I've fixed this now, I believe. Can you please pull down latest master and check?
rco3 commentedon Apr 26, 2020
I will check it. A sqlite3 install just now worked fine.
rco3 commentedon Apr 26, 2020
I confirm that postgresql database works now as well.
Thank you.
I did try removing the last two migrations, but wasn't successful; now I'm wondering if I remembered to kill and restart the server.
feat(backend): switch to a more formal FSM approach (#12507)