njcuk9999 / apero-drs

A PipelinE to Reduce Observations - The DRS for SPIRou (CFHT)
MIT License
12 stars 0 forks source link

Installation error with SQLite #682

Closed vandalt closed 1 year ago

vandalt commented 2 years ago

When installing with the sqlite option (for a test on my laptop), I get this error. The error does not occur with the mysql option.

16:58:05.285-**|RESET| Updating object database (from google sheets)
16:58:09.822-**|RESET| Updating reject database (from google sheets)
16:58:12.696-!!|RESET| 16:58:12.690-**|DatabaseError|E[00-002-00047] Pandas.to_sql <class
16:58:12.696-!!|RESET|  'sqlite3.IntegrityError'>: UNIQUE constraint failed: MAIN.UHASH
16:58:12.696-!!|RESET|  path: <class 'sqlite3.IntegrityError'>
16:58:12.697-!!|RESET|  Table name: UNIQUE constraint failed: MAIN.UHASH
16:58:12.697-!!|RESET|  Function: apero.base.drs_db.py.SQLiteDatabase.add_from_pandas()
16:58:12.704-**|RESET| ***************************************************************************
16:58:12.711-@!|RESET| W[40-003-00005]: Recipe apero_reset has NOT been successfully completed
16:58:12.717-**|RESET| ***************************************************************************

Error resetting database (see above) cannot install apero

===============================================================================

Exiting installation script
===============================================================================

I know this had been discuss offline before, but I just wanted to put it here in case someone else faces the issue and/or wanted to add info about it.

vandalt commented 2 years ago

For info: it seems that re-running the installation a second time without touching anything works...

njcuk9999 commented 2 years ago

Okay, when I ran a second time I still got the error. I've found the problem: there is no UHASH column (we just base the index of the identifier) the argument passed when there is no unique_cols should be None but it was and empty list - I had fixed this for MySQL but not sqlite, so it shouldn't crash at this stage at least, though I guess I will have to test a mini run with sqlite to know if it works completely.