# Bookstack Known Issues

# 🐞 Known Issues During First Launch (EC2 from AWS Marketplace)

This document contains a list of known issues that may occur during the initial launch of the EC2 instance when deploying BookStack via AWS Marketplace. These behaviors are considered normal and self-recovering in most cases.


### **⚠️ 1. Transient DNF Cache Failures**

##### **Symptoms:**

• `Cloud-init` fails with messages like:

```bash
[Errno 2] No such file or directory: '/var/cache/dnf/.../*.rpm'
Failed to run module scripts-user
```

##### **Cause:**

• This issue is caused by a temporary inconsistency between metadata and actual RPM packages in Amazon Linux 2023 mirrors.

• It may also be triggered by race conditions within `cloud-init` (e.g., DNF downloads package, then cache becomes unavailable before install completes).

##### **Workaround:**

• The Auto Scaling Group will automatically replace the failed instance.

• On the second attempt, the packages are downloaded again and the process typically succeeds.

##### **Recommendation:**

• Add retry logic and DNF cache clearing in your <span class="s1">user-data</span>, such as:

```bash
dnf clean all
dnf makecache
retry dnf install -y ...
```

### **⚠️ 2. `cloud-init` Failure After SELinux Reboot**

##### **Symptoms:**

> ⚠️ On Amazon Linux 2023, the system may reboot automatically on first launch to apply SELinux settings.

> This may cause the initial cloud-init status to show as failed, even though the environment is ready.

##### **Log shows**:

```bash
Rebooting machine to apply SELinux kernel commandline setting
Failed to run module scripts-user
Ran 20 modules with 1 failures
```

##### **Workaround:**

• The system reboots automatically and continues working fine.

• No action is required — this is an expected behavior.

• **Optional**: Use the following `EC2AMI` parameter value: `/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64`.

### **⚠️ 3. Duplicate Welcome Message in Shell**

##### **Symptoms:**

```bash
sh-5.2$ sudo su - ec2-user
Last login: Tue Apr  8 08:03:38 UTC 2025 on pts/1
 Welcome to your EC2 instance!
-----------------------------
 Operating System: GNU/Linux
 Hostname: ip-172-31-7-183.ec2.internal
 Current Date and Time: Tue Apr  8 08:14:25 UTC 2025
-----------------------------
 Welcome to your EC2 instance!
-----------------------------
 Operating System: GNU/Linux
 Hostname: ip-172-31-7-183.ec2.internal
 Current Date and Time: Tue Apr  8 08:14:25 UTC 2025
```

##### **Cause:**

• The base AMI used by AWS during scanning includes pre-installed user-data scripts or messages, and this overlaps with your current <span class="s1">user-data</span>.

##### **Resolution:**

• **Ignore** — has no effect on functionality.

• **Optional**: Use the following `EC2AMI` parameter value: `/aws/service/ami-amazon-linux-latest/al2023-ami-kernel-default-arm64`.

### **⚠️ 4. EC2 Instance Logs Are Not Persisted to File**

##### **Symptoms:**

• File `<span class="s1">/var/log/journal/log-export.log</span>` is missing after instance launch.

##### **Cause:**

• The logging unit contains a misconfigured `<span class="s1">ExecStart</span>` command in the file: `/etc/systemd/system/journald-export.service`

##### **<span style="color: rgb(224, 62, 45);">Incorrect line:</span>**

```bash
ExecStart=/bin/bash -c "journalctl -f -o short-iso > tee -a /var/log/journal/log-export.log"
```

##### **<span style="color: rgb(22, 145, 121);">Correct line should be:</span>**

```bash
ExecStart=/bin/bash -c "journalctl -f -o short-iso > /var/log/journal/log-export.log"
```

##### **Resolution:**

```bash
sudo systemctl daemon-reload
sudo systemctl enable --now journald-export.service
sudo systemctl start journald-export.service
```

### **✅ Summary**

These issues do not indicate a failure of the product, but are a result of how `cloud-init`, Amazon Linux 2023, and Marketplace validation behave.

> 🔧 The duplicate welcome screen and missing EC2 instance logs are known issues and will be addressed in a future release.