I am trying to create a program using SQLite and have hit a dead end. I accidentally set the default program for opening .sqlite3 files as notepad and in my quest to fix it I think I broke something and now I'm getting error messages. Here's an example
sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) file is not a database
[SQL: PRAGMA main.table_info("test")]
(Background on this error at: http://sqlalche.me/e/4xp6)
Visiting the link tells me that the error originates from the database driver and at this point I'm in over my head. I was hoping that completely uninstalling the program (maybe including removing all my computer's associations with .sqlite3 files?) might fix it. (I'm on Windows 10)
Related
This question was migrated from Stack Overflow because it can be answered on Super User.
Migrated 17 days ago.
I am not sure where a question like this really falls as it is from an Unraid Linux server, with a Plex Media Server container, which utilizes SQLite (looking for troubleshooting at the root level). I have posted in both Unraid, and Plex forums with no luck.
My Plex container has been failing time and time again on Unraid resulting in me doing integrity checks, rebuilds, dump, import, and a complete wipe and restart (completely remove old directory and start over). At best I get it up for a few minutes before the container fails again. The errors I am receieving have changed but as of the last situation (complete wipe and reinstall of a new container) I am getting the following error in the output log:
Error: Unable to set up server:
sqlite3_statement_backend::loadOne:database disk image is malformed
(N4soci10soci_errorE)
I decided to copy the database onto my windows machine and poke around the database to get a better understanding of the structure. Upon viewing a table called media_items I get the same error.
Clearly one of what I assume to be main tables is corrupt. The question I have then is what if anything can I do to try and fix this or learn about the cause? I would have thought a completely new database would fix my issue, unless it's purely coincidence two back to back databases became corrupted before I could even touch them, with no connection. Could it be one of my media files? Could it be Unraid? Could it be my hard drive?
For context, if unfamiliar with Plex. Once the container is up, it scans my media library and populates it with data such as metadata, posters, watch state, ratings, etc. I get through the full automated build and within 30 minutes it falls apart before I can even customize my library.
Below are references to the bash lines I used in several scenarios throughout troubleshooting. May be useful to someone somewhere.
Integrity Check:
./Plex\ SQLite "$plexDB" "PRAGMA integrity_check"
Recover From Backup:
./Plex\ SQLite "$plexDB" ".output recover.out" ".recover"
Dump:
./Plex\ SQLite "$plexDB" ".output dump.sql" ".dump"
Import:
./Plex\ SQLite "$plexDB" ".read dump.sql"
After hours, days, and a week of all kinds of troubleshooting. To include resetting the docker image (plus others mentioned in the post), it was suggested in another forum to run a memtest. Put memtest on a bootable USB and I was immediately able to conclude one stick was bad. Upon removing that stick I have zero issues and everything is completely fine... Bizarre.
I've been successfully using iExpress for years. Now, when generating the same .exe files that I always generate, iExpress is now giving me the error: Unable to end update of resources.
This error comes at the very end of the process. I see the Create Package screen and the text "Creating the package..." Then the error occurs. In the file folder, I'll see a file like: ~MyFileName.CAB which would normally be deleted at the end of running iExpress.
I've tried deleting the .CAB file and rerunning iExpress again (many times). I tried rebooting. I tried running iExpress with different applications. I tried searching the web and Stack Overflow. I'm using the same Windows user account I normally use. Desperate for help as I'm unable to release my applications. Thank you!!!
The problem is resolved, though not exactly sure how. I did have another user run iExpress on my machine as that other user. (Ie, right-click on the iExpress executable and run as the other user.) That user was able to run iExpress without the error I reported above. And after that, iExpress started magically working for me too.
Could running as the other user have caused Windows to clear out some file that had been corrupted? Something else? I don't know. I just thought I would write what happened in case this can help someone else in the future.
FURTHER UPDATE
The problem popped up again. I finally figured out that if I closed File Explorer before running iExpress, the error never happens. There's some bug with Windows 10 and/or iExpress where having the folder open can interfere with the final step that iExpress does.
Of interest: It's not a consistent bug. Sometimes iExpress finished and sometimes I got the above error when File Explorer and the folder in question was open.
Finally I need to change my current smartphone with firefox OS on it, due to some problems with the speaker.
Anyway I would like to backup not only the contacts, but also the messages (sms).
I found this great tutorial and the work of laenion http://digitalimagecorp.de/flatpress/?x=cat:8? and was able to retrieve the sqlite database of the messages.
Anyway laenion Exporter http://digitalimagecorp.de/software/firefox-os-data-exporter/ffosexporter.html? is only exporting the last messages from each thread, but I want to have a full backup.
Now I started reading in the file with his recommendation of the Firefox Storage Manager. Now it happens, that I can read out 2351 entries and then the conversion stops. However, if I delete some rows and do a restart it loads additional entries up to 2351 again.
Now I am wondering, is there a value in the about:config on how to extend the keys to be converted? Or is there anything else I am doing wrong? Why is the storage manager not reading in the complete database?
Thanks for any hint on how to solve it. Unfortunately I was not able to open the database in a readable style with any other program.
I see this error in my Geneos active console quite often whenever we use "SQL Toolkit" plugin, This error gets corrected whenever we restart the probe but reappears again. There is no pattern by which these error shows up.
Has anybody come across such error in Geneos and does anyone have nay solution to this?
This looks like an Oracle related error. Check that you can execute the SQL statement on command line from the server that the netprobe is running on using the account that the netprobe is running under.
Supplementary checks would be around the Environment variables like ORACLE_HOME etc.
Might be beneficial to see what SQL you are running and tagging this with ORACLE and SQL
I am getting strange and annoying behavior in one (yes, only one) of my RStudio projects. Whenever I restart the R session within this project, I can no longer save any of the files, and when I try to (or RStudio tries to automatically) I get a popup error saying "The system cannot find the file specified" and I have to reopen the project and all of the R scripts.
I looked at the log file, and I see a lot of the following error:
07 Oct 2015 00:52:05 [rsession-Mark] ERROR system error 5 (Access is denied) [path=C:/Users/Mark/GoogleDrive/Research/CEQUAL_event/.Rproj.user/5E5F98D9/sdb/s-26E44539/lock_file];
OCCURRED AT: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308;
LOGGED FROM: bool rstudio::core::FilePath::exists() const C:\Users\Administrator\rstudio\src\cpp\core\FilePath.cpp:308
It looks like the problem may be in the .Rproj.user folder. So I deleted that and let RStudio regenerate it, but the behavior started right back up again.
I am using Windows 7, RStudio version 0.99.441, and R version 3.2.2.
I think #Jack Wasey is right: Google drive locks files during sync. This causes many issues with other programs as well. There are alternatives from companies that do file syncing for a living, such as dropbox, whose clients don't lock files. With google drive you only have the option to use selective sync and exclude every .Rproj.user folder. Once the RStudio's database is corrupted, moving the project out of the Google drive folder won't be enough - you will need to delete/rename it to have RStudio fix its database.
Summary:
Copy contents from all unsaved files to a temp file outside of RStudio (while clicking away the error message every other second)
Quit Rstudio
Pause Google drive syncing
Rename (or move/delete) the hidden .Rproj.user folder in your project
Reopen the project in Rstudio
Exclude the new .Rproj.user folder from syncing with Google drive (Preferences -> sync only these folders)
Remember that Google drive is free / Become an awesome google developer and fix the issue once and for all
May not be related but might be helpful to someone else. I was getting the same error (over and over) and finally realized that I had an R session open from days ago, that had eventually gotten stuck. It was running in the background with a "Fatal Error" message waiting for me to click OK. When I closed that session everything started working again.
This was happening to me as well, but curiously only when I was using Project files (.Rproj - not stand alone R scripts). It was driving me crazy.
I found that buried in the settings (Tools -> Global Options -> Git/SVN) there was a setting "Enable Version Control Interface for RStudio Projects). I guess I had turned that option on when I was messing with my settings and then forgot about it since I don't normally use project files.
What worked for me was I noticed DescTools package I installed caused it, though it served the purpose I installed it - fetched me mode value without going through mode functions. I then deleted the line I got the install.package, re-saved the project (ctrl S) and I could knit it.
Bottom line, read the error message soon as the box pops up, it's going to give you a hint of what line is causing the issue.
I hope this works. Enjoy