> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/vi/ho-tro/troubleshooting.md).

# Khắc phục sự cố

{% hint style="info" %}
Nếu bạn đang sử dụng phiên bản cũ hơn, vui lòng dùng `sharelatex` thay vì `overleaf` trong tên đường dẫn.
{% endhint %}

<details>

<summary>Chạy Overleaf với hệ thống tệp NFS</summary>

Về mặt kỹ thuật, có thể gắn một hệ thống tệp NFS trong vùng chứa Overleaf, nhưng điều này không được khuyến nghị và có thể gây ra nhiều loại lỗi hiệu năng khác nhau.

Một lỗi thường gặp mà quá trình biên dịch thấy là:

```
EBUSY: resource busy or locked, unlink '/var/lib/overleaf/data/compiles/62f3d57bef7cf9005c364e75-62f3d57bef7cf9005c364e7a/.nfs573663533034825247625441'
```

Đặc biệt, chúng tôi khuyến cáo không dùng các hệ thống tệp được NFS hỗ trợ cho dữ liệu tạm thời, như các thư mục dùng cho dữ liệu biên dịch. Chúng tôi khuyên dùng một ổ đĩa scratch cục bộ, tốt nhất là SSD cục bộ, cho các thư mục sau.

Đối với `docker-compose` các thiết lập dựa trên docker-compose, chúng tôi đề xuất chỉ ghi đè bind-mount từ NFS, điều này tránh phải thay đổi các đường dẫn trong ứng dụng. Sau đây là một ví dụ về `docker-compose` đoạn cấu hình sử dụng một đĩa scratch được gắn tại `/scratch`:

{% code title="đoạn trích docker-compose" %}

```yaml
services:
  sharelatex:
    environment:
      SANDBOXED_COMPILES_HOST_DIR: /scratch/compiles/
    volumes:
      - nfs:/var/lib/overleaf/data
      - /scratch/cache/:/var/lib/overleaf/data/cache
      - /scratch/compiles/:/var/lib/overleaf/data/compiles
      - /scratch/output/:/var/lib/overleaf/data/output
      - /scratch/tmp/:/var/lib/overleaf/tmp
```

{% endcode %}

Không cần di chuyển bất kỳ tệp hiện có nào từ NFS sang vị trí mới sau khi cập nhật. Trình biên dịch LaTeX có thể tạo lại tất cả các tệp bằng cách chạy biên dịch đầy đủ một lần nữa.

Để biết thêm chi tiết, xem: <https://docs.overleaf.com/on-premises/support/troubleshooting#running-overleaf-with-an-nfs-filesystem>

</details>

<details>

<summary>Chạy Overleaf trên Windows hoặc macOS dẫn đến dịch vụ `mongo` không khởi động</summary>

Nếu bạn đang chạy Overleaf trên Windows hoặc macOS, thì `mongo` dịch vụ có thể không khởi động lại được, với lỗi:

{% code title="Ví dụ lỗi" %}

```
Không thể khởi động WiredTiger dưới bất kỳ phiên bản tương thích nào.
Lý do: 1: Không được phép thực hiện thao tác
```

{% endcode %}

Để tránh lỗi này, dữ liệu cần được lưu trong một volume thay vì một thư mục bind mount (xem `mongo` tài liệu hình ảnh để biết thêm chi tiết: <https://github.com/docker-library/docs/blob/master/mongo/content.md#where-to-store-data>). Để lưu dữ liệu bên trong các Docker volume được gắn trong các container MongoDB và Redis, hãy thêm phần sau vào `config/docker-compose.override.yml` (hãy tạo tệp này nếu nó chưa tồn tại):

{% code title="config/docker-compose.override.yml" %}

```yaml
volumes:
  mongo-data:
  redis-data:

services:
  mongo:
    volumes:
      - mongo-data:/data/db

  redis:
    volumes:
      - redis-data:/data
```

{% endcode %}

Để biết thêm thông tin, xem: <https://docs.overleaf.com/on-premises/support/troubleshooting#running-overleaf-on-windows-or-macos-results-in-the-mongoservice-not-starting>

</details>

<details>

<summary>Nâng cấp lên Redis 6.2 dẫn đến vòng lặp khởi động lại</summary>

Dùng `docker logs redis` lệnh để xuất một bản sao của nhật ký.

Nếu bạn thấy dòng `Fatal: Can't initialize Background Jobs`, toàn bộ đầu ra sẽ trông giống như sau:

{% code title="Ví dụ nhật ký Redis" %}

```
1:M 11 Feb 2024 15:19:22.609 # Server initialized
1:M 11 Feb 2024 15:19:22.609 # Fatal: Can't initialize Background Jobs.
1:C 11 Feb 2024 15:19:26.055 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
```

{% endcode %}

Điều này có thể liên quan đến phiên bản Docker hiện đang dùng. Cập nhật lên phiên bản >= 20.10.10 sẽ giải quyết được vấn đề này.

Để biết thêm thông tin, xem vấn đề upstream của Redis: <https://github.com/redis/redis/issues/12362>

Tham khảo: <https://docs.overleaf.com/on-premises/support/troubleshooting#upgrading-to-redis-6.2-results-in-a-restart-loop>

</details>

<details>

<summary>Hướng hiển thị sai của ảnh xem trước/ảnh thu nhỏ trong bộ sưu tập template</summary>

Đôi khi, các ảnh xem trước/ảnh thu nhỏ do Server Pro tạo ra có thể bị tạo sai hướng và cần can thiệp thủ công để sửa. Các ảnh này được lưu trong `/var/lib/overleaf/data/template_files/` (>= 5.0.3) và `/var/lib/sharelatex/data/template_files/` (trước đó).

Chúng tôi khuyên bạn sao lưu thư mục này trước khi thực hiện bất kỳ thay đổi nào.

Bạn cần làm theo các bước dưới đây cho từng template bị ảnh hưởng:

Tìm ID của templateĐi tới bộ sưu tập template của phiên bản bạn (/templates/all), mở một template bị ảnh hưởng, và sao chép ID từ URL (ví dụ: <https://your-instance-url/templates/6645d346c224815e9460a695).Chạy> lệnh sửa lỗiChạy lệnh sau từ máy chủ Docker (thay ID template bằng ID bạn đã sao chép và cập nhật đường dẫn nếu thích hợp):docker exec sharelatex /bin/bash -c "mogrify -rotate 90 /var/lib/overleaf/data/template\_files/6645d346c224815e9460a695\_\*{thumbnail,preview}"

Tham khảo: <https://docs.overleaf.com/on-premises/support/troubleshooting#incorrect-orientation-of-template-gallery-preview-thumbnail-images>

</details>

<details>

<summary>Vui lòng xác minh rằng bạn đã bật system calls. Đối với pdflatex, đó là 'pdflatex -shell-escape'.</summary>

Trường `\write18` lệnh bị tắt theo mặc định trong Community Edition vì tất cả các lần biên dịch diễn ra trong cùng một `sharelatex` container; đây là thiết lập mặc định an toàn hơn.

Nếu bạn muốn bật nó cho pdflatex, hãy tạo một `latexmkrc` tệp ở thư mục gốc của dự án với nội dung sau:

{% code title="latexmkrc" %}

```perl
$pdflatex = 'pdflatex --shell-escape';
```

{% endcode %}

Sau đó hãy thử biên dịch lại.

Tham khảo: <https://docs.overleaf.com/on-premises/support/troubleshooting#please-verify-that-you-have-enabled-system-calls.-for-pdflatex-this-is-pdflatex-shell-escape>

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/vi/ho-tro/troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
