Hi,
I found the root cause of the "'function' object has no attribute 'endswith'" error when uploading backups to Google Drive.
Environment:
- aaPanel 8.0.5
- Google Drive plugin 3.0
- Ubuntu 24.04
- Backup size: ~ 257 KB
The local backup is created successfully. The error occurs only when aaPanel starts uploading it to Google Drive.
The traceback points to:
/www/server/panel/mod/project/backup_restore/backup_manager.py:500
backup_path = _cloud.obj.backup_path
if not backup_path.endswith('/'):
backup_path += '/'
In the Google Drive plugin, backup_path is already defined as a method:
def backup_path(self, path, count, exclude=[]):
Therefore _cloud.obj.backup_path is a function rather than a string, which causes:
AttributeError: 'function' object has no attribute 'endswith'
I compared this with the gcloud_storage adapter in the same cloud_stora_upload_v2.py. It explicitly sets:
self.gsc_obj.backup_path = "bt_backup"
The Google Drive adapter does not have the equivalent assignment.
I tested adding the following line to the Google Drive adapter:
self.gc_obj.backup_path = "bt_backup"
After this one-line change, the backup was successfully uploaded to Google Drive.
So it looks like Google Drive 3.0 is missing the backup_path assignment required by the new backup manager.
Could you please confirm this and include the fix in the official plugin/update?
Thank you.