Closed vmw closed 4 months ago
The strange thing here is that in https://github.com/inventree/InvenTree/issues/7436 you got an error in migration report.0026
- which means that report.0022
has already been run on your database.
But now, the database is trying to apply report.0022
. Which has clearly already been applied.
To start can you please run the following commands:
cd src/backend/InvenTree
python ./manage.py showmigrations
(and share the results here)
After checkout out to: commit 2d234e2, and attempting to rerun invoke update, I still get the error above.
(env) [inv@korbin InvenTree]$ python ./manage.py showmigrations
Python version 3.11.3 - /langford/inventree/env/bin/python
/langford/inventree/env/lib/python3.11/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
InvenTree
[X] 0001_initial
account
[X] 0001_initial
[X] 0002_email_max_length
[X] 0003_alter_emailaddress_create_unique_verified_email
[X] 0004_alter_emailaddress_drop_unique_email
[X] 0005_emailaddress_idx_upper_email
admin
[X] 0001_initial
[X] 0002_logentry_remove_auto_add
[X] 0003_logentry_add_action_flag_choices
auth
[X] 0001_initial
[X] 0002_alter_permission_name_max_length
[X] 0003_alter_user_email_max_length
[X] 0004_alter_user_username_opts
[X] 0005_alter_user_last_login_null
[X] 0006_require_contenttypes_0002
[X] 0007_alter_validators_add_error_messages
[X] 0008_alter_user_username_max_length
[X] 0009_alter_user_last_name_max_length
[X] 0010_alter_group_name_max_length
[X] 0011_update_proxy_permissions
[X] 0012_alter_user_first_name_max_length
build
[X] 0001_initial
[X] 0002_auto_20190520_2204
[X] 0003_auto_20190525_2355
[X] 0004_auto_20190525_2356
[X] 0005_auto_20190604_2217
[X] 0006_auto_20190913_1407
[X] 0007_auto_20191118_2321
[X] 0008_auto_20200201_1247
[X] 0009_auto_20200210_1032
[X] 0010_auto_20200318_1027
[X] 0011_auto_20200406_0123
[X] 0012_build_sales_order
[X] 0013_auto_20200425_0507
[X] 0014_auto_20200425_1243
[X] 0015_auto_20200425_1350
[X] 0016_auto_20200426_0551
[X] 0017_auto_20200426_0612
[X] 0018_build_reference
[X] 0019_auto_20201019_1302
[X] 0020_auto_20201019_1325
[X] 0021_auto_20201020_0908_squashed_0026_auto_20201023_1228 (6 squashed migrations)
[X] 0022_buildorderattachment
[X] 0023_auto_20201110_0911
[X] 0024_auto_20201201_1023
[X] 0025_build_target_date
[X] 0026_auto_20210216_1539
[X] 0027_auto_20210404_2016
[X] 0028_builditem_bom_item
[X] 0029_auto_20210601_1525
[X] 0030_alter_build_reference
[X] 0031_build_reference_int
[X] 0032_auto_20211014_0632
[X] 0033_auto_20211128_0151
[X] 0034_alter_build_reference_int
[X] 0035_alter_build_notes
[X] 0036_auto_20220707_1101
[X] 0037_build_priority
[X] 0038_alter_build_responsible
[X] 0039_auto_20230317_0816
[X] 0040_auto_20230404_1310
[X] 0041_alter_build_title
[X] 0042_alter_build_notes
[X] 0043_buildline
[X] 0044_auto_20230528_1410
[X] 0045_builditem_build_line
[X] 0046_auto_20230606_1033
[X] 0047_auto_20230606_1058
[X] 0048_build_project_code
[X] 0049_alter_builditem_build_line
[X] 0050_auto_20240508_0138
common
[X] 0001_initial
[X] 0002_auto_20190902_2304
[X] 0003_auto_20190902_2310
[X] 0004_inventreesetting
[X] 0005_auto_20190915_1256
[X] 0006_auto_20200203_0951
[X] 0007_colortheme
[X] 0008_remove_inventreesetting_description
[X] 0009_delete_currency
[X] 0010_migrate_currency_setting
[X] 0011_auto_20210722_2114
[X] 0012_notificationentry
[X] 0013_webhookendpoint_webhookmessage
[X] 0014_notificationmessage
[X] 0015_newsfeedentry
[X] 0016_alter_notificationentry_updated
[X] 0017_notesimage
[X] 0018_projectcode
[X] 0019_projectcode_metadata
[X] 0020_customunit
[X] 0021_auto_20230805_1748
[X] 0022_projectcode_responsible
[X] 0023_auto_20240602_1332
[X] 0024_notesimage_model_id_notesimage_model_type
company
[X] 0001_initial
[X] 0002_auto_20190520_2204
[X] 0003_remove_supplierpart_minimum
[X] 0004_auto_20190525_2354
[X] 0005_auto_20190525_2356
[X] 0006_supplierpricebreak_currency
[X] 0007_remove_supplierpart_lead_time
[X] 0008_auto_20190913_1407
[X] 0009_auto_20191118_2323
[X] 0010_auto_20200201_1231
[X] 0011_auto_20200318_1114
[X] 0012_auto_20200318_1114
[X] 0013_auto_20200406_0131
[X] 0014_auto_20200407_0116
[X] 0015_company_is_manufacturer
[X] 0016_auto_20200412_2330
[X] 0017_auto_20200413_0320
[X] 0018_supplierpart_manufacturer
[X] 0019_auto_20200413_0642
[X] 0020_auto_20200413_0839
[X] 0021_remove_supplierpart_manufacturer_name
[X] 0022_auto_20200613_1045
[X] 0023_auto_20200808_0715
[X] 0024_unique_name_email_constraint
[X] 0025_auto_20201110_1001
[X] 0026_auto_20201110_1011
[X] 0027_remove_supplierpricebreak_currency
[X] 0028_remove_supplierpricebreak_cost
[X] 0029_company_currency
[X] 0030_auto_20201112_1112
[X] 0031_auto_20210103_2215
[X] 0032_auto_20210403_1837
[X] 0033_auto_20210410_1528
[X] 0034_manufacturerpart
[X] 0035_supplierpart_update_1
[X] 0036_supplierpart_update_2
[X] 0037_supplierpart_update_3
[X] 0038_manufacturerpartparameter
[X] 0039_auto_20210701_0509
[X] 0040_alter_company_currency
[X] 0041_alter_company_options
[X] 0042_supplierpricebreak_updated
[X] 0043_manufacturerpartattachment
[X] 0044_auto_20220607_2204
[X] 0045_alter_company_notes
[X] 0046_alter_company_image
[X] 0047_supplierpart_pack_size
[X] 0048_auto_20220913_0312
[X] 0049_company_metadata
[X] 0050_alter_company_website
[X] 0051_alter_supplierpricebreak_price
[X] 0052_alter_supplierpricebreak_updated
[X] 0053_supplierpart_updated
[X] 0054_companyattachment
[X] 0055_auto_20230317_0816
[X] 0056_alter_company_notes
[X] 0057_auto_20230427_2033
[X] 0058_auto_20230515_0004
[X] 0059_supplierpart_pack_units
[X] 0060_auto_20230519_0344
[X] 0061_remove_supplierpart_pack_size
[X] 0062_contact_metadata
[X] 0063_auto_20230502_1956
[X] 0064_move_address_field_to_address_model
[X] 0065_remove_company_address
[X] 0066_auto_20230616_2059
[X] 0067_alter_supplierpricebreak_price_currency
[X] 0068_auto_20231120_1108
[X] 0069_company_active
contenttypes
[X] 0001_initial
[X] 0002_remove_content_type_name
django_q
[X] 0001_initial
[X] 0002_auto_20150630_1624
[X] 0003_auto_20150708_1326
[X] 0004_auto_20150710_1043
[X] 0005_auto_20150718_1506
[X] 0006_auto_20150805_1817
[X] 0007_ormq
[X] 0008_auto_20160224_1026
[X] 0009_auto_20171009_0915
[X] 0010_auto_20200610_0856
[X] 0011_auto_20200628_1055
[X] 0012_auto_20200702_1608
[X] 0013_task_attempt_count
[X] 0014_schedule_cluster
[X] 0015_alter_schedule_schedule_type
[X] 0016_schedule_intended_date_kwarg
[X] 0017_task_cluster_alter
error_report
[X] 0001_initial
exchange
[X] 0001_initial
flags
[X] 0012_replace_migrations_for_wagtail_independence (11 squashed migrations)
[X] 0013_add_required_field
inventree_kicad
[X] 0001_initial
[X] 0002_auto_20230920_0115
[X] 0003_selectedcategory_default_reference
[X] 0004_alter_selectedcategory_options
[X] 0005_selectedcategory_default_value_parameter_template
[X] 0006_progressindicator
[X] 0007_auto_20231212_1720
[X] 0008_alter_selectedcategory_footprint_parameter_template
machine
[X] 0001_initial
order
[X] 0001_initial
[X] 0002_auto_20190604_2224
[X] 0003_auto_20190604_2226
[X] 0004_purchaseorder_status
[X] 0005_purchaseorderlineitem_part
[X] 0006_auto_20190605_2056
[X] 0007_auto_20190605_2138
[X] 0008_auto_20190605_2140
[X] 0009_auto_20190606_2133
[X] 0010_purchaseorderlineitem_notes
[X] 0011_auto_20190615_1928
[X] 0012_auto_20190617_1943
[X] 0013_auto_20191118_2323
[X] 0014_auto_20191118_2328
[X] 0015_auto_20200201_2346
[X] 0016_purchaseorderattachment
[X] 0017_auto_20200331_1000
[X] 0018_auto_20200406_0151
[X] 0019_purchaseorder_supplier_reference
[X] 0020_auto_20200420_0940
[X] 0021_auto_20200420_1010
[X] 0022_salesorderlineitem_part
[X] 0023_auto_20200420_2309
[X] 0024_salesorderallocation
[X] 0025_auto_20200422_0222
[X] 0026_auto_20200422_0224
[X] 0027_auto_20200422_0236
[X] 0028_auto_20200423_0956
[X] 0029_auto_20200423_1042
[X] 0030_auto_20200426_0551
[X] 0031_auto_20200426_0612
[X] 0032_auto_20200427_0044
[X] 0033_auto_20200512_1033
[X] 0034_auto_20200512_1054
[X] 0035_auto_20200513_0016
[X] 0036_auto_20200831_0912
[X] 0037_auto_20201110_0911
[X] 0038_auto_20201112_1737
[X] 0039_auto_20201112_2203
[X] 0040_salesorder_target_date
[X] 0041_auto_20210114_1728
[X] 0042_auto_20210310_1619
[X] 0043_auto_20210330_0013
[X] 0044_auto_20210404_2016
[X] 0045_auto_20210504_1946
[X] 0046_purchaseorderlineitem_destination
[X] 0047_auto_20210701_0509
[X] 0048_auto_20210702_2321
[X] 0049_alter_purchaseorderlineitem_unique_together
[X] 0050_alter_purchaseorderlineitem_destination
[X] 0051_auto_20211014_0623
[X] 0052_auto_20211014_0631
[X] 0053_auto_20211128_0151
[X] 0053_salesordershipment
[X] 0054_salesorderallocation_shipment
[X] 0055_auto_20211025_0645
[X] 0056_alter_salesorderallocation_shipment
[X] 0057_salesorderlineitem_shipped
[X] 0058_auto_20211126_1210
[X] 0059_salesordershipment_tracking_number
[X] 0060_auto_20211129_1339
[X] 0054_auto_20211201_2139
[X] 0061_merge_0054_auto_20211201_2139_0060_auto_20211129_1339
[X] 0062_auto_20220228_0321
[X] 0063_alter_purchaseorderlineitem_unique_together
[X] 0064_purchaseorderextraline_salesorderextraline
[X] 0065_alter_purchaseorderlineitem_part
[X] 0066_alter_purchaseorder_supplier
[X] 0067_auto_20220516_1120
[X] 0068_alter_salesorderallocation_unique_together
[X] 0069_auto_20220524_0508
[X] 0070_auto_20220620_0728
[X] 0071_auto_20220628_0133
[X] 0072_alter_salesorder_reference
[X] 0073_alter_purchaseorder_reference
[X] 0074_auto_20220709_0108
[X] 0075_auto_20221110_0108
[X] 0076_auto_20221111_0153
[X] 0077_auto_20230129_0154
[X] 0078_auto_20230304_0721
[X] 0079_auto_20230304_0904
[X] 0080_auto_20230317_0816
[X] 0081_auto_20230314_0725
[X] 0082_auto_20230314_1259
[X] 0083_returnorderextraline
[X] 0084_auto_20230321_1111
[X] 0085_auto_20230322_1056
[X] 0086_auto_20230323_1108
[X] 0087_alter_salesorder_status
[X] 0088_auto_20230403_1402
[X] 0089_auto_20230404_0030
[X] 0090_auto_20230412_1752
[X] 0091_auto_20230419_0037
[X] 0092_auto_20230419_0250
[X] 0093_auto_20230426_0248
[X] 0094_auto_20230514_2331
[X] 0095_salesordershipment_delivery_date
[X] 0096_alter_returnorderlineitem_outcome
[X] 0097_auto_20230529_0107
[X] 0098_auto_20231024_1844
[X] 0099_alter_salesorder_status
otp_static
[X] 0001_initial
[X] 0002_throttling
[X] 0003_add_timestamps
otp_totp
[X] 0001_initial
[X] 0002_auto_20190420_0723
[X] 0003_add_timestamps
part
[X] 0001_initial
[X] 0002_auto_20190520_2204
[X] 0003_auto_20190525_2226
[X] 0004_auto_20190525_2356
[X] 0005_auto_20190526_1119
[X] 0006_auto_20190526_1215
[X] 0007_auto_20190602_1944
[X] 0008_auto_20190618_0042
[X] 0009_part_virtual
[X] 0010_auto_20190620_2135
[X] 0011_part_revision
[X] 0012_auto_20190627_2144
[X] 0013_auto_20190628_0951
[X] 0014_partparameter
[X] 0015_auto_20190820_0251
[X] 0016_auto_20190820_0257
[X] 0017_bomitem_checksum
[X] 0018_auto_20190907_0941
[X] 0019_auto_20190908_0404
[X] 0020_auto_20190908_0404
[X] 0021_auto_20190908_0916
[X] 0022_auto_20190908_0918
[X] 0023_auto_20190913_1401
[X] 0024_auto_20191118_2139
[X] 0025_auto_20191118_2316
[X] 0026_auto_20200131_1022
[X] 0027_auto_20200202_1024
[X] 0028_auto_20200203_1007
[X] 0029_auto_20200223_0901
[X] 0030_auto_20200318_1027
[X] 0031_auto_20200318_1044
[X] 0032_auto_20200322_0453
[X] 0033_auto_20200404_0445
[X] 0034_auto_20200404_1238
[X] 0035_auto_20200406_0045
[X] 0036_partattachment_user
[X] 0037_partattachment_upload_date
[X] 0038_auto_20200513_0016
[X] 0039_auto_20200515_1127
[X] 0040_parttesttemplate
[X] 0041_auto_20200517_0348
[X] 0042_auto_20200518_0900
[X] 0043_auto_20200527_0005
[X] 0044_auto_20200605_0931
[X] 0045_auto_20200605_0932
[X] 0046_auto_20200804_0107
[X] 0047_auto_20200808_0715
[X] 0048_auto_20200902_1404
[X] 0049_partsellpricebreak
[X] 0050_auto_20200917_2315
[X] 0051_bomitem_optional
[X] 0052_partrelated
[X] 0054_auto_20201109_1246
[X] 0055_auto_20201110_1001
[X] 0056_auto_20201110_1125
[X] 0057_remove_partsellpricebreak_currency
[X] 0058_remove_partsellpricebreak_cost
[X] 0059_auto_20201112_1112
[X] 0053_partcategoryparametertemplate
[X] 0060_merge_20201112_1722
[X] 0061_auto_20210104_2331
[X] 0061_auto_20210103_2313
[X] 0062_merge_20210105_0056
[X] 0063_bomitem_inherited
[X] 0064_auto_20210404_2016
[X] 0065_auto_20210505_2144
[X] 0066_bomitem_allow_variants
[X] 0067_partinternalpricebreak
[X] 0068_part_unique_part
[X] 0069_auto_20210701_0509
[X] 0070_alter_part_variant_of
[X] 0071_alter_partparametertemplate_name
[X] 0072_bomitemsubstitute
[X] 0073_auto_20211013_1048
[X] 0074_partcategorystar
[X] 0075_auto_20211128_0151
[X] 0076_auto_20220516_0819
[X] 0077_alter_bomitem_unique_together
[X] 0078_auto_20220606_0024
[X] 0079_alter_part_notes
[X] 0080_alter_part_image
[X] 0081_alter_partcategory_name
[X] 0082_partcategory_pathstring
[X] 0083_auto_20220731_2357
[X] 0084_partcategory_icon
[X] 0085_partparametertemplate_description
[X] 0086_auto_20220912_0007
[X] 0087_bomitem_consumable
[X] 0088_alter_partparametertemplate_name
[X] 0089_auto_20221112_0128
[X] 0090_auto_20221115_0816
[X] 0091_partstocktake
[X] 0092_part_last_stocktake
[X] 0093_auto_20230115_1404
[X] 0094_alter_part_units
[X] 0095_alter_part_responsible
[X] 0096_auto_20230211_0029
[X] 0097_partstocktakereport
[X] 0098_auto_20230214_1115
[X] 0099_alter_bomitem_inherited
[X] 0100_alter_bomitem_reference
[X] 0101_bomitem_validated
[X] 0102_auto_20230314_0112
[X] 0103_auto_20230317_0816
[X] 0104_alter_part_description
[X] 0105_alter_part_notes
[X] 0106_part_tags
[X] 0107_alter_part_tags
[X] 0108_auto_20230516_1334
[X] 0109_auto_20230517_1048
[X] 0110_alter_part_units
[X] 0111_auto_20230521_1350
[X] 0112_auto_20230525_1606
[X] 0113_auto_20230531_1205
[X] 0114_alter_part_minimum_stock
[X] 0115_part_responsible_owner
[X] 0116_auto_20231023_0332
[X] 0117_remove_part_responsible
[X] 0118_auto_20231024_1844
[X] 0119_auto_20231120_0457
[X] 0120_parttesttemplate_key
[X] 0121_auto_20240207_0344
[X] 0122_parttesttemplate_enabled
[X] 0123_parttesttemplate_choices
plugin
[X] 0001_initial
[X] 0002_alter_pluginconfig_options
[X] 0003_pluginsetting
[X] 0004_alter_pluginsetting_key
[X] 0005_notificationusersetting
[X] 0006_pluginconfig_metadata
[X] 0007_auto_20230805_1748
[X] 0008_pluginconfig_package_name
[X] 0009_alter_pluginconfig_key
report
[X] 0001_initial
[X] 0002_delete_reporttemplate
[X] 0003_testreport_enabled
[X] 0004_auto_20200823_1104
[X] 0005_auto_20210119_0815
[X] 0006_reportsnippet
[X] 0007_auto_20210204_1617
[X] 0008_auto_20210204_2100
[X] 0009_testreport_revision
[X] 0010_auto_20210205_1201
[X] 0011_auto_20210212_2024
[X] 0012_buildreport
[X] 0013_testreport_include_installed
[X] 0014_purchaseorderreport_salesorderreport
[X] 0015_auto_20210403_1837
[X] 0016_auto_20210513_1303
[X] 0017_auto_20230317_0816
[X] 0018_returnorderreport
[X] 0019_returnorderreport_metadata
[X] 0020_stocklocationreport
[X] 0021_auto_20231009_0144
[ ] 0022_reporttemplate
[ ] 0023_auto_20240421_0455
[ ] 0024_delete_billofmaterialsreport_delete_buildreport_and_more
[ ] 0025_labeltemplate
[ ] 0026_auto_20240422_1301
[ ] 0027_alter_labeltemplate_model_type_and_more
socialaccount
[X] 0001_initial
[X] 0002_token_max_lengths
[X] 0003_extra_data_default_dict
[X] 0004_app_provider_id_settings
[X] 0005_socialtoken_nullable_app
[X] 0006_alter_socialaccount_extra_data
stock
[X] 0001_initial
[X] 0002_auto_20190525_2226
[X] 0003_auto_20190525_2303
[X] 0004_auto_20190525_2356
[X] 0005_auto_20190602_1944
[X] 0006_stockitem_purchase_order
[X] 0007_auto_20190618_0042
[X] 0008_stockitemtracking_url
[X] 0009_auto_20190715_2351
[X] 0010_stockitem_build
[X] 0011_auto_20190908_0404
[X] 0012_auto_20190908_0405
[X] 0013_auto_20190908_0916
[X] 0014_auto_20190908_0918
[X] 0015_auto_20190913_1407
[X] 0016_auto_20191118_2146
[X] 0017_auto_20191118_2311
[X] 0018_auto_20200202_0103
[X] 0019_auto_20200202_1024
[X] 0020_auto_20200206_1213
[X] 0021_auto_20200215_2232
[X] 0022_auto_20200217_1109
[X] 0023_auto_20200318_1027
[X] 0024_auto_20200405_2239
[X] 0025_auto_20200405_2243
[X] 0026_stockitem_uid
[X] 0027_stockitem_sales_order
[X] 0028_auto_20200421_0724
[X] 0029_auto_20200421_2359
[X] 0030_auto_20200422_0015
[X] 0031_auto_20200422_0209
[X] 0032_stockitem_build_order
[X] 0033_auto_20200426_0539
[X] 0034_auto_20200426_0602
[X] 0035_auto_20200502_2308
[X] 0036_stockitemattachment
[X] 0037_stockitemattachment_user
[X] 0038_stockitemattachment_upload_date
[X] 0039_auto_20200513_0016
[X] 0040_stockitemtestresult
[X] 0041_stockitemtestresult_notes
[X] 0042_auto_20200523_0121
[X] 0043_auto_20200525_0420
[X] 0044_auto_20200528_1036
[X] 0045_stockitem_customer
[X] 0046_auto_20200605_0931
[X] 0047_auto_20200605_0932
[X] 0048_auto_20200807_2344
[X] 0049_auto_20200820_0454
[X] 0050_auto_20200821_1403
[X] 0051_auto_20200928_0928
[X] 0052_stockitem_is_building
[X] 0053_auto_20201110_0513
[X] 0054_remove_stockitem_build_order
[X] 0055_auto_20201117_1453
[X] 0056_stockitem_expiry_date
[X] 0057_stock_location_item_owner
[X] 0058_stockitem_packaging
[X] 0059_auto_20210404_2016
[X] 0060_auto_20210511_1713
[X] 0061_auto_20210511_0911
[X] 0062_auto_20210511_2151
[X] 0063_auto_20210511_2343
[X] 0064_auto_20210621_1724
[X] 0065_auto_20210701_0509
[X] 0066_stockitem_scheduled_for_deletion
[X] 0067_alter_stockitem_part
[X] 0068_stockitem_serial_int
[X] 0069_auto_20211109_2347
[X] 0070_auto_20211128_0151
[X] 0071_auto_20211205_1733
[X] 0072_remove_stockitem_scheduled_for_deletion
[X] 0073_alter_stockitem_belongs_to
[X] 0074_alter_stockitem_batch
[X] 0075_auto_20220515_1440
[X] 0076_alter_stockitem_status
[X] 0077_alter_stockitem_notes
[X] 0078_alter_stockitem_supplier_part
[X] 0079_alter_stocklocation_name
[X] 0080_stocklocation_pathstring
[X] 0081_auto_20220801_0044
[X] 0082_alter_stockitem_link
[X] 0083_stocklocation_icon
[X] 0084_auto_20220903_0154
[X] 0085_auto_20220903_0225
[X] 0086_remove_stockitem_uid
[X] 0087_auto_20220912_2341
[X] 0088_remove_stockitem_infinite
[X] 0089_alter_stockitem_purchase_price
[X] 0090_stocklocation_structural
[X] 0091_alter_stockitem_delete_on_deplete
[X] 0092_alter_stockitem_updated
[X] 0093_auto_20230217_2140
[X] 0094_auto_20230220_0025
[X] 0095_stocklocation_external
[X] 0096_auto_20230330_1121
[X] 0097_alter_stockitem_notes
[X] 0098_auto_20230427_2033
[X] 0099_alter_stockitem_status
[X] 0100_auto_20230515_0004
[X] 0100_stockitem_consumed_by
[X] 0101_stockitemtestresult_metadata
[X] 0102_alter_stockitem_status
[X] 0103_stock_location_types
[X] 0104_alter_stockitem_purchase_price_currency
[X] 0105_stockitemtestresult_template
[X] 0106_auto_20240207_0353
[X] 0107_remove_stockitemtestresult_test_and_more
[X] 0108_auto_20240219_0252
[X] 0109_add_additional_test_fields
[ ] 0110_alter_stockitemtestresult_finished_datetime_and_more
taggit
[X] 0001_initial
[X] 0002_auto_20150616_2121
[X] 0003_taggeditem_add_unique_index
[X] 0004_alter_taggeditem_content_type_alter_taggeditem_tag
[X] 0005_auto_20220424_2025
[X] 0006_rename_taggeditem_content_type_object_id_taggit_tagg_content_8fc721_idx
user_sessions
[X] 0001_initial
[X] 0002_auto_20151208_1536
[X] 0003_auto_20161205_1516
users
[X] 0001_initial
[X] 0002_auto_20201004_0158
[X] 0003_auto_20201005_2227
[X] 0004_auto_20210113_1909
[X] 0005_owner_model
[X] 0006_alter_ruleset_name
[X] 0007_alter_ruleset_name
[X] 0008_apitoken
[X] 0009_auto_20231020_2356
[X] 0010_alter_apitoken_key
[ ] 0011_auto_20240523_1640
(env) [inv@korbin InvenTree]$
As I mentioned before, I'm not sure whether this was caused by the previous errors I encountered. We're in the process of using this for a production run, and the previous version appears to work, so I'm at a bit of a loss for where exactly I went wrong.
I'm not sufficiently familiar to know whether, because we're using a comparatively older version of inventree, whether I can safely override or manually clean up or remove that table? I'm quite hesitant to do so, and a number of employees have been using the database since I did this so it's becoming more challenging to find a clean back up.
For additional reference, as I was troubleshooting the issue, I moved back and forth between the commits, and then ran invoke update, prior to restoring to the first database instance after I read the issues. I'm not sure whether I used invoke restore in the way that I should have when I first encountered the error, so I'm not sure what the state of the database is.
We're migrating from: ca8f0cee9f50 so if the offending table doesn't exist in that revision, I might be able to drop it and have the migration tool recreate it?
Again, sorry for these problems. I assumed the previous issue was due to our own scripting file, so I tried to work around it, when I obviously shouldn't have. __O__/
From your previous error message your database clearly has migration report.0022
applied - as it was trying to apply report.0026
in the other error.
So, somehow, with the back-and-forwards of migrations you have a state where:
report.0022
have been appliedinvoke update
command is attempting to re-apply that migrationThis is a special case, and calls for a special approach...
Before doing anything, make sure you have separate backups of your database, especially if it is in production!!!!
Again, make sure you have a backup!
You can instruct the database to skip over this particular migration (and mark it as "applied"), to continue on with the process.
Run the following command (*after backing up a copy of your database) and reply with the output..
cd src/backend/InvenTree
python ./manage.py migrate --fake report 0022
Ideally after this step, the rest of the migrations can be run simply with invoke update
After backing up the database, I followed the above instructions. That command resulted in report migration 022 to work, but then resulted in 026 failing.
I'm tempted to apply the command to fake report 26, but given that this is the report that initially triggered the bug, and it failed at some mid-point within the migration (presumably because it encountered some un-handled case), I'm not sure whether completely faking it is a good idea, as we've since added back the file that I previously removed to get it working.
Will the migration process recognize the new report template and apply it? Or might we run into other issues?
I've included the specific log files below;
After faking the first report:
(env) $ python ./manage.py migrate --fake report 0022
Python version 3.11.3 - /langford/inventree/env/bin/python
2024-06-20 18:41:06,034 WARNING Plugin configuration file does not exist - creating default file
/langford/inventree/env/lib/python3.11/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
System check identified some issues:
WARNINGS:
account.EmailAddress: (models.W036) MariaDB does not support unique constraints with conditions.
HINT: A constraint won't be created. Silence this warning if you don't care about it.
account.EmailAddress: (models.W043) MariaDB does not support indexes on expressions.
HINT: An index won't be created. Silence this warning if you don't care about it.
Operations to perform:
Target specific migration: 0022_reporttemplate, from report
Running migrations:
Applying report.0022_reporttemplate... FAKED
After running invoke migrate:
Running InvenTree database migrations...
========================================
/langford/inventree/env/lib/python3.11/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
Python version 3.11.3 - /langford/inventree/env/bin/python3
No changes detected
Python version 3.11.3 - /langford/inventree/env/bin/python3
/langford/inventree/env/lib/python3.11/site-packages/allauth/exceptions.py:9: UserWarning: allauth.exceptions is deprecated, use allauth.core.exceptions
warnings.warn("allauth.exceptions is deprecated, use allauth.core.exceptions")
Operations to perform:
Apply all migrations: InvenTree, account, admin, auth, build, common, company, contenttypes, django_q, error_report, exchange, flags, inventree_kicad, machine, order, otp_static, otp_totp, part, plugin, report, socialaccount, stock, taggit, user_sessions, users
Running migrations:
Applying report.0023_auto_20240421_0455... OK
Applying report.0024_delete_billofmaterialsreport_delete_buildreport_and_more... OK
Applying report.0025_labeltemplate...Traceback (most recent call last):
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 87, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/langford/inventree/env/lib/python3.11/site-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
MySQLdb.OperationalError: (1050, "Table 'report_labeltemplate' already exists")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/langford/inventree/src/src/backend/InvenTree/manage.py", line 24, in <module>
main()
File "/langford/inventree/src/src/backend/InvenTree/manage.py", line 20, in main
execute_from_command_line(sys.argv)
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/src/src/backend/InvenTree/InvenTree/management/commands/runmigrations.py", line 18, in handle
check_for_migrations(force=True, reload_registry=False)
File "/langford/inventree/src/src/backend/InvenTree/InvenTree/tasks.py", line 671, in check_for_migrations
call_command('migrate', interactive=False)
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/__init__.py", line 194, in call_command
return command.execute(*args, **defaults)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 356, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/migrations/operations/models.py", line 96, in database_forwards
schema_editor.create_model(model)
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/base/schema.py", line 451, in create_model
self.execute(sql, params or None)
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/base/schema.py", line 201, in execute
cursor.execute(sql, params)
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 102, in execute
return super().execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/utils.py", line 87, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/django/db/backends/mysql/base.py", line 75, in execute
return self.cursor.execute(query, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/env/lib/python3.11/site-packages/MySQLdb/cursors.py", line 330, in _query
db.query(q)
File "/langford/inventree/env/lib/python3.11/site-packages/MySQLdb/connections.py", line 261, in query
_mysql.connection.query(self, query)
From the subsequent logs it looks like it is failing at 0025
now - trying to create the report_labeltemplate
model (which already exists too).
So, try:
python ./manage.py migrate --fake report 0025
Hi,
After running that commit, we ran into more errors.
IntegrityError
(1364, "Field 'active' doesn't have a default value")
URL: /api/company/part/
I decided to fully restore from backups, and try the process again. In doing so, we realized there was a typo in the previous fix, ( https://github.com/inventree/InvenTree/pull/7438/commits/a28348cf18bedd5a9d0ef114ba7bff84b6b079c7 ). After fixing this bug, the migration proceeded successfully to our target version, and subsequently to the latest on master (5f512fa3ec949964131b3696e3ba1eae04003584).
After completing the migration, however, we were NOT able to successfully run;
invoke version
(env) [inv@korbin src]$ INVENTREE_CONFIG_FILE=/home/inventree/src/InvenTree/config.yaml invoke version
Traceback (most recent call last):
File "/usr/bin/invoke", line 8, in <module>
sys.exit(program.run())
^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/invoke/program.py", line 398, in run
self.execute()
File "/usr/lib/python3.11/site-packages/invoke/program.py", line 583, in execute
executor.execute(*self.tasks)
File "/usr/lib/python3.11/site-packages/invoke/executor.py", line 140, in execute
result = call.task(*args, **call.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/invoke/tasks.py", line 138, in __call__
result = self.body(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/langford/inventree/src/tasks.py", line 1043, in version
import src.backend.InvenTree.InvenTree.version as InvenTreeVersion
File "/langford/inventree/src/src/backend/InvenTree/InvenTree/version.py", line 17, in <module>
from dulwich.repo import NotGitRepository, Repo
ModuleNotFoundError: No module named 'dulwich'
After downloading the latest frontend, everything appears to be working now.
Thank you so much for all your help and everything that you've done so far.
Best Regards,
(1364, "Field 'active' doesn't have a default value")
Did you see this error during the install process, or when running the server?
ModuleNotFoundError: No module named 'dulwich'
Thanks for the report, will look into this.
(1364, "Field 'active' doesn't have a default value")
Did you see this error during the install process, or when running the server?
No, I didn't get any errors, and it had appeared as though the migration completed successfully.
Thanks for the update @vmw
Are you ok to close out this issue?
Yes, thanks!
Please verify that this bug has NOT been raised before.
Describe the bug*
While updating inventree from ca8f0ce to 4631c88, and then running invoke migrate, after having faced the issues specified in #7436, I am unable to complete migration, and receive an error of:
django.db.utils.OperationalError: (1050, "Table 'report_reporttemplate' already exists")
I am not at all sure whether this bug is related to the issues I previously encountered in that issue, or whether I may have caused a subsequent error by working around that issue, or, because it appears to be a similar issue, whether this is another bug.
Steps to Reproduce
NOTE: The previous issue noted a bug related to a report that we had installed. See #7436 for the specific report and previous details.
Attempt to update inventree following the bare metal instructions as follows:
systemctl stop nginx systemctl stop supervisord cd /home/inventree/src/ git pull cd /home/inventree source ./env/bin/activate export INVENTREE_CONFIG_FILE=/home/inventree/src/InvenTree/config.yaml
pip3 install -U -r src/requirements.txt
cd /home/inventree/src/ INVENTREE_CONFIG_FILE=/home/inventree/src/InvenTree/config.yaml invoke update
This results in an error log as shown below.
Expected behaviour
I expect the migration to complete without error.
Deployment Method
Version Information
Built using the latest master: 2d234e283111188d70d32676f606203675e9740e
Please verify if you can reproduce this bug on the demo site.
Relevant log output