forwardemail / forwardemail/forwardemail.net
[fix] forwardemail.net-selfhosted container launching with missing permissions
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 203
- PR merge metrics
- No merged PRs in 30d
Description
## Describe the bug
**OS version:** Debian 12
**Docker image:** ghcr.io/forwardemail/forwardemail.net-selfhosted:latest
**Description:** While following instructions for _Initial setup_ at [self-hosted guide](https://forwardemail.net/en/self-hosted), `docker compose` stage reported unhealthy containers and failed to complete the setup script.
## Actual behavior
`setup.sh` tail:
```
Spinning up necessary infrastructure...
Creating redis ... done
Creating sni-router ... done
Creating mongodb ... done
Creating bree ... done
Creating smtp ... done
ERROR: for web Container "b5abf5297e47" is unhealthy.
ERROR: for sqlite Container "b5abf5297e47" is unhealthy.
ERROR: for api Container "b5abf5297e47" is unhealthy.
ERROR: for smtp_bree Container "b5abf5297e47" is unhealthy.
ERROR: Encountered errors while bringing up the project.
```
Related container:
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b5abf5297e47 ghcr.io/forwardemail/forwardemail.net-selfhosted:latest "docker-entrypoint.s…" About a minute ago Up About a minute (unhealthy) smtp
```
Logs from container:
```
ℹ info SMTP server started
✖ error listen EACCES: permission denied :::465 {
err: {
stack: 'Error: listen EACCES: permission denied :::465\n' +
' at Server.setupListenHandle [as _listen2] (node:net:1886:21)\n' +
' at listenInCluster (node:net:1965:12)\n' +
' at doListen (node:net:2139:7)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:83:21)',
message: 'listen EACCES: permission denied :::465',
code: 'EACCES',
errno: -13,
syscall: 'listen',
address: '::',
port: 465,
is_server_error: true,
name: 'Error'
},
level: 'error',
app: {
name: 'forward-email',
version: '2.13.4',
node: 'v20.20.2',
environment: 'production',
hostname: 'smtp.example.com',
ip: '111.222.254.123',
pid: 1,
cluster: { isPrimary: true, isWorker: false, schedulingPolicy: 2 },
os: {
arch: 'x64',
cpus: [Array],
endianness: 'LE',
freemem: 1738362880,
priority: 0,
homedir: '/app',
hostname: 'smtp.example.com',
loadavg: [Array],
network_interfaces: [Object],
platform: 'linux',
release: '6.1.0-52-amd64',
tmpdir: '/tmp',
totalmem: 2587807744,
type: 'Linux',
uptime: 18776.21,
user: [Object],
version: '#1 SMP PREEMPT_DYNAMIC Debian 6.1.180-1 (2026-08-03)'
},
worker_threads: {
isMainThread: true,
resourceLimits: {},
threadId: 0,
workerData: null
}
}
}
Error: Operation `logs.countdocuments()` buffering timed out after 10000ms
at ValidationError.inspect (/app/node_modules/.pnpm/mongoose@6.13.8/node_modules/mongoose/lib/error/validation.js:50:26)
at formatValue (node:internal/util/inspect:833:19)
at inspect (node:internal/util/inspect:376:10)
at formatWithOptionsInternal (node:internal/util/inspect:2377:40)
at formatWithOptions (node:internal/util/inspect:2239:10)
at console.value (node:internal/console/constructor:350:14)
at console.warn (node:internal/console/constructor:383:61)
at /app/helpers/logger.js:429:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async pMapSeries (/app/node_modules/.pnpm/p-map-series@2.1.0/node_modules/p-map-series/index.js:9:15) {
errors: {
hash: ValidatorError: Operation `logs.countdocuments()` buffering timed out after 10000ms
at validate (/app/node_modules/.pnpm/mongoose@6.13.8/node_modules/mongoose/lib/schematype.js:1347:13)
at /app/node_modules/.pnpm/mongoose@6.13.8/node_modules/mongoose/lib/schematype.js:1328:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
properties: [Object],
kind: 'unique',
path: 'hash',
value: 'bd42351374',
reason: MongooseError: Operation `logs.countDocuments()` buffering timed out after 10000ms
at Timeout. (/app/node_modules/.pnpm/mongoose@6.13.8/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js:188:23)
```
## Expected behavior
A success message returned as stated in the guide.
## Steps to reproduce
Follow the [self-hosted guide](https://forwardemail.net/en/self-hosted) for _1. Initial setup_.
## Additional problems
Before this problem, the container also reported `Error: EACCES: permission denied, open '/app/ssl/privkey.pem'` and `Error: EACCES: permission denied, open '/app/ssl/dkim.key'`. These two problems was temporary resolved with `setfacl -m u:0:rw -m u:999:r` for each failed files.
Contributor guide
Research direction
Start with the self-hosted guide's Initial setup steps and the setup.sh entry point, then inspect the Docker Compose and container startup configuration related to port 465 and /app/ssl/privkey.pem and /app/ssl/dkim.key. Reproduce the unhealthy container and verify that setup completes with all containers healthy and the guide's success message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, javascript
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100