eph baum dot dev

← Back to blog

Me - Add An Admin, Ghost - Oh, Actually I'm Broken

Published on 01/29/2023 04:12 PM by Eph Baum

Featured Image

I have more than one instance of ghost running right now and I’m learning about the folly of trying to run multiple Ghost Blog instances from a SysAdmin perspective for sure. Maintaining these damn things isn’t challenging, but it’s also not simple either. And, of course, my current state is largely

My Own Fault™

I’ve been lazily handling these damn things, but it’s really time I should probably should probably architect myself a more organized solution.

For now, though, I have one instance that’s been plugging along just fine for a while, though it has been barking at me that it needs updated. It’s on the most recent minor version of 4 but it wants the next major version of 5.

And the obnoxiously obvious banner at the top as been in the way for a hot minute, I’ll be honest. But having recently (there’s another blog post I’m not even done writing about this sitting in my drafts already) done that upgrade on a different server, I’d been hoping to put it off just a little bit longer until I had more time to focus on the aforementioned orchestration plans.

Today, however, I tried to take the audacious step of adding another administrator. For my efforts I was given an “Unknown Error” message:

Unknown error - TypeError, cannot save invite. copyError is not a function

Which, frankly, isn’t very user friendly.

A quick DuckDuckGo search query netted nothing in English but one issue seemed to be similar enough.

A refresh of the page showed that something existed in the database because I could see a row on the page related to the invite.

Checking with the user I was inviting there had been no email, however.

Due to the fact that I’d made a few changes to this server since its inception and don’t recall with perfect clarity all the changes (because I haven’t been keeping the sorts of records I should out of laziness), I started poking around at config for the mailer and Mailgun settings as it seemed likely and I had a vague recollection of something similar on a different instance. I assumed there was an issue related to the settings I reset the Mailgun user password and updated the configuration and then did a restart of the instance.

That’s when I started getting 502: Bad Gateway from nginx.

So, now I’m on a journey I didn’t intend to take and mildly annoyed.

Restarting the whole server didn’t set things straight either.

Nginx logs say things like:

YYYY/MM/DD hh:mm:ss\[error\] nnn#nnn: *24 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: example.com, request: "GET /favicon.ico HTTP/2.0", upstream: "http://xxx.xxx.xxx.xxx:xxxx/favicon.ico", host: "example.com", referrer: "https://example.com/"

But when I check ghost status, I’m told:

Status: running (production)

Checking the usual suspects I’m immediately seeing that the port listed in the status does not match the port in the nginx logs

:lightbulb:

So, now at least I have something to look into

A quick check of the production.config.json tells me that Ghost is running on the port in its configuration.

A quick check of the nginx configuration file tells me that it’s definitely not looking for the same port.

I’m confused, but the difference is 1 and I’m forced to suspect that it somehow was updated during my last upgrade of the minor version, but I’m honestly baffled and suspect it’s possible I’ve forgotten something I did. Perhaps I even fat fingered the thing when I was updating that password, right?

No I need to get back to resolving that error when trying to add a user.

My current working theories are:

My current plan is to:

Retry the action, observe the behavior, check the logs

Bingo:

[2023-01-29 23:43:51] WARN Error sending email: Failed to send email. Reason: Sending failed. Please check your email settings and resend the invitation.
[2023-01-29 23:43:51] ERROR "POST /ghost/api/admin/invites/" 500 1156ms
NAME: EmailError
MESSAGE: Error sending email: Failed to send email. Reason: Sending failed. Please check your email settings and resend the invitation.

Which is followed by the stacktrace.

So, this error message is much clearer than what still appears in the browser:

Unknown error - TypeError, cannot save invite. copyError is not a function

Email settings issue confirmed :successkid:

I guess it’s time to dig into the mail settings, I suppose.

Ghost’s documentation for Mailgun showed a property that didn’t match what I had.

On my server, it was configured as:

"transport": "Direct"

while their documentation directs:

"transport": "SMTP"

A quick update of that property and a ghost restart and suddenly I was able to resend the email and all was at should be (expect that I still need to upgrade this site to the latest major version).

So, that’s how I lost an afternoon to Ghost- one of these days I’ll get things better orchestrated

Written by Eph Baum

  • Making Brutalist Design Accessible: A Journey in WCAG AA Compliance

    Making Brutalist Design Accessible: A Journey in WCAG AA Compliance

    How I transformed my brutalist blog theme to meet WCAG AA accessibility standards while preserving its vibrant, random aesthetic. Talking about contrast ratios, color theory, and inclusive design.

  • Building Horror Movie Season: A Journey in AI-Augmented Development

    Building Horror Movie Season: A Journey in AI-Augmented Development

    How I built a production web app primarily through 'vibe coding' with Claude, and what it taught me about the future of software development. A deep dive into AI-augmented development, the Horror Movie Season app, and reflections on the evolving role of engineers in the age of LLMs.

  • Chaos Engineering: Building Resiliency in Ourselves and Our Systems

    Chaos Engineering: Building Resiliency in Ourselves and Our Systems

    Chaos Engineering isn't just about breaking systems — it's about building resilient teams, processes, and cultures. Learn how deliberate practice strengthens both technical and human architecture, and discover "Eph's Law": If a single engineer can bring down production, the failure isn't theirs — it's the process.

  • Using LLMs to Audit and Clean Up Your Codebase: A Real-World Example

    Using LLMs to Audit and Clean Up Your Codebase: A Real-World Example

    How I used an LLM to systematically audit and remove 228 unused image files from my legacy dev blog repository, saving hours of manual work and demonstrating the practical value of AI-assisted development.

  • Migrating from Ghost CMS to Astro: A Complete Journey

    Migrating from Ghost CMS to Astro: A Complete Journey

    The complete 2-year journey of migrating from Ghost CMS to Astro—from initial script development in October 2023 to final completion in October 2025. Documents the blog's 11-year evolution, custom backup conversion script, image restoration process, and the intensive 4-day development sprint. Includes honest insights about how a few days of actual work got spread across two years due to life priorities.

  • 50 Stars - Puzzle Solver (of Little Renown)

    50 Stars - Puzzle Solver (of Little Renown)

    From coding puzzle dropout to 50-star champion—discover how AI became the ultimate coding partner for completing Advent of Code 2023. A celebration of persistence, imposter syndrome, and the surprising ways generative AI can help you level up your problem-solving game.