> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-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>

Việc gắn một hệ thống tệp NFS trong một container Overleaf là khả thi về mặt kỹ thuật, nhưng không được khuyến nghị và có thể dẫn đến nhiều loại lỗi hiệu năng khác nhau.

Một lỗi phổ biến mà các lần biên dịch gặp phải là:

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

Đặc biệt, chúng tôi khuyên không nên sử 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 nghị dùng một đĩa scratch cục bộ, tốt nhất là một 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, chúng tôi chỉ đề xuất ghi đè điểm mount bind từ NFS, giúp tránh phải thay đổi đường dẫn trong ứng dụng. Đây là một ví dụ về một `docker-compose` đoạn cấu hình với việc 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 toàn bộ 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, dịch vụ `mongo` có thể không khởi động lại được, với lỗi:

{% code title="Lỗi ví dụ" %}

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

{% 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` (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>

Sử 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 `Lỗi nghiêm trọng: Không thể khởi tạo các tác vụ nền`, đầu ra đầy đủ sẽ trông giống như sau:

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

```
1:M 11 Feb 2024 15:19:22.609 # Máy chủ đã được khởi tạo
1:M 11 Feb 2024 15:19:22.609 # Lỗi nghiêm trọng: Không thể khởi tạo các tác vụ nền.
1:C 11 Feb 2024 15:19:26.055 # oO0OoO0OoO0Oo Redis đang khởi động oO0OoO0OoO0Oo
```

{% endcode %}

Điều này có thể liên quan đến phiên bản Docker hiện đang được 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 lỗi 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 của hình xem trước/thumbnail trong thư viện mẫu không đúng</summary>

Thỉnh thoảng, các hình xem trước/thumbnail do Server Pro tạo ra có thể bị tạo theo hướng sai và cần can thiệp thủ công để sửa. Những hình này được lưu trong `/var/lib/overleaf/data/template_files/` (>= 5.0.3) và `/var/lib/sharelatex/data/template_files/` (các phiên bản trước đó).

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

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

Tìm ID mẫuĐiều hướng đến thư viện mẫu của phiên bản của bạn (/templates/all), mở một mẫu bị ảnh hưởng và sao chép ID từ URL (ví dụ: <https://your-instance-url/templates/6645d346c224815e9460a695).Chạy> lệnh sửaChạy lệnh sau từ máy chủ Docker (thay ID mẫu bằng ID bạn đã sao chép và cập nhật đường dẫn nếu phù 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 các lệnh gọi hệ thống. Đối với pdflatex, đó là 'pdflatex -shell-escape'.</summary>

Trường `\write18` lệnh này bị vô hiệu hóa theo mặc định trong Community Edition do tất cả các lần biên dịch diễn ra trong cùng một `sharelatex` container; đây là 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 trong 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://overleaf-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.
