1

I have a sqlite database that i pulled off of my iphone and I was able to read it on my local machine running ubuntu (and also in windows with a sqlite program). However, when i upload it to an EC2 instance (running amazon linux AMI) and tried to open it using sqlite3 there but keep getting database errors saying

unable to open database file is encrypted or is not a database.

I'm not sure what would be causing this. My local sqlite3 is 3.7.9 while the amazon one is 3.6.20, but i'm also having the same issue opening the file from a rails server running on the EC2, while the same exact code (and same version of the sqlite gem) opens the file fine locally.

I thought something could have encrypted it accidentally when submitting the form on the website, but I also just downloaded the exact same file via curl from a different server and got the same database error when trying to open it.

bdwain
  • 1,665
  • 16
  • 35
  • Sounds like a version mismatch. Have you tried using the same versions across ? – Rico Feb 23 '14 at 03:44
  • well i figure if i'm using the same sqlite3 gem in my rails app on both different computers, that would be the same version. i'm not really positive how to update the sqlite3 program on the ec2 instance, but it shouldn't affect what rails uses anyway, since it's all in the process right? – bdwain Feb 23 '14 at 03:49
  • Hmm not sure. My guess is that it matters because the sqlite bindings for any language require some native code/binary and if you installed it on a particular server chances are that they are using the libraries present on the server. – Rico Feb 23 '14 at 04:00
  • hm seems like there was a big change between 3.6 and 3.7. http://stackoverflow.com/questions/12656588/sqlite3notadatabaseexception-file-is-encrypted-or-is-not-a-database-in-produ – bdwain Feb 23 '14 at 04:22
  • I just can't figure out how to update the server to 3.7. it seems to think 3.6 is the latest – bdwain Feb 23 '14 at 04:22
  • 1
    i'm just gonna switch to ubuntu. seems like amazon's yum repository has the old sqlite3 version. Thanks for your help – bdwain Feb 23 '14 at 04:58

0 Answers0