braverock / quantstrat

289 stars 114 forks source link

Install Error: file ‘luxor.wfa.ples.RData’ has magic number 'RDX3' #110

Closed N0talent closed 5 years ago

N0talent commented 5 years ago

Hello!

Im getting following Error installing Quantstrat during building indices:

** building package indices
Warning: file ‘luxor.wfa.ples.RData’ has magic number 'RDX3'
  Use of save versions prior to 2 is deprecated
Error in load(zfile, envir = envir) : 
  bad restore file magic number (file may be corrupted) -- no data loaded
ERROR: installing package indices failed
* removing ‘/home/a/R/x86_64-pc-linux-gnu-library/3.4/quantstrat’
* restoring previous ‘/home/a/R/x86_64-pc-linux-gnu-library/3.4/quantstrat’
Error: Failed to install 'quantstrat' from GitHub:
  (converted from warning) installation of package ‘/tmp/Rtmpwmp4dh/file6754533de050/quantstrat_0.16.2.tar.gz’ had non-zero exit status

If I install for example a forked version ( install_github("CodeCre8/quantstrat") ) it works. Any Idea what the error my be? (obv I installed all dependencies)

Regards, Andrew

jaymon0703 commented 5 years ago

Hi @N0talent, thanks for the report. I have reproduced your error. This appears to be a problem since R 3.5.0 (https://github.com/PoonLab/clmp/issues/42) or perhaps only for later versions of R as im sure we never encountered the error before R 3.6.x. The solution is simply re-saving the object with a version of R 3.5.0+ which i have done locally and the build check does not show any errors for the data file format. However, I am getting test failures for our recently added tests, some of which are admittedly flakey tests as they assert unstable constants due to evergreen datasources. I have commented these tests out locally, but more worryingly i am seeing WFA test errors which may be valid failures and i will need to investigate more tomorrow to ascertain validity before i can push the fix for the old data serialization format of the 'luxor.wfa.ples.RData' file.

jaymon0703 commented 5 years ago

I think the last commit https://github.com/braverock/quantstrat/commit/8a86c4ba261c2462cb7582eaa841326c1f3e66a7 which upgraded our Travis-CI distro to Ubuntu Bionic (18.04 LTS) and put us on a new version of R could be why we are seeing the magic number 'RDX3' error now.

jaymon0703 commented 5 years ago

Hi @N0talent installing the latest version should work for you now. I am going to keep this issue open until we resolve the tests i had to skip, including tests which were failing for the macdWFA and bbandsWFA demos, which appear to be related to recent blotter commits...as the tests pass with an older blotter version 0.14.5 (current version 0.14.7)

N0talent commented 5 years ago

Hi Jaymon! Thanks for the quick responce - much appriciated :). So Updating to R 3.5.x should work?

jaymon0703 commented 5 years ago

Yes, installing quantstrat with R 3.5.0 and above should work. I have not tested installing the package on an older version with the re-saved data file. I would appreciate if you did try before upgrading and letting me know if it is an issue?

N0talent commented 5 years ago

Hi jaymon, Thanks for the fix: updating to 3.6 fixed the installation issue.

jaymon0703 commented 5 years ago

Great, thanks for the report! Closing this issue, although WFA demos are still failing with blotter v0.14.6 and above. Will create a separate issue for those.