(Docker) Ghost crashes when uploading photos on one machine but not the other

Hey, I installed ghost in two machines today using docker run -d --name some-ghost -e NODE_ENV=development -e url=http://localhost:3001 -p 3001:2368 ghost on both. one is my laptop running Fedora-Workstation 39 and it is working flawlessly! The other is a container on my ProxMox install running the almost identical Fedora-Server 38, however, this install appears to run fine until I try to change my user profile photo (or any other photo for that matter)… almost the same OS and the same command in the same docker… anyone have any idea what is happening??? there is no Proxies or certs, it is just on my local network as http right now. I would assume that is where the issue lies but the same configuration appears to work on my laptop…

I also have aready read this

and here is a copy of the terminal process I used and the error logs (the "#"s are the terminal prompts not comments):

[root@ghost ~]# docker run -d --name ghost -e NODE_ENV=development -e url=http://localhost:3001 -p 3001:2368 ghost
c6dd71126dcc2fde2d66b86821ed0144c17f06997f67ce56a7fd01c1597d567e
[root@ghost ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
[root@ghost ~]# docker logs ghost
[2024-01-29 04:34:54] INFO Ghost is running in development...
[2024-01-29 04:34:54] INFO Listening on: :::2368
[2024-01-29 04:34:54] INFO Url configured as: http://localhost:3001/
[2024-01-29 04:34:54] INFO Ctrl+C to shut down
[2024-01-29 04:34:54] INFO Ghost server started in 3.106s
[2024-01-29 04:34:55] WARN Database state requires initialisation.
[2024-01-29 04:34:56] INFO Creating table: newsletters
[2024-01-29 04:34:57] INFO Creating table: posts
[2024-01-29 04:34:57] INFO Creating table: posts_meta
[2024-01-29 04:34:57] INFO Creating table: users
[2024-01-29 04:34:57] INFO Creating table: posts_authors
[2024-01-29 04:34:57] INFO Creating table: roles
[2024-01-29 04:34:57] INFO Creating table: roles_users
[2024-01-29 04:34:57] INFO Creating table: permissions
[2024-01-29 04:34:57] INFO Creating table: permissions_users
[2024-01-29 04:34:57] INFO Creating table: permissions_roles
[2024-01-29 04:34:57] INFO Creating table: settings
[2024-01-29 04:34:57] INFO Creating table: tags
[2024-01-29 04:34:57] INFO Creating table: posts_tags
[2024-01-29 04:34:57] INFO Creating table: invites
[2024-01-29 04:34:57] INFO Creating table: brute
[2024-01-29 04:34:58] INFO Creating table: sessions
[2024-01-29 04:34:58] INFO Creating table: integrations
[2024-01-29 04:34:58] INFO Creating table: webhooks
[2024-01-29 04:34:58] INFO Creating table: api_keys
[2024-01-29 04:34:58] INFO Creating table: mobiledoc_revisions
[2024-01-29 04:34:58] INFO Creating table: post_revisions
[2024-01-29 04:34:58] INFO Creating table: members
[2024-01-29 04:34:58] INFO Creating table: products
[2024-01-29 04:34:58] INFO Creating table: offers
[2024-01-29 04:34:58] INFO Creating table: benefits
[2024-01-29 04:34:58] INFO Creating table: products_benefits
[2024-01-29 04:34:58] INFO Creating table: members_products
[2024-01-29 04:34:58] INFO Creating table: posts_products
[2024-01-29 04:34:58] INFO Creating table: members_created_events
[2024-01-29 04:34:58] INFO Creating table: members_cancel_events
[2024-01-29 04:34:59] INFO Creating table: members_payment_events
[2024-01-29 04:34:59] INFO Creating table: members_login_events
[2024-01-29 04:34:59] INFO Creating table: members_email_change_events
[2024-01-29 04:34:59] INFO Creating table: members_status_events
[2024-01-29 04:34:59] INFO Creating table: members_product_events
[2024-01-29 04:34:59] INFO Creating table: members_paid_subscription_events
[2024-01-29 04:34:59] INFO Creating table: labels
[2024-01-29 04:34:59] INFO Creating table: members_labels
[2024-01-29 04:34:59] INFO Creating table: members_stripe_customers
[2024-01-29 04:34:59] INFO Creating table: subscriptions
[2024-01-29 04:34:59] INFO Creating table: members_stripe_customers_subscriptions
[2024-01-29 04:34:59] INFO Creating table: members_subscription_created_events
[2024-01-29 04:34:59] INFO Creating table: offer_redemptions
[2024-01-29 04:34:59] INFO Creating table: members_subscribe_events
[2024-01-29 04:34:59] INFO Creating table: donation_payment_events
[2024-01-29 04:34:59] INFO Creating table: stripe_products
[2024-01-29 04:34:59] INFO Creating table: stripe_prices
[2024-01-29 04:34:59] INFO Creating table: actions
[2024-01-29 04:34:59] INFO Creating table: emails
[2024-01-29 04:34:59] INFO Creating table: email_batches
[2024-01-29 04:34:59] INFO Creating table: email_recipients
[2024-01-29 04:35:00] INFO Creating table: email_recipient_failures
[2024-01-29 04:35:00] INFO Creating table: tokens
[2024-01-29 04:35:00] INFO Creating table: snippets
[2024-01-29 04:35:01] INFO Creating table: custom_theme_settings
[2024-01-29 04:35:01] INFO Creating table: members_newsletters
[2024-01-29 04:35:01] INFO Creating table: comments
[2024-01-29 04:35:01] INFO Creating table: comment_likes
[2024-01-29 04:35:01] INFO Creating table: comment_reports
[2024-01-29 04:35:01] INFO Creating table: jobs
[2024-01-29 04:35:01] INFO Creating table: redirects
[2024-01-29 04:35:01] INFO Creating table: members_click_events
[2024-01-29 04:35:01] INFO Creating table: members_feedback
[2024-01-29 04:35:01] INFO Creating table: suppressions
[2024-01-29 04:35:01] INFO Creating table: email_spam_complaint_events
[2024-01-29 04:35:01] INFO Creating table: mentions
[2024-01-29 04:35:01] INFO Creating table: milestones
[2024-01-29 04:35:01] INFO Creating table: temp_mail_events
[2024-01-29 04:35:01] INFO Creating table: collections
[2024-01-29 04:35:01] INFO Creating table: collections_posts
[2024-01-29 04:35:01] INFO Creating table: recommendations
[2024-01-29 04:35:01] INFO Creating table: recommendation_click_events
[2024-01-29 04:35:01] INFO Creating table: recommendation_subscribe_events
[2024-01-29 04:35:02] INFO Model: Collection
[2024-01-29 04:35:02] INFO Model: Product
[2024-01-29 04:35:02] INFO Model: Newsletter
[2024-01-29 04:35:02] INFO Model: Tag
[2024-01-29 04:35:02] INFO Model: Permission
[2024-01-29 04:35:03] INFO Model: Post
[2024-01-29 04:35:05] INFO Model: Integration
[2024-01-29 04:35:05] INFO Relation: Role to Permission
[2024-01-29 04:35:06] INFO Relation: Post to Tag
[2024-01-29 04:35:07] INFO Database is in a ready state.
[2024-01-29 04:35:07] INFO Ghost database ready in 15.663s
[2024-01-29 04:35:17] INFO Adding offloaded job to the queue
[2024-01-29 04:35:17] INFO Scheduling job mentions-email-report at 28 15 * * * *. Next run on: Mon Jan 29 2024 05:15:28 GMT+0000 (Coordinated Universal Time)
[2024-01-29 04:35:18] INFO Ghost URL Service Ready in 26.5s
[2024-01-29 04:35:18] INFO Adding one-off job to queue with current length = 0 called 'members-migrations'
[2024-01-29 04:35:18] INFO Stripe not configured - skipping migrations
[2024-01-29 04:35:18] INFO Adding offloaded job to the queue
[2024-01-29 04:35:18] INFO Scheduling job clean-expired-comped at 9 52 0 * * *. Next run on: Tue Jan 30 2024 00:52:09 GMT+0000 (Coordinated Universal Time)
[2024-01-29 04:35:18] INFO Adding offloaded job to the queue
[2024-01-29 04:35:18] INFO Scheduling job clean-tokens at 23 29 11 * * *. Next run on: Mon Jan 29 2024 11:29:23 GMT+0000 (Coordinated Universal Time)
[2024-01-29 04:35:19] INFO Ghost booted in 27.311s
[2024-01-29 04:35:19] INFO Adding offloaded job to the queue
[2024-01-29 04:35:19] INFO Scheduling job update-check at 24 54 7 * * *. Next run on: Mon Jan 29 2024 07:54:24 GMT+0000 (Coordinated Universal Time)
[2024-01-29 04:35:19] INFO Running milestone emails job on Mon Jan 29 2024 04:35:24 GMT+0000 (Coordinated Universal Time)
[2024-01-29 04:36:37] INFO "GET /ghost/" 200 535ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/vendor-0ede59da8efb5e28fa929557f7ff7154.css" 304 12ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/ghost-0704a125141af505d40c5f71e84f33ab.css" 304 14ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/vendor-6b83da0c6e6fede335947219c59e1543.js" 304 3ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/chunk.143.d41a3a112d0cf7035db0.js" 200 46ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/chunk.664.0bd9e83a6b03130112ae.js" 304 2ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/ghost-971615b195b524bf97f678a350865195.js" 304 8ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/videos/logo-loader-d91f93ba1dbf0f52a22815b5a571bd31.mp4" 206 39ms
[2024-01-29 04:36:37] INFO "GET /ghost/assets/fonts/Inter-roman.var-66c6e40883646a7ad993108b2ce2da32.woff2" 304 9ms
[2024-01-29 04:36:40] ERROR "GET /ghost/api/admin/users/me/?include=roles" 403 2535ms

Authorization failed

"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."

Error ID:
    fefba7e0-be5f-11ee-b84e-bf1c495c370a

----------------------------------------

NoPermissionError: Authorization failed
    at authorizeAdminApi (/var/lib/ghost/versions/5.76.2/core/server/services/auth/authorize.js:33:25)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/5.76.2/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/5.76.2/node_modules/express/lib/router/route.js:144:13)
    at authenticate (/var/lib/ghost/versions/5.76.2/core/server/services/auth/session/middleware.js:28:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

[2024-01-29 04:36:40] INFO "GET /ghost/api/admin/site/" 200 9ms
[2024-01-29 04:36:40] ERROR "GET /ghost/api/admin/users/me/?include=roles" 403 7ms

Authorization failed

"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."

Error ID:
    ff13c3c0-be5f-11ee-b84e-bf1c495c370a

----------------------------------------

NoPermissionError: Authorization failed
    at authorizeAdminApi (/var/lib/ghost/versions/5.76.2/core/server/services/auth/authorize.js:33:25)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/5.76.2/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/5.76.2/node_modules/express/lib/router/route.js:144:13)
    at authenticate (/var/lib/ghost/versions/5.76.2/core/server/services/auth/session/middleware.js:28:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

[2024-01-29 04:36:40] INFO "GET /ghost/api/admin/site/" 200 3ms
[2024-01-29 04:36:40] INFO "GET /ghost/api/admin/authentication/setup/" 200 22ms
[2024-01-29 04:36:40] INFO "GET /ghost/api/admin/authentication/setup/" 200 10ms
[2024-01-29 04:36:40] INFO "GET /ghost/assets/img/logos/orb-black-1-32b72766be2164fdea6ab2565fb1c137.png" 304 2ms
[2024-01-29 04:36:41] INFO "GET /ghost/assets/admin-x-settings/admin-x-settings.js?v=61310103fc" 304 1ms
[2024-01-29 04:36:41] INFO "GET /ghost/assets/admin-x-settings/index-d65cac5f.mjs" 304 1ms
[2024-01-29 04:37:03] INFO Adding one-off job to queue with current length = 0 called 'sendWebmentions'
[2024-01-29 04:37:03] INFO PostEditedEvent received, updating post 65b72af72f68b500016f6ce7 in matching collections
[2024-01-29 04:37:03] INFO Adding one-off job to queue with current length = 0 called 'sendWebmentions'
[2024-01-29 04:37:04] INFO "POST /ghost/api/admin/authentication/setup/" 201 1684ms
[2024-01-29 04:37:04] WARN Invalid from address used for sending emails: noreply@localhost
[2024-01-29 04:37:04] ERROR Failed to send email. Reason: Sending failed.

Failed to send email. Reason: Sending failed.

"Unable to send welcome email, your site will continue to function."
"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."

Error ID:
    0d21a270-be60-11ee-b84e-bf1c495c370a

----------------------------------------

Error: Sending failed
    at createMailError (/var/lib/ghost/versions/5.76.2/core/server/services/mail/GhostMailer.js:105:12)
    at DirectMailer.<anonymous> (/var/lib/ghost/versions/5.76.2/node_modules/nodemailer-direct-transport/lib/direct-transport.js:157:41)
    at DirectMailer.<anonymous> (/var/lib/ghost/versions/5.76.2/node_modules/nodemailer-direct-transport/lib/direct-transport.js:201:22)
    at QueryReqWrap.callback (/var/lib/ghost/versions/5.76.2/node_modules/nodemailer-direct-transport/lib/direct-transport.js:448:44)
    at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/callback_resolver:45:10)

[2024-01-29 04:37:04] INFO "POST /ghost/api/admin/session" 201 707ms
[2024-01-29 04:37:04] INFO "GET /ghost/api/admin/users/me/?include=roles" 200 78ms
[2024-01-29 04:37:04] INFO "GET /ghost/api/admin/config/" 200 20ms
[2024-01-29 04:37:05] INFO "GET /ghost/api/admin/tiers/?filter=type%3Apaid%2Bactive%3Atrue&limit=all" 200 78ms
[2024-01-29 04:37:05] INFO "GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations%2Crecommendations" 200 94ms
[2024-01-29 04:37:05] INFO "GET /ghost/assets/ghost-dark-6ad8cac49f53901201e9210bc1999eeb.css" 304 2ms
[2024-01-29 04:37:05] INFO "GET /ghost/assets/koenig-lexical/koenig-lexical.umd.js?v=a9a58f16a8" 304 2ms
[2024-01-29 04:37:05] INFO "GET /ghost/api/admin/themes/active/" 200 86ms
[2024-01-29 04:37:05] INFO "GET /ghost/api/admin/notifications/" 200 123ms
[2024-01-29 04:37:05] INFO "GET /ghost/api/admin/themes/" 200 121ms
[2024-01-29 04:37:07] INFO "GET /ghost/assets/img/user-image-639a88b784fb5f10964be8b975ca9fdf.png" 304 3ms
[2024-01-29 04:37:07] INFO "GET /ghost/assets/img/community-background-3f501ff1d764d0cb81f7c2cbacfc6503.jpg" 304 16ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/stats/member_count/" 200 468ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/stats/referrers/" 200 523ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/members/?order=id&limit=1&page=1&include=newsletters%2Clabels" 200 607ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/members/?filter=last_seen_at%3A%3E2024-01-21T09%3A00%3A00.000Z&order=id&limit=1&page=1&include=newsletters%2Clabels" 200 608ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/members/?filter=last_seen_at%3A%3E2023-12-29T09%3A00%3A00.000Z&order=id&limit=1&page=1&include=newsletters%2Clabels" 200 611ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/members/?filter=newsletters.status%3Aactive%2Bstatus%3A-free%2Bemail_disabled%3A0&order=id&limit=1&page=1&include=newsletters%2Clabels" 200 600ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/members/?filter=newsletters.status%3Aactive%2Bstatus%3Afree%2Bemail_disabled%3A0&order=id&limit=1&page=1&include=newsletters%2Clabels" 200 584ms
[2024-01-29 04:37:07] INFO "GET /ghost/api/admin/posts/?formats=mobiledoc%2Clexical&limit=5&filter=status%3A%5Bpublished%2Csent%5D&order=published_at%20desc" 200 684ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/site/" 200 3ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/config/" 200 75ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/settings/?group=site%2Ctheme%2Cprivate%2Cmembers%2Cportal%2Cnewsletter%2Cemail%2Camp%2Clabs%2Cslack%2Cunsplash%2Cviews%2Cfirstpromoter%2Ceditor%2Ccomments%2Canalytics%2Cannouncement%2Cpintura%2Cdonations" 200 152ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/users/me/?include=roles" 200 152ms
[2024-01-29 04:37:11] INFO "GET /ghost/assets/admin-x-settings/modals-2805e75e.mjs" 304 2ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/tiers/" 200 315ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/roles/?limit=all" 200 424ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/invites/" 200 451ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/recommendations/?include=count.clicks%2Ccount.subscribers&order=created_at+desc&limit=5" 200 449ms
[2024-01-29 04:37:11] INFO "GET /ghost/api/admin/incoming_recommendations/?limit=5&order=created_at+desc" 200 463ms
[2024-01-29 04:37:12] INFO "GET /ghost/null/" 302 5ms
[2024-01-29 04:37:12] INFO "GET /ghost/api/admin/stats/referrers/" 200 488ms
[2024-01-29 04:37:12] INFO "GET /ghost/api/admin/newsletters/?include=count.active_members%2Ccount.posts&limit=50" 200 507ms
[2024-01-29 04:37:12] INFO "GET /ghost/api/admin/users/?limit=100&include=roles" 200 598ms
[2024-01-29 04:37:12] INFO "GET /ghost/" 200 218ms
[2024-01-29 04:37:12] INFO "GET /ghost/assets/admin-x-settings/index-c54bcc5d.mjs" 200 343ms
[2024-01-29 04:37:12] INFO "GET /ghost/api/admin/integrations/?include=api_keys%2Cwebhooks" 200 876ms
[2024-01-29 04:37:12] INFO "GET /ghost/api/admin/users/me/token/" 200 796ms
[root@ghost ~]# 

Are you sure these are the relevant logs?

I have just tried this myself (running Ghost in docker) and got this log:

[2024-01-29 05:45:22] INFO "POST /ghost/api/admin/images/upload/" 201 1099ms

I don’t see that route being called in your logs at all, which makes me wonder whether there are some logs missing (also, since there is no indication that Ghost crashed from the logs).

Yes, in the cited the dev there was having the same issue. as you can see from the terminal commands just above the logs, the docker container was running then in the next command (docker ps) it shows that nothing is running (that is the only docker ct on this machine). the only change between those two commands is that I logged in and tried to change my profile photo. about 5-6 seconds later I got the “unable to reach the server” notice on ghost. :confused: which leaves me to wonder, why??

This is what the logs from my laptop (Fedora-desktop 39) look like…
not sure why my server is any different… it is running as a ProxMox LXC so maybe that is messing it up some how?

There may also be a problem with permissions to folders and files.
Make sure you run ghost as a user with the appropriate permissions, I haven’t used fedora, but my docker image works perfectly and on several instances of the same image in Debian 11.

So the only problem you have is a problem with your configuration…

Usually, when Ghost (or any application, really) crashes, it should give you some kind of indication. An error code or anything.

In your case, the log doesn’t even show that you accessed the route for uploading an image.

I am completely unfamiliar with ProxMox LXC, but I still think there are some logs missing.

I have had many Ghost docker container crash on me in the last few months, and they always told me the reason in the Docker logs – so, this is odd.

The last line in your log basically just indicates that Ghost verified that you signed in.

I’d suggest you try uploading the profile picture again and run the log command? See how far it logs. Which routes are visible in the logs. Do they correspond with what you’re trying to do? When does it cut out?

It happens when you want to write data… try mapping an external directory for Ghost’s /content directory. I use docker compose and have…

volumes: 
      - /home/magnus/ghost-content:/var/lib/ghost/content

…so Ghost will write & read the /content directory “outside” the docker environment/volume. Also, will make your data persistent when updating of the docker image - added bonus.

1 Like