Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

### Issue: Persistent disk I/O error with hbbs Service #492

Open
wick422 opened this issue Dec 1, 2024 · 1 comment
Open

### Issue: Persistent disk I/O error with hbbs Service #492

wick422 opened this issue Dec 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@wick422
Copy link

wick422 commented Dec 1, 2024

Bug Description

System Information:

  • OS: Ubuntu 24.04.1 LTS (noble)
  • RustDesk Version: 1.1.12
  • Service: hbbs (RustDesk ID Server)
  • Database Location: /mnt/rustdesk-test/db_v2.sqlite3

Problem Description:

I have encountered a persistent disk I/O error when attempting to start the hbbs service. Despite extensive troubleshooting, the issue remains unresolved. The service fails with the following error message:

Error: An error occurred while creating a new object: error returned from database: disk I/O error

Steps Taken to Troubleshoot:

  1. Permissions and Ownership:

    • Verified and ensured correct permissions and ownership for the database file:
      sudo chmod 777 /mnt/rustdesk-test/db_v2.sqlite3
      sudo chown www-data:www-data /mnt/rustdesk-test/db_v2.sqlite3
  2. Write Access:

    • Tested write access to the database file as the www-data user:
      sudo -u www-data sqlite3 /mnt/rustdesk-test/db_v2.sqlite3 "CREATE TABLE test5 (id INTEGER PRIMARY KEY);"
  3. Filesystem Health:

    • Checked the filesystem for errors (unable to unmount root filesystem while system is running):
      sudo fsck -f /dev/sdd2
  4. AppArmor:

    • Disabled AppArmor to ensure it is not interfering with the service:
      sudo systemctl stop apparmor
      sudo systemctl disable apparmor
      sudo apt-get remove apparmor
  5. Service Configuration:

    • Updated the hbbs service to use the www-data user and pointed to the new database location:
      [Unit]
      Description=RustDesk ID Server
      After=network.target
      
      [Service]
      ExecStart=/usr/local/rustdesk-server/hbbs -r /mnt/rustdesk-test/db_v2.sqlite3
      Restart=always
      User=www-data
      Group=www-data
      WorkingDirectory=/usr/local/rustdesk-server
      StandardOutput=journal
      StandardError=journal
      
      [Install]
      WantedBy=multi-user.target
  6. Dependencies and Environment:

    • Ensured all required dependencies are installed:
      sudo apt-get install -y sqlite3 libsqlite3-dev
    • Verified the hbbs binary is not corrupted:
      md5sum /usr/local/rustdesk-server/hbbs
  7. Logs and Errors:

    • Monitored system logs and ensured no underlying disk errors:
      sudo dmesg | grep -i error
      sudo journalctl -xe
  8. Disk I/O Test:

    • Tested disk I/O operations to verify write operations:
      dd if=/dev/zero of=/mnt/rustdesk-test/testfile bs=1M count=1024 oflag=direct
      rm /mnt/rustdesk-test/testfile

Despite these efforts, the hbbs service continues to fail with the same disk I/O error. Any insights, suggestions, or guidance from the community would be greatly appreciated.

Thank you for your assistance!

How to Reproduce

How to Reproduce

  1. Setup the Environment:

    • Install Ubuntu 24.04.1 LTS (noble).
    • Ensure you have the RustDesk version 1.1.12 installed.
  2. Create the Database Directory:

    • Create a directory for the RustDesk database:
      sudo mkdir /mnt/rustdesk-test
      sudo chmod 777 /mnt/rustdesk-test
      sudo chown www-data:www-data /mnt/rustdesk-test
  3. Create the SQLite Database File:

    • Create a fresh SQLite database file in the directory:
      sudo sqlite3 /mnt/rustdesk-test/db_v2.sqlite3 "CREATE TABLE init (id INTEGER PRIMARY KEY);"
      sudo chown www-data:www-data /mnt/rustdesk-test/db_v2.sqlite3
      sudo chmod 777 /mnt/rustdesk-test/db_v2.sqlite3
  4. Configure the hbbs Service:

    • Create or edit the hbbs service file to use the new database location:

      sudo nano /etc/systemd/system/hbbs.service

      Ensure the ExecStart line is:

      [Unit]
      Description=RustDesk ID Server
      After=network.target
      
      [Service]
      ExecStart=/usr/local/rustdesk-server/hbbs -r /mnt/rustdesk-test/db_v2.sqlite3
      Restart=always
      User=www-data
      Group=www-data
      WorkingDirectory=/usr/local/rustdesk-server
      StandardOutput=journal
      StandardError=journal
      
      [Install]
      WantedBy=multi-user.target
  5. Restart the hbbs Service:

    • Reload systemd and start the hbbs service:
      sudo systemctl daemon-reload
      sudo systemctl start hbbs
      sudo systemctl status hbbs
  6. Monitor for Errors:

    • Check the logs for error messages:
      sudo journalctl -u hbbs -e

By following these steps, you should be able to reproduce the disk I/O error observed when starting the hbbs service.

Expected Behavior

Expected Behavior
The hbbs service should start successfully without encountering any errors. Specifically, it should be able to create new objects in the SQLite database located at /mnt/rustdesk-test/db_v2.sqlite3 without generating a disk I/O error. The service should run smoothly, allowing RustDesk to function correctly for managing connections and providing the necessary ID services.

Operating system(s) on local (controlling) side and remote (controlled) side

Ubuntu 24.04.1 LTS

RustDesk Version(s) on local (controlling) side and remote (controlled) side

1.1.12

Screenshots

N/A as operating in a console environment

Additional Context

No response

@wick422 wick422 added the bug Something isn't working label Dec 1, 2024
@rustdesk rustdesk transferred this issue from rustdesk/rustdesk Dec 1, 2024
@xlionjuan
Copy link
Contributor

Consider Podman if you're really care about user/namespace isolation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants