Skip to content

Commit 49692d9

Browse files
author
Nigel
committed
Fix remote backup location issues (TEST RELEASE v1.4.1.3)
- Fixed NFS path format handling (requires server:/export/path format) - Improved SMB browsing with better path validation - Fixed local location issue preventing NFS paths in local mode - Enhanced SFTP error messages and paramiko availability handling - Added path format hints and validation for all remote protocols - Settings now auto-save immediately when changed - Improved error messages with format examples This is a TEST RELEASE to address multiple remote backup issues.
1 parent 0586f92 commit 49692d9

4 files changed

Lines changed: 322 additions & 31 deletions

File tree

release_notes_1.4.1.3.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# LibreELEC Backupper v1.4.1.3 - TEST RELEASE
2+
3+
## ⚠️ TEST RELEASE
4+
5+
This is a **TEST RELEASE** to fix multiple remote backup location issues. Please test thoroughly before using in production.
6+
7+
## What's New in 1.4.1.3 (December 30, 2025)
8+
9+
### 🐛 Bug Fixes
10+
11+
#### NFS Connection Issues
12+
- **Fixed NFS path format handling** - NFS now requires proper format: `server:/export/path`
13+
- Added automatic path format conversion and validation
14+
- Improved NFS mount options with soft mount and timeout settings
15+
- Better error messages with format examples
16+
17+
#### SMB Browsing Issues
18+
- **Fixed SMB browsing** - Now properly handles manually entered paths
19+
- Improved SMB URL construction to handle empty username/password
20+
- Better path validation for SMB connections
21+
22+
#### Local Location Issues
23+
- **Fixed local location with NFS path bug** - Prevents network protocols (nfs:, smb:, etc.) in local paths
24+
- Automatically resets invalid local paths to default location
25+
- Added validation to detect and prevent network protocols in local mode
26+
27+
#### SFTP Improvements
28+
- **Enhanced SFTP error messages** - Better handling when paramiko module is not available
29+
- Improved error dialogs with solutions and alternatives
30+
- Still allows manual path entry even if paramiko is unavailable
31+
32+
### 🔧 Technical Improvements
33+
34+
- **Path Format Validation** - Added format hints and validation for all remote protocols
35+
- **Auto-save Settings** - Settings now save immediately when changed (no need to click OK)
36+
- **Better Error Messages** - All error messages now include format examples and troubleshooting tips
37+
- **Improved NFS Mounting** - Uses soft mount with timeout for better error handling
38+
39+
### 📝 Path Format Examples
40+
41+
#### NFS
42+
- Format: `server:/export/path`
43+
- Examples:
44+
- `192.168.1.100:/mnt/backups`
45+
- `nas.example.com:/export/share`
46+
47+
#### SMB
48+
- Format: `server/share` or use Browse button
49+
- Examples:
50+
- `192.168.1.100/backups`
51+
- `server/share/subfolder`
52+
53+
#### FTP/SFTP
54+
- Format: `server/path`
55+
- Examples:
56+
- `ftp.example.com/backups`
57+
- `server.example.com/home/user/backups`
58+
59+
## Issues Fixed
60+
61+
This release addresses multiple issues reported in GitHub:
62+
- Unable to back up to remote NFS location
63+
- SMB browsing not working with manually entered paths
64+
- Local location accepting NFS paths incorrectly
65+
- SFTP paramiko module error messages
66+
- Settings not applying without clicking OK
67+
- Missing path format hints
68+
69+
## Testing Required
70+
71+
Please test the following scenarios:
72+
1. ✅ NFS remote backup with proper format (`server:/export/path`)
73+
2. ✅ SMB remote backup with manually entered path
74+
3. ✅ SMB remote backup using Browse button
75+
4. ✅ Local backup location (should reject network protocols)
76+
5. ✅ SFTP connection (with and without paramiko)
77+
6. ✅ Settings auto-save functionality
78+
79+
## Installation
80+
81+
1. Download the test release
82+
2. Install through Kodi's Add-on Manager
83+
3. Test remote backup connections
84+
4. Report any issues on GitHub
85+
86+
## Known Limitations
87+
88+
- NFS requires the exact format `server:/export/path` (colon is required)
89+
- SFTP requires paramiko module for full functionality
90+
- Some network configurations may require additional firewall rules
91+
92+
## Support
93+
94+
If you encounter any issues, please:
95+
1. Check the [Troubleshooting Guide](https://github.com/Nigel1992/service.libreelec.backupper/wiki/Troubleshooting)
96+
2. Report bugs on our [Issues Page](https://github.com/Nigel1992/service.libreelec.backupper/issues)
97+
3. Include error messages and path formats used
98+
99+
Thank you for testing LibreELEC Backupper!
100+

service.libreelec.backupper/addon.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="service.libreelec.backupper" name="LibreELEC Backupper" version="1.4.1.2" provider-name="Nigel">
2+
<addon id="service.libreelec.backupper" name="LibreELEC Backupper" version="1.4.1.3" provider-name="Nigel">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
<import addon="script.module.requests" version="2.22.0"/>
@@ -14,7 +14,16 @@
1414
<license>GPL-2.0-or-later</license>
1515
<forum>https://forum.libreelec.tv/</forum>
1616
<source>https://github.com/Nigel1992/service.libreelec.backupper</source>
17-
<news>v1.4.1.2 (2025-12-30)
17+
<news>v1.4.1.3 (2025-12-30) - TEST RELEASE
18+
- Fixed NFS connection and path format handling (requires server:/export/path format)
19+
- Improved SMB browsing with better path validation
20+
- Fixed local location issue preventing NFS paths in local mode
21+
- Enhanced SFTP error messages and paramiko availability handling
22+
- Added path format hints and validation for all remote protocols
23+
- Settings now auto-save immediately when changed
24+
- Improved error messages with format examples
25+
26+
v1.4.1.2 (2025-12-30)
1827
- Fixed restore from backup failing due to read-only file system error
1928
- Added automatic mounting/unmounting of addons directory during restore
2029
- Improved path resolution for addons and repository files during restore

service.libreelec.backupper/resources/lib/backup_utils.py

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ def update_backup_location(self):
6363
self.backup_dir = self.addon.getSetting('backup_location')
6464
if not self.backup_dir:
6565
self.backup_dir = "/storage/backup" # Default location
66+
67+
# Validate that local path doesn't contain network protocols
68+
if self.backup_dir and (self.backup_dir.startswith(('nfs:', 'smb:', 'ftp:', 'sftp:', 'http:', 'https:')) or '://' in self.backup_dir):
69+
xbmc.log(f"Invalid local path detected (contains network protocol): {self.backup_dir}", xbmc.LOGWARNING)
70+
# Reset to default if invalid
71+
self.backup_dir = "/storage/backup"
72+
self.addon.setSetting('backup_location', self.backup_dir)
73+
xbmc.log(f"Reset backup location to default: {self.backup_dir}", xbmc.LOGINFO)
6674
else: # Remote
6775
# Get remote settings
6876
self.remote_type = int(self.addon.getSetting('remote_location_type') or "0")
@@ -137,13 +145,40 @@ def connect_remote(self):
137145
try:
138146
if self.remote_type == 0: # SMB
139147
# Use Kodi's built-in SMB support via xbmcvfs
140-
remote_url = f"smb://{self.remote_username}:{urllib.parse.quote(self.remote_password)}@{self.remote_path}"
148+
# Construct SMB URL properly
149+
if self.remote_username and self.remote_password:
150+
remote_url = f"smb://{self.remote_username}:{urllib.parse.quote(self.remote_password)}@{self.remote_path}"
151+
elif self.remote_username:
152+
remote_url = f"smb://{self.remote_username}@{self.remote_path}"
153+
else:
154+
remote_url = f"smb://{self.remote_path}"
155+
141156
self.remote_connection = remote_url
142157
# Test connection by trying to list directory
143158
dirs, files = xbmcvfs.listdir(remote_url)
144159
return True
145160

146161
elif self.remote_type == 1: # NFS
162+
# Validate and format NFS path
163+
# NFS requires format: server:/export/path or server:/export
164+
nfs_path = self.remote_path.strip()
165+
166+
# Check if path already has the correct format (contains :/)
167+
if ':/' not in nfs_path:
168+
# Try to convert IP or hostname to proper NFS format
169+
# If it's just an IP or hostname, we need the export path
170+
if '/' not in nfs_path:
171+
xbmc.log(f"Invalid NFS path format: {nfs_path}. Expected format: server:/export/path", xbmc.LOGERROR)
172+
return False
173+
# If it has / but no :, assume it's server/export format and convert
174+
if ':' not in nfs_path:
175+
parts = nfs_path.split('/', 1)
176+
if len(parts) == 2:
177+
nfs_path = f"{parts[0]}:/{parts[1]}"
178+
else:
179+
xbmc.log(f"Invalid NFS path format: {nfs_path}. Expected format: server:/export/path", xbmc.LOGERROR)
180+
return False
181+
147182
# Mount NFS share
148183
mount_point = os.path.join(self.backup_dir, "nfs_mount")
149184
if not os.path.exists(mount_point):
@@ -152,13 +187,21 @@ def connect_remote(self):
152187
# Unmount if already mounted
153188
subprocess.call(["umount", mount_point], stderr=subprocess.DEVNULL)
154189

155-
# Mount the NFS share
156-
result = subprocess.call(["mount", "-t", "nfs", self.remote_path, mount_point])
190+
# Mount the NFS share with proper options
191+
# Use soft mount and shorter timeout for better error handling
192+
mount_options = ["-t", "nfs", "-o", "soft,timeo=10,retrans=2"]
193+
result = subprocess.call(["mount"] + mount_options + [nfs_path, mount_point],
194+
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
195+
157196
if result == 0:
158197
self.remote_connection = mount_point
198+
xbmc.log(f"Successfully mounted NFS share: {nfs_path} to {mount_point}", xbmc.LOGINFO)
159199
return True
160200
else:
161-
xbmc.log(f"Failed to mount NFS share: {self.remote_path}", xbmc.LOGERROR)
201+
error_msg = f"Failed to mount NFS share: {nfs_path}. "
202+
error_msg += "Please verify: 1) NFS server is running, 2) Export path is correct (format: server:/export/path), "
203+
error_msg += "3) Network connectivity, 4) NFS client is installed"
204+
xbmc.log(error_msg, xbmc.LOGERROR)
162205
return False
163206

164207
elif self.remote_type == 2: # FTP

0 commit comments

Comments
 (0)