0

One customer reported OneNote business backup failure, and here's the message.

Code: 20258 Message: Sync of this section is not supported. Detailed error information: Getting Section

What does that code mean? Is it related to AzureApp permission, or some property of that specific 'Section'?

Thanks in advance.

Locke
  • 315
  • 1
  • 3
  • 14

2 Answers2

0

I found out why.

For OneDrive/OneNote business env, OneNote business contents are synched into OneDrive storage, on the 'Notebooks' folder.

The customer had some local OneNote files, created by locally working OneNote S/W. And moved the whole Notebook folder to the above 'Notebooks' folder of OneDrive business storage.

That was the problem. After I moved that manual/local folder out of the 'Notebooks' folder, the error was gone.

Now I escaped this situation, but it worries me when I think about this way of OneNote/OneDrive business synch, and Graph API.

With OneDrive API I can download the whole contents of the 'Notebooks' folder. Actually it's a Folder with some OneNote related *.TOC file and *.ONE file. But from the OneDrive web page, it's shown as a 'shortcut' to the OneNote page.

And with OneDrive API, you can not restore that content that you have just downloaded by the GET API. If you intentionally create a folder and upload the *.TOC and *.ONE content by using Graph API, the whole OneNote site goes malfunction.

I have written an opinion on this limitation (or problem) to the suggestion page, asked a question on Git-hub, and even met MS engineers and told this issue, but for years the situation is the same.

Seriously, this will become a big problem.

Locke
  • 315
  • 1
  • 3
  • 14
  • Have you tried creating a blank notebook with the appropriate name using the OneNote API and then uploading the sections into this with the OneDrive API? – codeye Dec 29 '19 at 17:48
  • Interesting idea. I tried it, by manual. (1) I downloaded the contents of OneNote package folder and saved it somewhere. (2) and deleted that OneNote notebook (3) And I created a new notebook from OneNote website, (4) and uploaded the original contents I saved at the step 1 (*.one and *.onetoc2) to that new OneNote notebook, assuming that it is just a folder. (5) I can see proper contents from OneNote site for that new Notebook. – Locke Dec 30 '19 at 19:47
  • So, if you can provide an OneDrive API that can create that special OneNote Notebook folder, we can solve one problem. The other problem still remains is that if you upload the locally generated OneNote contents as a normal folder to that synched 'Notebooks' folder on OneDrive, it will break the OneNote API to work. – Locke Dec 30 '19 at 19:49
  • There isn't a OneDrive API to create or change a folder to a special OneNote Notebook folder. You will have to create the folder via the OneNote API. In what way does the OneNote API not work if you do this, can you . provide an example? – codeye Jan 02 '20 at 02:52
  • That's what this post is about. graphClient.Users[userPrincipalName].Onenote.Pages.Request() returns Code: 20258 error. – Locke Jan 02 '20 at 13:49
  • And if you select a OneNote notebook from OneDrive and copy (by using 'Copy To'button) it to some OneDrive folder in some depth, it will create a new Notebook on OneNote with the same name. Consider if you want to restore the 2 Notebooks with the same name on a different path. In OneNote API, you can not specify a 'path' for Notebook, only display-name. So if you changed content in any of those 2 notebooks, you will lose 1 of them because you can only create 1 Notebook name. – Locke Jan 02 '20 at 13:59
  • So, why don't you try for yourself instead of just asking me here? you are the developer there. Just create local Notebook contents, and upload the Notebook folder itself to OneDrive's 'Notebooks' folder. Either OneNote/OneDrive site works fine but if you call OneNote API to get pages, you will get 20258 error. – Locke Jan 02 '20 at 14:06
  • And as I pointed above, because of 'Copy To' function in OneDrive web-page and the limitation of OneNote API for creating a Notebook, you can not properly restore the Notebook contents with the same name but on different OneDrive folder location. Either revise the OneNote API, or disable the OneDrive<->OneNote synching other than 'Notebooks' folder. – Locke Jan 02 '20 at 14:09
  • Basically, you guys enabled the Synch between OneNote and OneDrive and provided the OneDrive API to get all the information of them, but did not provide the API to create that only one specific type. So asking the API consumers to call different API does not make sense. If it takes time, please revise OneNote API to work properly, or disable the synch & copy-to features till your APIs get ready. – Locke Jan 02 '20 at 14:16
  • Sorry Locke, I'm still lost. I can upload a local notebook as described without the issue you mention. Rather than using the "userPrincipalName" API can you access the notebook with the sharepoint siteCollectionId and siteId? I'm not sure why Microsoft doesn't make it easier to move notebooks from local storage to Onedrive. – codeye Jan 03 '20 at 16:58
  • @codeye, I thought you were in MS :) BTW, it's not at all related with UPN or anything and it's simple to reproduce. In the situation you get the page list no problem, Just Upload the locally created Notebook folder to OneDrives 'Notebooks' folder. When you get the list of pages by calling OneNote API, it returns code 20258. I think I'm repeating this couple of times so I hope this is clear now. – Locke Jan 03 '20 at 18:27
0

Perfect...thanks Locke! Yes we are looking at this issue currently and a fix is in progress for this particular API, though it might take a few weeks to rollout to Production. And yes, this might happen when you upload local OneNote files to the wrong folder or if the local files are older OneNote version

Manjusha
  • 538
  • 2
  • 4