Error loading file - Not a diagram file - Extra content at end of document

80 views
Skip to first unread message

Niel de Clerk

unread,
May 4, 2020, 7:15:56 AM5/4/20
to diagrams.net Q&A
Hi There
I drew the attached diagram this morning on diagrams.net and saved it to OneDrive

When I tried to reopen it now, I received the following error:

Error Loading File
Not a diagram file (Error on line 1 at column 770049: Extra Content at the end of the document)


Drawing this diagram was lots of work, I really hope it can be recovered.

Thanks
Niel
BOS Architecture

Niel de Clerk

unread,
May 4, 2020, 7:20:59 AM5/4/20
to diagrams.net Q&A
Quick update:  I managed to restore the previous version (about an hour earlier) of the diagram with OneDrive and that loaded fine.

So all is good. I would however still like to know what could possibly cause this file corruption and what I can do to prevent it from happening in future.

Nearly had a heart-attack :-)

Thanks

David Benson [diagrams.net]

unread,
May 4, 2020, 7:53:35 AM5/4/20
to diagrams.net Q&A
Unfortunately, OneDrive does seem to suffer from failing to file the file correctly under some condition. It is extremely rare, but the problem is OneDrive is reporting as having saved correctly, whereas, it hasn't.

OneDrive's API and performance for third party apps isn't great, the permissions required are also excessive, I wouldn't agree to them.

If I had to use OneDrive for some reason, I'd run the local sync client and use the Desktop app working against the locally synced version of the file. That won't suffer from the corrupt write failure and doesn't require you to agree to any permissions for the app.

Ward De Cooman

unread,
Aug 4, 2020, 11:12:12 AM8/4/20
to diagrams.net Q&A
Hello,
I have the same issue as reported by Niel De Clerk.
I guess it is also caused by the fact that we use Onedrive as storage.
Unfortunately, restoring previous version via Onedrive did not solve the issue for me.
I hope somebody can help, because we put a lot of effort in the drawing.

this is the error message: Not a diagram file (error on line 13 at column 1: Extra content at the end of the document)

kind regards

ward

Op maandag 4 mei 2020 13:53:35 UTC+2 schreef David Benson [diagrams.net]:

David Benson [diagrams.net]

unread,
Aug 4, 2020, 11:55:42 AM8/4/20
to diagrams.net Q&A
The only store is in your version history. If the next oldest version doesn't load, try going further back in your version history.

Ward De Cooman

unread,
Aug 5, 2020, 2:42:22 AM8/5/20
to diagrams.net Q&A
Hello,
thank you for the quick answer.
Unfortunately, all the version in the version history are corrupt. Also if I go back to a version from a long time ago when the file was not corrupt.
Could this be related to the fact that I saved the drawing as a HTML file? 
I can send you the file if that is helpfull.

kind regards
ward

Op dinsdag 4 augustus 2020 17:55:42 UTC+2 schreef David Benson [diagrams.net]:

Ward De Cooman

unread,
Aug 5, 2020, 3:50:50 AM8/5/20
to diagrams.net Q&A
Hello, 

good news! I managed to undo the corruption by unescaping the HTML file and extracting the xml out of it. Next thing I had to do was removing a slash in front of all the equality signs with a text editor

kind regards

ward



Op woensdag 5 augustus 2020 08:42:22 UTC+2 schreef Ward De Cooman:

David Benson [diagrams.net]

unread,
Aug 5, 2020, 3:52:59 AM8/5/20
to diagrams.net Q&A
OK, that's good, but strange it got in this state. You just saved the file as HTML and it failed to load but up? If you could send the original HTML that failed to sup...@draw.io we can work out what went wrong.

Gaudenz Alder

unread,
Aug 17, 2020, 5:43:49 AM8/17/20
to diagrams.net Q&A
M$ is adding the following content after the HTML data in their response:

<html><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"><meta name="Robots" content="NOINDEX " /></head><body></body>
                <script type="text/javascript">
                 var gearPage = document.getElementById('GearPage');
                 if(null != gearPage)
                 {
                     gearPage.parentNode.removeChild(gearPage);
                     document.title = "Error";
                 }
                 </script>
                 </html>

We will add a workaround to remove that in the next release.

Reply all
Reply to author
Forward
0 new messages