rustdesk-server
rustdesk-server copied to clipboard
### Issue: Persistent `disk I/O error` with `hbbs` Service
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:
-
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
- Verified and ensured correct permissions and ownership for the database file:
-
Write Access:
- Tested write access to the database file as the
www-datauser:sudo -u www-data sqlite3 /mnt/rustdesk-test/db_v2.sqlite3 "CREATE TABLE test5 (id INTEGER PRIMARY KEY);"
- Tested write access to the database file as the
-
Filesystem Health:
- Checked the filesystem for errors (unable to unmount root filesystem while system is running):
sudo fsck -f /dev/sdd2
- Checked the filesystem for errors (unable to unmount root filesystem while system is running):
-
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
- Disabled AppArmor to ensure it is not interfering with the service:
-
Service Configuration:
- Updated the
hbbsservice to use thewww-datauser 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
- Updated the
-
Dependencies and Environment:
- Ensured all required dependencies are installed:
sudo apt-get install -y sqlite3 libsqlite3-dev - Verified the
hbbsbinary is not corrupted:md5sum /usr/local/rustdesk-server/hbbs
- Ensured all required dependencies are installed:
-
Logs and Errors:
- Monitored system logs and ensured no underlying disk errors:
sudo dmesg | grep -i error sudo journalctl -xe
- Monitored system logs and ensured no underlying disk errors:
-
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
- Tested disk I/O operations to verify write operations:
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
-
Setup the Environment:
- Install Ubuntu 24.04.1 LTS (noble).
- Ensure you have the RustDesk version 1.1.12 installed.
-
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
- Create a directory for the RustDesk database:
-
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
- Create a fresh SQLite database file in the directory:
-
Configure the
hbbsService:-
Create or edit the
hbbsservice file to use the new database location:sudo nano /etc/systemd/system/hbbs.serviceEnsure the
ExecStartline 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
-
-
Restart the
hbbsService:- Reload systemd and start the
hbbsservice:sudo systemctl daemon-reload sudo systemctl start hbbs sudo systemctl status hbbs
- Reload systemd and start the
-
Monitor for Errors:
- Check the logs for error messages:
sudo journalctl -u hbbs -e
- Check the logs for error messages:
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