Closed ooeell closed 3 years ago
Also experienced a crash while trying to import a fit. Despite the error, the fit gets successfully imported.
pyfa v2.34.0 EVE Data Version: 1878176 (2021-02-23 10:08:40)
OS version: Windows-10-10.0.19041-SP0 Python version: 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] wxPython version: 4.0.6 (wxWidgets 3.0.5) SQLAlchemy version: 1.3.23 Logbook version: 1.5.3 Requests version: 2.25.1 Dateutil version: 2.8.1
####################
Traceback (most recent call last): File "site-packages\sqlalchemy\engine\base.py", line 1277, in _execute_context File "site-packages\sqlalchemy\engine\default.py", line 608, in do_execute sqlite3.IntegrityError: UNIQUE constraint failed: characterSkills.characterID, characterSkills.itemID
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "eos\db\saveddata\queries.py", line 562, in commit File "site-packages\sqlalchemy\orm\session.py", line 1046, in commit File "site-packages\sqlalchemy\orm\session.py", line 504, in commit File "site-packages\sqlalchemy\orm\session.py", line 483, in _prepare_impl File "site-packages\sqlalchemy\orm\session.py", line 2540, in flush File "site-packages\sqlalchemy\orm\session.py", line 2682, in flush File "site-packages\sqlalchemy\util\langhelpers.py", line 70, in exit File "site-packages\sqlalchemy\util\compat.py", line 182, in raise File "site-packages\sqlalchemy\orm\session.py", line 2642, in _flush File "site-packages\sqlalchemy\orm\unitofwork.py", line 422, in execute File "site-packages\sqlalchemy\orm\unitofwork.py", line 589, in execute File "site-packages\sqlalchemy\orm\persistence.py", line 245, in save_obj File "site-packages\sqlalchemy\orm\persistence.py", line 1083, in _emit_insert_statements File "site-packages\sqlalchemy\engine\base.py", line 1011, in execute File "site-packages\sqlalchemy\sql\elements.py", line 298, in _execute_on_connection File "site-packages\sqlalchemy\engine\base.py", line 1130, in _execute_clauseelement File "site-packages\sqlalchemy\engine\base.py", line 1317, in _execute_context File "site-packages\sqlalchemy\engine\base.py", line 1511, in _handle_dbapiexception File "site-packages\sqlalchemy\util\compat.py", line 182, in raise File "site-packages\sqlalchemy\engine\base.py", line 1277, in _execute_context File "site-packages\sqlalchemy\engine\default.py", line 608, in do_execute sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: characterSkills.characterID, characterSkills.itemID [SQL: INSERT INTO "characterSkills" ("characterID", "itemID", "_Skill__level", created, modified) VALUES (?, ?, ?, ?, ?)] [parameters: (5, 16591, None, '2021-03-07 16:29:19.039585', None)] (Background on this error at: http://sqlalche.me/e/13/gkpj)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "gui\builtinViews\fittingView.py", line 92, in fitSelected File "gui\builtinViews\fittingView.py", line 347, in fitSelected File "gui\builtinViews\fittingView.py", line 595, in slotsChanged File "gui\builtinViews\fittingView.py", line 543, in generateMods File "service\fit.py", line 360, in getFit File "eos\db\saveddata\queries.py", line 568, in commit TypeError: init() missing 2 required positional arguments: 'params' and 'orig'
Seems like a complex issue. Pyfa correctly detects that booster is invalid (since underlying item cannot be loaded) and attempts to add and remove it:
class HandledBoosterList(HandledList):
def append(self, booster):
if booster.isInvalid:
HandledList.append(self, booster)
self.remove(booster)
return
Removal, however, fails due to error deep down in sqlalchemy.
Invalid boosters, i imagine, had to be inserted and removed due to some weird reasons with the command pattern (undo/redo stuff). However, both actions seem to be legitimate, and it should just work.
They had to be inserted and removed to clear DB from invalid items. I am unsure what exactly went funky with SQLAlchemy, but when I removed backref from booster to parent fit, it started processing removed booster as expected.
Fixed in 8ee900a90e2f3f3fc2d70671facb02e2ab8fe53c.
Turned out that those owner attributes are actually used. So I reverted the fix.
Alternatives are looking why this key is not present in sqlalchemy state dict, or managing owner relationship manually, like we do for modules.
Implemented alternate fix in 729b39e351d86a92f6b2e2eacc3a317f8b9cca90 (same implementation as for modules). So far it seems to work without drawbacks.
Bug Report
Expected behavior:
Fit should open
Actual behavior:
Error (see below)
Detailed steps to reproduce:
Opened Pyfa Fittings > Type Thunderchild > Click single fit Error occurred
Fits involved in EFT format (Edit > To Clipboard > EFT):
Can't open fit at all Ship was a Thunderchild
May be this fit (but this is copy/pasted from somewhere else, since I can't open in pyfa) [Thunderchild, supertrain_v100]
Damage Control II Power Diagnostic System II Vorton Tuning System II Vorton Tuning System II Vorton Tuning System II
Multispectrum Shield Hardener II Republic Fleet Large Shield Extender Large Micro Jump Drive Republic Fleet Large Shield Extender Multispectrum Shield Hardener II Republic Fleet Large Shield Extender EM Shield Hardener II
Large Vorton Projector II, StrikeSnipe Ultra L Heavy Energy Neutralizer II
Large Thermal Shield Reinforcer II Large Core Defense Field Extender I Large Core Defense Field Extender I
EDENCOM Vorton Booster GU-5
Release or development git branch? Please note the release version or commit hash:
Release v2.34.0
Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):
Windows 10 64-bit
Other relevant information:
I suspect it has something to do with the edencom boosters
ex: EDENCOM Vorton Booster GU-5
These no longer show up in the market window, and they are missing if you import the above fit
pyfa v2.34.0 EVE Data Version: 1878176 (2021-02-23 10:08:40)
OS version: Windows-10-10.0.18362-SP0 Python version: 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] wxPython version: 4.0.6 (wxWidgets 3.0.5) SQLAlchemy version: 1.3.23 Logbook version: 1.5.3 Requests version: 2.25.1 Dateutil version: 2.8.1
####################
Traceback (most recent call last): File "gui\builtinViews\fittingView.py", line 92, in fitSelected File "gui\builtinViews\fittingView.py", line 347, in fitSelected File "gui\builtinViews\fittingView.py", line 595, in slotsChanged File "gui\builtinViews\fittingView.py", line 543, in generateMods File "service\fit.py", line 348, in getFit File "service\fit.py", line 529, in recalc File "eos\saveddata\fit.py", line 515, in clear File "eos\saveddata\fit.py", line 309, in boosters File "site-packages\sqlalchemy\orm\attributes.py", line 294, in get File "site-packages\sqlalchemy\orm\attributes.py", line 750, in get File "site-packages\sqlalchemy\orm\attributes.py", line 1358, in set_committed_value File "site-packages\sqlalchemy\orm\collections.py", line 664, in append_multiple_without_event File "site-packages\sqlalchemy\orm\collections.py", line 1117, in append File "eos\effectHandlerHelpers.py", line 285, in append File "site-packages\sqlalchemy\orm\collections.py", line 1124, in remove File "site-packages\sqlalchemy\orm\collections.py", line 1097, in del File "site-packages\sqlalchemy\orm\collections.py", line 735, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1208, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1554, in emit_backref_from_collection_remove_event KeyError: '_Fitboosters'
####################
Traceback (most recent call last): File "gui\builtinShipBrowser\sfBrowserItem.py", line 369, in OnLeaveWindow File "gui\builtinShipBrowser\fitItem.py", line 560, in Refresh File "service\fit.py", line 348, in getFit File "service\fit.py", line 529, in recalc File "eos\saveddata\fit.py", line 515, in clear File "eos\saveddata\fit.py", line 309, in boosters File "site-packages\sqlalchemy\orm\attributes.py", line 294, in get File "site-packages\sqlalchemy\orm\attributes.py", line 750, in get File "site-packages\sqlalchemy\orm\attributes.py", line 1358, in set_committed_value File "site-packages\sqlalchemy\orm\collections.py", line 664, in append_multiple_without_event File "site-packages\sqlalchemy\orm\collections.py", line 1117, in append File "eos\effectHandlerHelpers.py", line 285, in append File "site-packages\sqlalchemy\orm\collections.py", line 1124, in remove File "site-packages\sqlalchemy\orm\collections.py", line 1097, in del File "site-packages\sqlalchemy\orm\collections.py", line 735, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1208, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1554, in emit_backref_from_collection_remove_event KeyError: '_Fitboosters'
####################
Traceback (most recent call last): File "gui\builtinShipBrowser\sfBrowserItem.py", line 363, in OnEnterWindow File "gui\builtinShipBrowser\fitItem.py", line 560, in Refresh File "service\fit.py", line 348, in getFit File "service\fit.py", line 529, in recalc File "eos\saveddata\fit.py", line 515, in clear File "eos\saveddata\fit.py", line 309, in boosters File "site-packages\sqlalchemy\orm\attributes.py", line 294, in get File "site-packages\sqlalchemy\orm\attributes.py", line 750, in get File "site-packages\sqlalchemy\orm\attributes.py", line 1358, in set_committed_value File "site-packages\sqlalchemy\orm\collections.py", line 664, in append_multiple_without_event File "site-packages\sqlalchemy\orm\collections.py", line 1117, in append File "eos\effectHandlerHelpers.py", line 285, in append File "site-packages\sqlalchemy\orm\collections.py", line 1124, in remove File "site-packages\sqlalchemy\orm\collections.py", line 1097, in del File "site-packages\sqlalchemy\orm\collections.py", line 735, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1208, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1554, in emit_backref_from_collection_remove_event KeyError: '_Fitboosters'
####################
Traceback (most recent call last): File "gui\builtinShipBrowser\sfBrowserItem.py", line 369, in OnLeaveWindow File "gui\builtinShipBrowser\fitItem.py", line 560, in Refresh File "service\fit.py", line 348, in getFit File "service\fit.py", line 529, in recalc File "eos\saveddata\fit.py", line 515, in clear File "eos\saveddata\fit.py", line 309, in boosters File "site-packages\sqlalchemy\orm\attributes.py", line 294, in get File "site-packages\sqlalchemy\orm\attributes.py", line 750, in get File "site-packages\sqlalchemy\orm\attributes.py", line 1358, in set_committed_value File "site-packages\sqlalchemy\orm\collections.py", line 664, in append_multiple_without_event File "site-packages\sqlalchemy\orm\collections.py", line 1117, in append File "eos\effectHandlerHelpers.py", line 285, in append File "site-packages\sqlalchemy\orm\collections.py", line 1124, in remove File "site-packages\sqlalchemy\orm\collections.py", line 1097, in del File "site-packages\sqlalchemy\orm\collections.py", line 735, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1208, in fire_remove_event File "site-packages\sqlalchemy\orm\attributes.py", line 1554, in emit_backref_from_collection_remove_event KeyError: '_Fitboosters'