dism restorehealth error 0x800f081f fix

my pc was having some weird issues so I found instructions to do the sfc /scannow and dism commands that should check and repair the core system files.

The directions I found online had me run sfc /scannow first, followed by a few dism commands, and then the dism /Restorehealth command at the end. Everything worked until this last step, where it would error without being able to find the source. It’s supposed to pull the source files directly from windows update, so this was odd. digging deeper led me down a path of downloading an iso of windows 10, and extracting some install.esd and try to use it as a source. Same problem. Then tried converting the install.esd into an install.wim. Same problem again.

After banging my head on this and spending more time than I should, I ran across one small post online about running the commands in a certain order to make it work. It was so simple I assumed it wouldn’t work, but why not… tried everything else.

So this is what I ran to FINALLY get my RestoreHealth dism operation to work- from an admin elevated command prompt run these three commands in this order:

dism.exe /online /Cleanup-Image /StartComponentCleanup

sfc /scannow

dism.exe /online /Cleanup-Image /RestoreHealth

At least for me, this was the magical order. I’m logging it here in case I need it again someday.


PHP on Windows, IIS, FastCGI results in MySql Sleeping Connections and Too Many Connections error

Not long ago we moved a wordpress based website from an ovh account to a windows server we already had running other things. (Nothing against OVH, just no point in having another server when we have excess already). We’ve run a number of wordpress installs on IIS and Windows, and the FastCGI implementation seems to work really well.
We started having occasional outages with the site after about a week or so, the error being “too many database connections open”. I initially thought this was being caused by an API call the site makes to a service, and that the api might be experiencing slowdowns causing the site to sit too long with open db connections and causing this issue. But eventually this was ruled out.

Mysql was showing a lot of “sleeping” connections to the database, so it looked like something was opening a lot of connections but not closing them. This is usually not an issue with Mysql and php because the connections are auto-closed at the end of each request.

BUT- when you run FastCGI on windows and IIS, part of the “fast” portion is that the service doesn’t actually end the whole process after every request- the service keeps running and waiting for the next page request to process. As a result apparently FastCGI will keep open any database connections that are now explicitly closed, until they time out some time later. So if you only have a few connections being made, your server will probably be able to keep creating them and they will expire in time for the server to not run out of resources, but in instances where it cannot keep up, your site will go down and start showing the dreaded “too many database connections” error page.

Note that the wordpress site itself doesn’t have this issue- the problem I only ran into with some custom php code that have been added onto a wordpress site. If this code were to use the correct wordpress database access methods instead of the hard coded ones, it would have operated fine as well.

Lesson- explicitly close your mysql connections in custom php code, or use the wordpress database access classes instead of your own. It might not be a problem usually, but this will cause server crashes in instances where the code is installed on Windows, IIS, and FastCGI.

Home Raising in Houston, after Harvey

Update- this link should have some options for raising your house or home in Houston- Houston Home Raising

Raising your home further above the ground is something I just heard of in the aftermath of Hurricane Harvey in Houston Texas. It’s not inexpensive, but apparently there are actual options for this, including raising a house that is on a slab (pier and beam can obviously be raised without nearly as much effort). I’m researching this more and will be adding more info on Home Raising in Houston once I find more info.

I’m also curious if future home builders in the region will be considering using a “stilt home” design to raise the house much further above ground level. These designs are popular in truly coastal towns such as Galveston, where storm surge can easily raise water well into where the first story of the house would normally be. This design would be a bit extreme (and odd looking) to use much further inland, but a hybrid of the design might make sense- especially in 2 and 3 story houses, perhaps the first floor can be water hardened in such a way that flooding has minimal impact on the house and it can be back in action quickly. Researching this as well.