TryGhost / TryGhost/docker-library-ghost

Log rotation

Open
#273 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Request
Dominant language
Shell
Stars
796
Forks
319
Avg merge
7h 42m
Merged PRs (30d)
6

Description

Hi,
It would be great to have logrotate preconfigured, since /var/lib/ghost/content/logs folder is ever-growing. That cause issues when deploying to k8s, since pod would eventually crash:

[ghost-56f4c644f9-gps8f ghost]  [2021-11-24 15:46:52] INFO Ghost server started in 0.512s
[ghost-56f4c644f9-gps8f ghost]  events.js:377
[ghost-56f4c644f9-gps8f ghost]        throw er; // Unhandled 'error' event
[ghost-56f4c644f9-gps8f ghost]        ^
[ghost-56f4c644f9-gps8f ghost]  
[ghost-56f4c644f9-gps8f ghost]  Error: ENOSPC: no space left on device, write
[ghost-56f4c644f9-gps8f ghost]  Emitted 'error' event on Logger instance at:
[ghost-56f4c644f9-gps8f ghost]      at WriteStream.onStreamError (/var/lib/ghost/versions/4.20.3/node_modules/bunyan/lib/bunyan.js:627:18)
[ghost-56f4c644f9-gps8f ghost]      at WriteStream.emit (events.js:400:28)
[ghost-56f4c644f9-gps8f ghost]      at emitErrorNT (internal/streams/destroy.js:106:8)
[ghost-56f4c644f9-gps8f ghost]      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
[ghost-56f4c644f9-gps8f ghost]      at processTicksAndRejections (internal/process/task_queues.js:82:21) {
[ghost-56f4c644f9-gps8f ghost]    errno: -28,
[ghost-56f4c644f9-gps8f ghost]    code: 'ENOSPC',
[ghost-56f4c644f9-gps8f ghost]    syscall: 'write'
[ghost-56f4c644f9-gps8f ghost]  }

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the repository's image packaging entry point and trace how /var/lib/ghost/content/logs is created and written. Check the Kubernetes deployment context and the reported ENOSPC failure to determine where rotation belongs. Done means the image has a documented, testable way to prevent unbounded log growth without filling the pod's storage.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes, shell
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.