Workaround for Application Database is Full error | webOS Nation
 
 

Workaround for Application Database is Full error 30

by Adam Marks Wed, 03 Oct 2012 12:05 pm EDT

This tip should work on any devices running webOS 2.0 and higher

Application database almost fullIf you have been a victim of the "Application database is full" error on your webOS device, you know what a devastating issue this can be. If you have not seen this error, consider yourself lucky. The "application database" that is referenced here is not the USB drive on your device, but rather the internal database that was introduced in webOS 2.0 that manages a lot of data on your device. And if it gets full, there is no place to store any more data. You may get some advance warnings that will tell you to try deleting calendar entries, reducing the number of emails you save and even trying remove music, movies or documents from your USB drive, but most likely none of that will work and you will eventually be alerted that the database is full and you need to restart your device. And unfortunately, it doesn't make it clear that it will essentially perform an "erase apps and data" and log you out of your profile, requiring you to reactivate your device and log back in, also losing your application data and settings.  And to add insult to injury, you may log back in to your profile and still get that error once you activate it again.

Although there is no official fix from Palm/HP on this, you can always count on the homebrew community to get your back. In this case, it's Donald Kirker, webOS developer and former Intern for both HP and Palm. The problem stems from the fact that the internal partition that the database is saved to is only 135 MB big so it doesn't take a lot of data to fill this up. Donald's solution is to increase this partition by reducing the space available on the USB drive. To ensure that you don't run into this issue again, we will show you how you can extend this partition by 512 MB, but you can adjust that number up or down as needed. But be warned, you are messing around the underlying Operating System here and can cause some major problems on your device if something goes awry . You will also need to have Novacom installed on your computer and be familiar with using the Command Line. If you don’t have the webOS SDK installed on your computer to access the command line, you can always use webOS Quick Install and select "Tools" and then "Linux Commandline" to get access to it. Note that this is has only been tested on a Pre3 (including by this writer), but should work on any webOS 2.x device and possibly the TouchPad. However, before performing any actions, back up all of your data, both on your USB as well as any application data by using Save/Restore.

Please read through all of the steps and comments below before proceeding to make sure you understand exactly what will be required. Donald has also documented these steps on the WebOS Internals wiki as well, so you can also check that out to see if there have been any changes or updates to this fix.

Finally, before you begin, there are a few things that you need to check on. Access the linux commandline and type in "df -h" (without the quotes). Take note of the following information:

  • Total "Size" of /dev/mapper/store-media.
  • The "Used" size of /dev/mapper/store-media
  • The "Size" of /dev/mapper/store-cryptodb
  • The "Use%" of /dev/mapper/store-cryptodb

For the purposes on this tutorial, assume the total size of "store-media" is 12.8G. If it is different, make a note of that number because you will need to adjust the directions below.  Also, ensure that you have at least 600 MB free in "store-media", although I would recommend having at least a full gigabyte available before proceeding.  Finally, the total size of store-cryptodb should show as something around 135M, and the Use% will probably be very close to 100% if you are getting this error. This is what we will be updating and that use% should be much smaller when completed.

These first set of steps will shrink the media partition (your USB drive). You will want to take the total size of the "store-media" above and subtract 0.6G (which is the same as 600M). So, if you had 12.8G above, you will want to reduce it to 12.2G. If the number is different, adjust the directions below with that new number. Also, you may be asked to confirm one or more of the steps below, so make sure you type in "y" when asked:

pkill -SIGUSR1 cryptofs
umount /media/internal
resizefat -v /dev/mapper/store-media 12.2G
lvreduce -L 12.2G /dev/mapper/store-media
mount /media/internal
pkill -SIGUSR2 cryptofs

The final set of steps will increase the size of the database which should cause your database full error to go away. Once again, be sure to type in these steps exactly as is and confirm any actions if prompted

/sbin/stop mojodb
umount /dev/mapper/store-cryptodb
lvextend -L 512M /dev/mapper/store-mojodb
cryptsetup resize /dev/mapper/store-cryptodb
resize2fs -f -p /dev/mapper/store-cryptodb
mount /dev/mapper/store-cryptodb
/sbin/start mojodb

Do a full reboot of your device (not just a luna restart). Once it is reloaded, open up the linux commandline again and run another "df -h". You should now see much larger total size of /dev/mapper/store-cryptodb and the Use% should be much smaller. If it was done correctly, you should also no longer see the "Database full" error any more.

If you mess something up, you can always run a webOS Doctor to reset any actions you have taken, unlike running a "Full Erase" or an "Erase Apps and Data" which should not affect these changes.  Therefore, if you have already had to reset your device because of this error, we would recommend the following actions to cleanly restore your device with this fix.

  1. Perform a webOS Doctor on your device to reset it to factory settings
  2. Either log into your profile or bypass activation to gain access to webOS. If you log in to your profile, go into Software Manager immediately upon activation and "pause" the app downloads
  3. Perform the fix above
  4. After you reset your device, as per the final step of the directions, go into Device Info - Reset Options - Erase Apps and Data. This will reset your device again back to the activations screen.
  5. Log into your Profile and redownload all your apps and restore all your data as necessary

Donald is working on an easier solution that may not involve as much command line expertise, but for now, this works quite well and all you need to sacrifice is some space on your USB drive.

Source: WebOS Internals wiki; Thanks to Donald Kirker for these steps!

5
Your rating: None Average: 5 (1 vote)

30 Comments

thanks...nice tip

I've been reading postings about this warning and wondering why I haven't experienced it yet....the amount of use and data on my pre2 had me worried lately...

Question... Should I wait for the warning first?

I have 7.5GB free space left on my USB so would sooner be better than later

as for the internal partition size problem does it make any difference that I always tend to manage my bits and bytes on all my devices by habit but in turn have a huge amount of apps calendar and text messages on my pre2

Doesn't webOS 1.4.5 also use cryptoDB? How come I've never filled mine up yet?

I *think* it might. If you dig through some of the cryptofs startup code, there is stuff to check the partition layout and migrate data from one partition to another. It changed going between OS versions. I *think* that was between 1.4.5 and 2.0. I noticed this was a serious error when I upgraded my Verizon Pre Plus to 2.0.1. I was immediately (within a week) hit with the error. I finally had it when my Pre3 started coughing up blood a few months ago.

I will probably be doing this to my TouchPads soon. But... I don't use them nearly as much as the phone.

thanks...nice tip

I've been reading postings about this warning and wondering why I haven't experienced it yet....the amount of use and data on my pre2 had me worried lately...

Question... Should I wait for the warning first?

I have 7.5GB free space left on my USB so would sooner be better than later

as for the internal partition size problem does it make any difference that I always tend to manage my bits and bytes on all my devices by habit but in turn have a huge amount of apps calendar and text messages on my pre2

I personally would do this before it is an issue. But, it depends on how comfortable you are with taking the risk of messing with the filesystem. From my experience, it isn't quite as dangerous as I am making it out to be, but there are people that don't understand that there is a risk.

I also want to create a patch that will prevent the device from forcing you to wipe your data.

If you do have a ton of text messages, I would be mindful. Most of that is stored in the database.

thanks you

I'm on the command line

root@Carlos Lomba Jr's Palm Pre:/#

when I type in df -h

I get a lot of data from multiple apps and percentages...totals.....can't seem to pinpoint the data I'm looking for??

They should be towards the top.

Very helpful. I haven't had this issue but did went through a tough time receiving new e-mails but not being able to read its content in both, my Touchpad and PreĀ³. Thing lasted about 3 weeks until I found out the Weeks Without E-mail - "Retrieving Email Text" thread and Rnp showed the way to go. Haven't got any issues since.
Maybe you could write something about this too.

cool.  got a link?

Timely advice, as just last night I got this message for the first time. Was wondering what to make of it.

Only if I saw this about 6 months ago...

Donald Kirker, you're a genius!

I'm really grateful you've come up with a solution for the "Application Database getting full" error.

if you can come up with a Patch that would be awesome.

Otherwise I'll try and find a quiet day to follow the detailed instructions above.

Cheers!!
:)

Hmmm....all goes smoothly for the media-shrinking phase.

However, when I enter the line "lvextend -L 512M /dev/mapper/store-mojodb", I get an error:

Extending logical volume mojodb to 512.00 MB
Insufficient free space: 46 extents needed, but only 1 available

My original numbers were similar to the ones used in the above example here. When I reboot and check the sizes now, the ./store-media Size is 12.0GB and Used is 10.0GB. The ./store-cryptodb is 135.0MB with 39% Used. And yes I realize this is quite low, but I guess I want to be safe than sorry.

It seems like I should be able to get the size increased, so I'm not sure why I'm getting errors after decreasing the media size.

What are the results to the following commands?

pvscan

pvdisplay

pvscan
PV /dev/mmcblk0p15 VG store lvm2 [14.39 GB / 8.00 MB free]
Total: 1 [14.39 GB] / in use: 1 [14.39 GB] / in no VG: 0 [0 ]

pvdisplay
--- Physical volume ---
PV Name /dev/mmcblk0p15
VG Name store
PV Size 14.41 GB / not usable 22.66 MB
Allocatable yes
PE Size (KByte) 8192
Total PE 1842
Free PE 1
Allocated PE 1841

How about lvscan ? (which I guess would be more appropriate, since the logical volume is what we are editing)

lvscan
ACTIVE '/dev/store/root' [568.00 MB] inherit
ACTIVE '/dev/store/var' [64.00 MB] inherit
ACTIVE '/dev/store/update' [16.00 MB] inherit
ACTIVE '/dev/store/log' [24.00 MB] inherit
ACTIVE '/dev/store/mojodb' [144.00 MB] inherit
ACTIVE '/dev/store/filecache' [136.00 MB] inherit
ACTIVE '/dev/store/media' [12.96 GB] inherit
ACTIVE '/dev/store/swap' [504.00 MB] inherit

Are you sure that these commands executed properly?

pkill -SIGUSR1 cryptofs
umount /media/internal
resizefat -v /dev/mapper/store-media 12.2G
lvreduce -L 12.2G /dev/mapper/store-media
mount /media/internal
pkill -SIGUSR2 cryptofs

According to the lvscan, /dev/store/media is still at 12.96GB and wasn't reduced. You probably don't need to reduce it to 12.0 or 12.2, 12.3 or 12.4 is probably fine. The key is to make sure that resizefat AND lvreduce complete successfully. One or both should prompt you that you are reducing a filesystem, and ask if you want to continue.

Donald, thank you for this brilliant workaround and your suggestions to get this working for me.

As it turns out...I'm just a freakin' idiot. I SWEAR I followed your amazingly simple instructions...and yet when I went through it again, it worked perfectly. And as you mentioned, I do NOT remember a prompt asking me to continue the first time I did it. Did I skip a line? Enter it incorrectly? I have no idea, but it worked just fin when I did it a second time. Sigh...

Anyway, thank you again for the great fix!

will this amount to s permanent fix or just take the device vastly longer to fill up?

pretty sweet so far tho cheers.

Right now, it will take longer. Hopefully something to the magnitude of 100 years. :P But, that is an untested number, so don't quote me on it.

My goal is to do something like what the app storage does. It shares a partition with your USB one. You cannot access the contents of the partition by opening it up on your computer, but the space is there. If you run your USB/media partition down to no free space, it will cause a problem for applications. But, you have more control over fixing it. That is my hope.

WOW, thank you!! I can finally move back to my Pre3 after a few months of using my Veer...
Much appreciated! And great timing! I just charged my Pre3 last night!

so there's no /dev/mapper/store-cryptodb on my pre2... still getting the 'application full' warning.

I can shrink the partition but can't increase the application database since the cryptodb folder isn't there.

What now?

can you post the entire output of "df -h" at the forum thread? http://forums.webosnation.com/webos-discussion/279825-application-database-almost-full-8.html

Pre 2 has dev/mapper/store-mojodb instead. I followed the commands with this replaced for cryptodb and and seemed to work. No more stupid error!

oh no! i rebooted my phone and it's taking forever on the hp logo! after all this time this error starts to pop up? did something get changed?

can this be done after my phone is stuck on the hp logo?

Oh well, couldn't wait any longer... I did a meta-doctor to my Sprint/Verizon Franken Pre2, but all my data wasn't wiped out. **whew**

Followed all the commands as listed, did get an error when I did the umount /media/internal, said it is busy, but I continued on with all the rest of the commands, no errors encountered.

Everything worked fine, I hope 1G isn't overkill :D

Since I had to do a meta-doctor, waiting for everything to reload, of course I'll have to reinstall Preware & all my patches. No biggie....(and Sprint Navigation, ugh)

So, it does work on a Pre2, a Sprint Franken Pre2.

wahey - just followed the instructions above and hey presto I've not seen the "Application database getting full" message!!

big thank you, Donald!

Hope a patch can be released one day, Donald :)

Thanks for advice. My Pre 2 is going through this irritating situation. The file names are not the same for Pre 2. Can you tell me what is the equivalent file names for Pre2?

I did it yesterday on a Pre2, it worked, no idea how, but it worked...