SQLite Problems with Ghost on Azure

I just wanted to upgrade my blog from the ancient version 0.4.2 of Ghost to the brand spankin’ new 0.7 release. I followed the Ghost upgrade guidance, adjusting it to fit my build which deploys from GitHub to Azure Web Sites.

But after the deployment, neither the blog nor the admin console showed up. Just a blank, white screen. The favicon still showed up, so at least I had that going for me.

I went into the log files located at /LogFiles/Application to see what the most recent error was:

ERROR: Cannot find module 'D:\home\site\wwwroot\node_modules\sqlite3\lib\binding\node-v14-win32-ia32\node_sqlite3.node' 

Time to find out what’s really there. I used the Kudu system built into Azure WebSites and used the in-browser PowerShell tool. To get there, type this into your browser’s URL: https://yoursitename.scm.azurewebsites.net/DebugConsole/?shell=powershell (of course, you need to put your actual site name in there).

Once it loads, it looks something like this:

Screen shot of the PowerShell in-browser console using the Azure Kudu tool

I wanted to see what was actually installed for sqlite3. Turns out, I had a version of sqlite installed, but not the version that the new Ghost was expecting. I had node-v11-win32-ia32. I found a couple of ideas on the web, including a Stack Overflow Post that recommended explicitly declaring which version of Node I wanted to use. That didn’t do it, but a post by Marcin Krupiński at Frustrated Dev gave me a hint.

Krupiński’s post sounds identical to my problem, but my solution was different. He recommends explicitly rebuilding sqlite3 using the following command:

npm install sqlite3 --build-from-source --target_arch=ia32

I tried that, but got nowhere. In fact, after I ran that command, sqlite3 was just gone from the node_modules path.

At this point I simply did npm install sqlite3 in the wwwroot folder. It ended up installing the node-v14-win32-ia32 version. I restarted the site and all was well.

Will this solve your problem? No idea, but maybe it’ll at least give you something else to try.