pyfa-org / Pyfa

Python fitting assistant, cross-platform fitting tool for EVE Online
GNU General Public License v3.0
1.61k stars 408 forks source link

Error: pyfa has experienced an unexpected issue. #2412

Closed MaartenDeVuijst closed 2 years ago

MaartenDeVuijst commented 2 years ago

Bug Report

pyfa has experienced an unexpected issue.

Expected behavior:

Actual behavior:

Detailed steps to reproduce:

Fits involved in EFT format (Edit > To Clipboard > EFT):

[Algos]

Reactive Armor Hardener Multispectrum Energized Membrane II Kinetic Energized Membrane II

1MN Y-S8 Compact Afterburner Sensor Booster II, Scan Resolution Script Tracking Computer II

125mm Railgun II, Spike S 125mm Railgun II, Spike S 125mm Railgun II, Spike S 125mm Railgun II, Spike S 125mm Railgun II, Spike S [Empty High slot]

Small Kinetic Armor Reinforcer I Small Trimark Armor Pump I Small Thermal Armor Reinforcer I

Hornet EC-300 x3 Hornet II x2 Hornet II x3 Vespa II x2

Spike S x400 Federation Navy Antimatter Charge S x800 Mobile Depot x1 Small Cap Battery II x1 Small Compact Pb-Acid Cap Battery x1 Cap Recharger II x1 Drone Damage Amplifier II x3 Small Remote Capacitor Transmitter II x2

Release or development git branch? Please note the release version or commit hash:

pyfa regular release v2.39.3 EVE Data Version: 2000555 (2022-02-09 13:25:34)

Operating system and version (eg: Windows 10, OS X 10.9, OS X 10.11, Ubuntu 16.10):

Edition: Windows 10 Pro 64-bit Version: 21H2 OS Build: 19044.1526

Other relevant information:

In order to share the fittings between different computers, I have placed the .pyfa folder on my personal OneDrive using a symbolic link (junction) from redirecting \Users\MyName.pyfa to a OneDrive subfolder. That OneDrive environment is subject to 1) synchronization to the cloud environment using the normal rules and settings applied for OneDrive, and 2) continuous file (version) backup by two services: Carbonite (to cloud) and Genie Timeline 10.0.3.300 (to network storage for offline replication).

===Error message=== pyfa v2.39.3 EVE Data Version: 2000555 (2022-02-09 13:25:34)

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.27.1 Dateutil version: 2.8.2

####################

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.OperationalError: attempt to write a readonly database

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "eos\db\saveddata\queries.py", line 574, in flush 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 236, in save_obj File "site-packages\sqlalchemy\orm\persistence.py", line 995, in _emit_update_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.OperationalError: (sqlite3.OperationalError) attempt to write a readonly database [SQL: UPDATE fits SET modified=? WHERE fits."ID" = ?] [parameters: ('2022-03-08 03:27:17.265472', 318)] (Background on this error at: http://sqlalche.me/e/13/e3q8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "gui\fitCommands\calc\module\localReplace.py", line 50, in Do File "eos\db\saveddata\queries.py", line 580, in flush TypeError: init() missing 2 required positional arguments: 'params' and 'orig'

blitzmann commented 2 years ago

Does this happen all the time, or was it a one off?

Whenever you use any sort of cloud sync, there's potential for there to be file access issues. It looks like the error was attempt to write a readonly database, I would check the file permissions. Additionally, I've seen weird things happen if you attempt to do something like this and run both installation at the same time using the same database file.

MaartenDeVuijst commented 2 years ago

It was a one-off incident. Before it happened and afterward, I have not had any issues (using the same setup).

blitzmann commented 2 years ago

That's good to hear.

In that case, I'm going to close this. When you set up the saveddata.db file to sync to the cloud, and potentially have it open in another application, things can get wonky because pyfa is no longer the exclusive application utilizing the file. We can't control for other applications and what kind of locks they perform on the database file.

FWIW, I used to have my database synced to the cloud for the same purpose using Sync. It was rare, but I also ran into an issue a time or two. There may be things that pyfa can do in it's application code to mitigate the issue, but I wouldn't know where to begin.