onenote-md-exporter icon indicating copy to clipboard operation
onenote-md-exporter copied to clipboard

OneNote crash during export solved by clearing page history

Open solashira opened this issue 3 years ago • 17 comments

Describe the bug image As shown in the figure, an array of RPC errors showed up during the process.

The executable ends after declaring an unhandled exception error, unlike the other unhandled exception error report in the issues page, this one seems to be RPC related.

I soon checked windows services per [https://www.alphr.com/rpc-server-is-unavailable/] this instruction, but all the mentioned services were running normally. Could this be firewall related?

To Reproduce Attempt to export any of my notebooks would result in such error soon after the process begins.

I'm running Onenote as part of Office suite installation with Office365 subscription, I'm unsure if this qualifies as an "Office installation". In the tmp folder I can find successfully converted MDs (before the error) , so the exporter is at least working to some extent.

Expected behavior A clear and concise description of what you expected to happen.

Logs log attached ⚠️ Ensure that the log file do not contain any personal data ⚠️

Desktop (please complete the following information):

  • Windows version : Pro-Ver.21H1/64 bits
  • Office Version : 365 Suite/64 bits
  • [Optional] PanDoc Version : ...

Additional context Add any other context about the problem here.

solashira avatar Aug 07 '21 09:08 solashira

Hey @solashira , and thank you for the issue. Can you confirm that OneNote was running when you launched the export, that Word is installed, and that when you launch word or Onenote by yourself there is no popup that apears.

I alreay have a task in my backlog to enhance error handling which is currently very basic.

alxnbl avatar Aug 07 '21 10:08 alxnbl

Thank you for your attention!

Can you confirm that OneNote was running when you launched the export, that Word is installed, and that when you launch word or Onenote by yourself there is no popup that apears.

-Yes, onenote is running and the notebook for export is opened and synced -Yes, Word is installed and used on a daily basis -No, No popup appears at first launch. However, every time the exporter crashes, onenote crashes simultaneously, so naturally there will be a "safe launch" popup the next time I launch onenote

solashira avatar Aug 07 '21 11:08 solashira

Could you join a onenote export of a very basic notebook that cause the error please. If you can, try to open your notebook on an other computer and run the md export tool on it.

alxnbl avatar Aug 07 '21 12:08 alxnbl

Could you join a onenote export of a very basic notebook that cause the error please. If you can, try to open your notebook on an other computer and run the md export tool on it.

-I created two new notebooks with very basic text notes in them, one on the cloud one locally, the export was conducted successfully on both notebooks. Since it appears now to be some kind of runtime error, I'll spend sometime try to pinpoint it tonight, should I find out the cause I'll make sure to bring it to your attention. -I don't have another windows pc with me or anywhere near me at the moment, I'll try it on a virtual machine. -As a (probably important) side note, I've noticed that the error appears most frequently with notes written in simplified Chinese, no hyperlinks, no pictures, just pure text.

solashira avatar Aug 07 '21 12:08 solashira

Thanks for these details, I am waiting for your test results.

alxnbl avatar Aug 07 '21 12:08 alxnbl

Thanks for these details, I am waiting for your test results.

Okay...um, this is embarrassing, I didn't really solve the problem but I did produce a reliable workaround: -I noticed that in some cases the errors were caused by page rather the content of the page, that means even if I delete all the contents leaving only a title, that page still causes the exception error. -Since this error concerns remote service, the problem may not be quite local. -So I thought about "page history", where onenote keeps older version of note pages. I then proceeded to delete history versions of the error-causing pages, and that's it, problem solved. -After deleting all page histories in my notebooks, the exporter now runs like a charm

solashira avatar Aug 07 '21 13:08 solashira

Well done. Thanks for your investigation. If you can join a notebook causing the issue, I will try to find a fix.

alxnbl avatar Aug 07 '21 13:08 alxnbl

Well done. Thanks for your investigation. If you can join a notebook causing the issue, I will try to find a fix.

I'm not sure if I understood this correctly, do you mean sharing a notebook with you? If that's the case, here is the link https://1drv.ms/u/s!AlqbYiscjXIZgqppH_8ddReP6MnTWA?e=4WGyw8 About the notebook I shared, the error starts at the third note page under the NAS section

solashira avatar Aug 07 '21 13:08 solashira

By sharing a notebook I mean exporting the full notebook content in a onepkg format. You can follow theses instructions to do the export : https://github.com/alxnbl/onenote-md-exporter/blob/main/doc/notebook-onepkg-export.md .

I also been able to access the notebook with the link. I will do some tests in the next few days. Thanks again.

alxnbl avatar Aug 10 '21 09:08 alxnbl

Same issue here ... First: it´s a great script, making best results - thank you very much. When exporting hundreds of pages of several sections, most pages work well. It stops when exporting a page with version history. After deleting the older versions manually, the section is processed and the pages are exported without any issues. In my opinion, Onenote stops working in this moment, your script stops because ON is not available anymore, and then ON is restarted automatically (so it seems if it would be up and running).

kth1 avatar Aug 28 '21 20:08 kth1

update: after deleting all older versions for the whole OneNote file, all sections/pages could be processed without interruption. So the issue from my point of view depends clearly on the ON version history.

kth1 avatar Aug 28 '21 20:08 kth1

Thanks @kth1 , I think your analysis is right. I am wondering if the crash occurs only with aspecific ON version. Could you join an export of the notebook causing the issue (onepkg file) and give me details about your configuration (windows and ON version). Thanks!

alxnbl avatar Aug 29 '21 07:08 alxnbl

Windows 10 Pro 21H1 19043.1165 Microsoft® OneNote® für Microsoft 365 MSO (16.0.14228.20216) 32-Bit

Unfortunately, I used the ON function for deleting page history for the entire file (German: "Verlauf" -> "Seitenversionen"), so in my file (which is synchronized to my other computers ...) this information is not longer available. Maybe I can set up a new file with versions for reproducing the issue.

kth1 avatar Aug 29 '21 09:08 kth1

Maybe I can set up a new file with versions for reproducing the issue.

I´m sorry, up to now I was not able to reproduce it. With a new file and different versions of some pages no error occured on export ... I have to look if there is any backup of the old file for testing purposes.

kth1 avatar Aug 29 '21 20:08 kth1

Thank you to have tried. I will see in the futur if an other user encounter the issue.

alxnbl avatar Aug 30 '21 09:08 alxnbl

I ran into this problem yesterday while trying to export about a thousand notes from OneNote, and deleting the history from the affected notebooks definitely solved it. It looks like it only affected maybe half a dozen notes total, all edited more than two years ago.

jgreely avatar Oct 19 '21 17:10 jgreely

Thanks for the report. If you can join an export of a Notebook that can help me reproduce the problem it will be definitively useful.

alxnbl avatar Oct 19 '21 18:10 alxnbl

Solved in version 1.3.0.

alxnbl avatar Oct 26 '22 20:10 alxnbl