> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Khắc phục sự cố

<Info>
  Nếu bạn đang sử dụng phiên bản cũ hơn, vui lòng dùng `sharelatex` thay cho `overleaf` trong tên đường dẫn.
</Info>

<Accordion title="Chạy Overleaf với hệ thống tệp NFS">
  Về mặt kỹ thuật, có thể gắn (mount) hệ thống tệp NFS vào container 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 khi biên dịch là:

  ```text theme={null}
  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 dùng hệ thống tệp dựa trên NFS cho dữ liệu tạm thời, chẳng hạn như các thư mục dùng cho dữ liệu biên dịch. Chúng tôi khuyến nghị sử dụng một ổ đĩa tạm cục bộ, tốt nhất là SSD cục bộ, cho các thư mục sau.

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

  ```yaml title="docker-compose excerpt" theme={null}
  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
  ```

  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 một lần biên dịch đầy đủ.

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

<Accordion title="Chạy Overleaf trên Windows hoặc macOS khiến dịch vụ `mongo` không khởi động được">
  Nếu bạn chạy Overleaf trên Windows hoặc macOS, dịch vụ `mongo` có thể không khởi động lại được, kèm theo lỗi:

  ```text title="Example error" theme={null}
  Failed to start up WiredTiger under any compatibility version.
  Reason: 1: Operation not permitted
  ```

  Để 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 tài liệu của image `mongo` để biết thêm chi tiết: [https://github.com/docker-library/docs/blob/master/mongo/content.md#where-to-store-data](https://github.com/docker-library/docs/blob/master/mongo/content.md#where-to-store-data)). Để lưu dữ liệu trong các Docker volume được gắn vào container MongoDB và Redis, hãy thêm nội dung sau vào `config/docker-compose.override.yml` (tạo tệp này nếu chưa có):

  ```yaml title="config/docker-compose.override.yml" theme={null}
  volumes:
    mongo-data:
    redis-data:

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

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

  Để 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](https://docs.overleaf.com/on-premises/support/troubleshooting#running-overleaf-on-windows-or-macos-results-in-the-mongoservice-not-starting)
</Accordion>

<Accordion title="Nâng cấp lên Redis 6.2 dẫn đến vòng lặp khởi động lại">
  Sử dụng lệnh `docker logs redis` để xuất một bản sao log.

  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:

  ```text title="Redis log example" theme={null}
  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
  ```

  Điều này có thể liên quan đến phiên bản Docker đang sử 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 issue upstream của Redis: [https://github.com/redis/redis/issues/12362](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](https://docs.overleaf.com/on-premises/support/troubleshooting#upgrading-to-redis-6.2-results-in-a-restart-loop)
</Accordion>

<Accordion title="Ảnh xem trước/thu nhỏ của thư viện mẫu bị sai hướng">
  Đôi khi, ảnh xem trước/thu nhỏ do Server Pro tạo ra có thể bị 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/` (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 cần thực hiện các bước dưới đây cho từng mẫu bị ảnh hưởng:

  Tìm ID của 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](https://your-instance-url/templates/6645d346c224815e9460a695\).Chạy) lệnh sửa lỗiChạy lệnh sau từ máy chủ Docker host (thay ID mẫu bằng ID bạn đã sao chép và cập nhật đường dẫn nếu cần):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](https://docs.overleaf.com/on-premises/support/troubleshooting#incorrect-orientation-of-template-gallery-preview-thumbnail-images)
</Accordion>

<Accordion title="Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'.">
  Lệnh `\write18` bị tắt theo mặc định trong Community Edition vì tất cả các lần biên dịch đều diễn ra trong cùng một container `sharelatex`; đây là mặc định an toàn hơn.

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

  ```perl title="latexmkrc" theme={null}
  $pdflatex = 'pdflatex --shell-escape';
  ```

  Sau đó 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](https://docs.overleaf.com/on-premises/support/troubleshooting#please-verify-that-you-have-enabled-system-calls.-for-pdflatex-this-is-pdflatex-shell-escape)
</Accordion>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.