Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old database migrations not included in 1.5.1+, causing crashes #190

Closed
teamdandelion opened this issue Nov 6, 2014 · 5 comments
Closed

Comments

@teamdandelion
Copy link
Contributor

I can't get pyfa to run on Mac. When I try to run the pyfa.app downloaded (latest release - 1.6.0) I get the following message:
image

I've tried building it from source and after some hacking (getting wxPython 2.8, running in 32 bit to satisfy errors, etc) it crashes with the following traceback:

arch -32 /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python pyfa.py                                                                       Pyfa/git/0919352... !
Traceback (most recent call last):
  File "pyfa.py", line 97, in <module>
    MainFrame()
  File "/Users/dmane/Github/Pyfa/gui/mainFrame.py", line 132, in __init__
    self.additionsPane = AdditionsPane(self.FitviewAdditionsPanel)
  File "/Users/dmane/Github/Pyfa/gui/additionsPane.py", line 69, in __init__
    self.gangPage = GangView(self.notebook)
  File "/Users/dmane/Github/Pyfa/gui/gangView.py", line 130, in __init__
    self.RefreshBoosterFits()
  File "/Users/dmane/Github/Pyfa/gui/gangView.py", line 303, in RefreshBoosterFits
    fitList = sFit.getBoosterFits()
  File "/Users/dmane/Github/Pyfa/service/fit.py", line 123, in getBoosterFits
    fits = eos.db.getBoosterFits()
  File "/Users/dmane/Github/Pyfa/eos/db/saveddata/queries.py", line 267, in getBoosterFits
    fits = saveddata_session.query(Fit).options(*eager).filter(filter).all()
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2320, in all
    return list(self)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2438, in __iter__
    return self._execute_and_instances(context)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2453, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 729, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 322, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
    context)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1159, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
    context)
  File "/usr/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) no such column: fits.booster u'SELECT fits."ID" AS "fits_ID", fits."ownerID" AS "fits_ownerID", fits."shipID" AS "fits_shipID", fits.name AS fits_name, fits.timestamp AS fits_timestamp, fits."characterID" AS "fits_characterID", fits."damagePatternID" AS "fits_damagePatternID", fits.booster AS fits_booster, fits."targetResistsID" AS "fits_targetResistsID" \nFROM fits \nWHERE fits.booster = ?' (1,)
@blitzmann
Copy link
Collaborator

You haven't upgraded in a while, have you?

Your database doesn't have the fits.booster column that was added with 1.1.22 (back in march). We recently moved to a new database migration system, and these old upgrade paths were removed.

Please backup your database (~/.pyfa/saveddata.db), then download and run v1.4.0. This used the old upgrade process and will upgrade your old database schema to the point before the new migration system was put in place. Then try v1.6.0 again.

Also, are you a programmer? We are in need of a Mac dev because of some apparent Mac-related slowness. ;)

@teamdandelion
Copy link
Contributor Author

Thanks, that fixed it! Maybe could just add a helpful error message in this case "try removing your db file" so this is more discoverable for future cases? Didnt know there was a specific upgrade process for pyfa, also didn't realize I had used an old install in the past, I think I used pyfa in past and deleted it and didn't realize I had old assets lying around.

I am a programmer... no promises but if you tell me how to repro the slowness I might poke around a bit

@blitzmann
Copy link
Collaborator

Ah, yeah, well, pyfa doesn't really have error messages. Things just... fail silently. There's an error log that should be produced in your ~/.pyfa, but that basically gives the traceback so it's not really an error message.

Also, displaying an error message for database initialization is tricky as it's done before the GUI even loads, so... Errors in pyfa are a total mess. =/

Pyfa doesn't have an specific upgrade process. We try to make it so that even if you are many releases behind, any update to the user database will be applied no matter the version. However, the mechanism to do this changed recently, and I didn't port the old upgrade processes. I may add them in for straglers =P

@blitzmann
Copy link
Collaborator

As for development help, there was someone who noted that pyfa ship menu was slow on Macs. See #191

If you have any questions on how things work / structure of repo, feel free to add me on Jabber: [email protected]. Kadesh is [email protected]. We have a jabber chat room as well, which is noted in the readme.

@blitzmann blitzmann changed the title Broken on Mac (both binary release + running from source) Old database migrations not included in 1.5.1+, causing crashes Nov 18, 2014
@blitzmann
Copy link
Collaborator

I have committed the old migration paths to the repo.

For documentation:
Originally I was going to just add them to upgrade1 which would cover a use case of 1.1.20 -> 1.6.1. However, for those people that tried to upgrade to 1.5.1 or 1.6.0 and got crashes, their database is now set to v1, and so adding it to upgrade1 wouldn't help as that logic wouldn't run. In order to cover those folk, I simply made a new upgrade file and bumped the DB version to v2. I'll make a new release (v1.6.1) of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants