That sucked...
Free time, a nagging error, and almost catastrophic results. How not to spend a day off.
Alas, sometimes, a "quick" fix really turns into a shitty day.
This is going to be a whine about technology, and someone who knows just enough to be dangerous[1] who about screwed the pooch.
A few months back, the update of the underlying system that this publication runs on, Ghost, had a major update. That update necessitated the upgrading of one of the components, node.js.[2] so I followed the instructions and upgraded from 18.x to 22.18.0 (a long term stable version).
Alas, being a bit of a spaz, I left some remnants of the old version, and every time I went to do a routine update, I got a warning that there was an old version.
Since I am taking a week off of work, I figured this would be an easy thing for me to fix. All the recommendations I researched recommended that I move to the nvm (nodes version manager) system to make it easier and intuitive to manage.
So, I stripped out the old stuff, added the nvm package, and followed the directions to get the version I needed up and running.
And it fucking barfed on me.
Suddenly, I had two non-functioning publications, and a headache that was killing me.
I got the original version of Node.js installed. No dice.
I rebuilt the system. No dice.
I went to the systemd services descriptions. No dice.
I was poking around the log files, and it was not very helpful. I was getting error 203 thrown, and searching the internet didn't help one iota.
I am going to admit that I was a bit chuffed, and about this close to just saying "fuck it" and just pulling it all down. (this close -><-)
What was the problem?
Turns out that nvm maintains the node versions in the user's home directory, and no matter how I set up the permissions, the systemd daemon couldn't execute the runtime file.
The fix was somewhat straightforward, once I figured that out.
- I stripped the nvm bits out.
- I reinstalled the original nodejs package and defined the version I wanted.
- I edited the systemd service files with the new location.
- I had to force systemd to reindex (that took some sleuthing in the logfiles)
- I had to force a new update to make sure that the underlying ghost system was all copacetic.
Fingers crossed, and it started up. Both properties.
And finally no more node version warnings being thrown.
Final thoughts
I do this for fun, but I have to admit that the past 24 hours has been super stressful and frustrating. All caused by my rash impulsive actions.
I do need to turn on the backups so if I do decide to roll up my sleeves in the future, I can go back to where I was.
I am my own worst enemy...
1 - that would be me...
2 - node.js is a pretty sophisticated framework and package manager that is quite useful.