Drive Account Type setting as "PERSONAL" is lost after each sync with OneDrive

ionutm80

Dabbler
Joined
Mar 18, 2018
Messages
25
Hello,

I started to have some problems with cloud credentials for a OneDrive personal account after upgrading to 11.2-U5. The problem is that the settings for Drive Account Type as "PERSONAL" in Cloud Credentials is not saved and hence each time rclone is trying to make a sync is giving the error below:

Error: Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 167, in call_method
result = await self.middleware.call_method(self, message)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1098, in call_method
return await self._call(message['method'], serviceobj, methodobj, params, app=app, io_thread=False)
File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 1046, in _call
return await methodobj(*args)
File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 664, in nf
return await f(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/cloud_sync.py", line 549, in list_directory
return await self.ls(dict(cloud_sync, credentials=credentials), path)
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/cloud_sync.py", line 553, in ls
with RcloneConfig(config) as config:
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/cloud_sync.py", line 59, in __enter__
config.update(dict(self.cloud_sync["attributes"], **self.provider.get_task_extra(self.cloud_sync)))
File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/../rclone/remote/onedrive.py", line 28, in get_task_extra
}[task["credentials"]["attributes"].get("drive_type", "")]
KeyError: 'personal'

I have noticed that if I am very quick and input the PERSONAL setting in Cloud Credentials and then in less than 5 seconds I start the cloud sync task manual rclone is starting to sync my OneDrive folders to their equivalent volumes on FreeNAS. However the setting is then deleted again from Cloud Credentials and the cloud sync task gives the same error above.

What can I do to solve this issue?

Thanks a lot in advance!
 
D

dlavigne

Guest
You shouldn't be getting a traceback. Please create a report at bugs.ixsystems.com and post the issue number here.
 

ionutm80

Dabbler
Joined
Mar 18, 2018
Messages
25
Hello, I have created the report, the issue number is : NAS-102943
Drive Account Type setting as "PERSONAL" is lost after each sync with OneDrive.

In the meantime I pinpointed more accurately what is happening:
- the bug was introduced in U4.1 and was not solved in U5
- the value "PERSONAL" of Drive Account Type is lost only after a sync
- the sync works perfectly if I put back manually the setting again
- I've notice a new error in RClone config: "Failed to save new tokken in config file: section "onedrive" noy found"

I will attach 2 new screenshots: one with the error above and one with the setting missing after the sync.
 

Attachments

  • Drive Account Type missing after first sync.png
    Drive Account Type missing after first sync.png
    86.2 KB · Views: 284
  • error RClone section onedrive missing .png
    error RClone section onedrive missing .png
    61 KB · Views: 286

elorimer

Contributor
Joined
Aug 26, 2019
Messages
194
Top