Postrunner 0.7.5 can't read my existing data after upgrade
Closed this issue · 2 comments
After upgrading postrunner from 0.6.0 to 0.7.5, I get this error when running
$ postrunner list
INFO: Converting BTreeDB based database to FlatFileDB format
ERROR: undefined method `class_to_id' for nil:NilClass
/home/pauli/.gem/ruby/2.4.0/gems/perobs-2.4.1/lib/perobs/ObjectBase.rb:187:in `_sync'
/home/pauli/.gem/ruby/2.4.0/gems/perobs-2.4.1/lib/perobs/Cache.rb:115:in `block in flush'
/home/pauli/.gem/ruby/2.4.0/gems/perobs-2.4.1/lib/perobs/Cache.rb:115:in `each'
/home/pauli/.gem/ruby/2.4.0/gems/perobs-2.4.1/lib/perobs/Cache.rb:115:in `flush'
/home/pauli/.gem/ruby/2.4.0/gems/perobs-2.4.1/lib/perobs/Store.rb:196:in `exit'
/home/pauli/.gem/ruby/2.4.0/gems/postrunner-0.7.5/lib/postrunner/Main.rb:643:in `ensure_flat_file_db'
/home/pauli/.gem/ruby/2.4.0/gems/postrunner-0.7.5/lib/postrunner/Main.rb:58:in `main'
/home/pauli/.gem/ruby/2.4.0/gems/postrunner-0.7.5/lib/postrunner.rb:24:in `<module:PostRunner>'
/home/pauli/.gem/ruby/2.4.0/gems/postrunner-0.7.5/lib/postrunner.rb:22:in `<top (required)>'
/usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/home/pauli/.gem/ruby/2.4.0/gems/postrunner-0.7.5/bin/postrunner:4:in `<top (required)>'
/home/pauli/.gem/ruby/2.3.0/bin/postrunner:23:in `load'
/home/pauli/.gem/ruby/2.3.0/bin/postrunner:23:in `<main>'
*******************************************************************************
You have triggered a bug in PostRunner 0.7.5!
If I remove the existing .postrunner directory and try again I get this
$ postrunner list
INFO: Creating PostRunner data directory /home/pauli/.postrunner
INFO: Creating HTML output directory /home/pauli/.postrunner/html
INFO: Creating devices directory /home/pauli/.postrunner/devices
INFO: Creating Old Fit directory /home/pauli/.postrunner/old_fit_dir
INFO: Creating fit directory /home/pauli/.postrunner/fit
+----+--------+----+-----+--------+--------+----------+
|Ref.|Activity|Type|Start|Distance|Duration|Speed/Pace|
+----+--------+----+-----+--------+--------+----------+
So it seems like postrunner 0.7.5 can't read the existing database.
I would like postrunner to read the existing data, but I don't know what causes this problem.
My ruby gem versions are:
fit4ruby (1.5.1, 1.3.0)
perobs (2.4.1, 2.3.1)
postrunner (0.7.5, 0.6.0)
The existing data are obtained with Garmin Forerunner 610 and Fenix 3HR.
Updates from older versions should work fine as the storage format has changed a few times during the history of postrunner. Looks like you have a problem during the conversion to the most recent format. Interestingly, the problem seems to be with the old database, not the newly created one. You can try to do the following steps:
- Copy your ~/.postrunner directory and store it away safely. You may have to come back to this.
- If you don't mind making it available to me, I can try to debug this for you.
- If the conversion was successful, you could try to rename database to database-old and database-new to database. Then run 'postrunner check' to see if the new database is OK.
- If that doesn't work, uninstall the new version and run a 'postrunner check' on the old database to see if it's OK.
If that doesn't work, more debugging is needed.
After I renamed from database to database-old and from database-new to database, everything is working fine, and postrunner reads all my existing data. Thank you!