question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve Logging where autosave file can't be opened due to corruption

See original GitHub issue

Prerequisites

Description

New functionality has been added to Constellation to improve the experience when there are corruptions in the Autosave, Star or backup files (see #19). When there is a corruption with the Autosaved file and I select to open it, Constellation is opening up the STAR file which is the correct behaviour (as the logic detects an issue with the Autosave file), however the log file is not accurate as it states that the backup file is being opened. In this case the STAR file was opened as the autosaved file could not be.

Steps to Reproduce

SET UP FILES

  1. To reproduce this issue you need to have the right files in place. Create a graph or open an existing one. Make some changes to it and confirm in your Save location you have a STAR and .BAK file
  2. Open up the autosave location which is under the userprofile
  3. Make some changes to the graph, don’t save them. When you have the autosave file and autosave file pointer created, copy them to another location for later use
  4. Close Constellation. Don’t save the changes to the file.
  5. Now make a corruption to the autosave file. You can do this by creating a text file that is blank and giving it the same file name as the autosave file.

SET UP SCENARIO

  1. Copy the corrupt autosave file back into the autosave location along with the autosave pointer
  2. Open up the graph from File Recent
  3. Confirm you get a message asking to open up a more recent file (if not, don’t proceed as you won’t get the right log)
  4. Click OK to open up the more recent file
  5. Check the STAR file is the one that actually opens
  6. Check the log files under Help Show logs

Expected behaviour: Log file states that the Autosaved file was attempted to be opened and could not, so the .STAR file was opened

Actual behaviour: The log file states that the .STAR file could not be opened so the backup was opened instead. image

Reproduces how often: This can be reproduced for these scenarios which is where there is a corruption with the autosave file and the user selects to open it: image

Additional Information

NA

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
serpens24commented, Nov 2, 2021

@Delphinus8821 is correct in how this all works. Autosaves have always had a mechanism by which they are basically (if requested) copied over the star file if the user elects to use them. So what hapopens is the autosave overwrites the star and the (original) star overwrites the backup file.

The logs correctly reflect what is happening, what they dont say is that the star file is overwriting the backup and the star file is being overwritten by the autosave.

We could probably add logs for this to make it more obvious to users looking at logs. However the ‘actual behaviour’ is as good as we can get given the orighinal need to open autosave over top of star

0reactions
arcturus2commented, Nov 22, 2021

I’ve given this a test and it the logs seem fine to me and explain the different scenarios like

  • opening the file normally
  • opening the backup file if the main file was corrupted
  • failing to open the file and then the backup if both are corrupted
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Attempting to open C:\Users\arcturus\Documents\breaking test.star
INFO [au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader]: immutableObjectCache=ImmutableObjectCache[entries = 23]
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: breaking test read complete (0.0s)
INFO [au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable]: Took 0 seconds to retrieve a GL3 profile
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Attempting to open C:\Users\arcturus\Documents\breaking test.star
INFO [au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader]: immutableObjectCache=ImmutableObjectCache[entries = 23]
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: breaking test read complete (0.0s)
INFO [au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable]: Took 0 seconds to retrieve a GL3 profile
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Attempting to open C:\Users\arcturus\Documents\breaking test.star
WARNING [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Unable to open requested file, attempting to open backup C:\Users\arcturus\Documents\breaking test.star.bak
INFO [au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader]: immutableObjectCache=ImmutableObjectCache[entries = 23]
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Successfully opened backup file: C:\Users\arcturus\Documents\breaking test.star.bak, replacing star file
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: breaking test read complete (0.0s)
INFO [au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable]: Took 0 seconds to retrieve a GL3 profile
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Attempting to open C:\Users\arcturus\Documents\breaking test.star
WARNING [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Unable to open requested file, attempting to open backup C:\Users\arcturus\Documents\breaking test.star.bak
INFO [au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader]: immutableObjectCache=ImmutableObjectCache[entries = 23]
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Successfully opened backup file: C:\Users\arcturus\Documents\breaking test.star.bak, replacing star file
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: breaking test read complete (0.0s)
INFO [au.gov.asd.tac.constellation.visual.opengl.utilities.SharedDrawable]: Took 0 seconds to retrieve a GL3 profile
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Attempting to open C:\Users\arcturus\Documents\breaking test.star
WARNING [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Unable to open requested file, attempting to open backup C:\Users\arcturus\Documents\breaking test.star.bak
WARNING [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Unable to open requested file (C:\Users\arcturus\Documents\breaking test.star) or any associated backup
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener]: Opening D:/Users/arcturus/Documents/breaking test.star
au.gov.asd.tac.constellation.graph.file.io.GraphParseException: Entry graph.txt not found in graph file
	at au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader.readGraphZip(GraphJsonReader.java:122)
	at au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader.readGraphZip(GraphJsonReader.java:101)
	at au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener.doInBackground(VisualGraphOpener.java:208)
	at au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener.doInBackground(VisualGraphOpener.java:158)
	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[catch] at java.base/java.lang.Thread.run(Unknown Source)
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Attempting to open C:\Users\arcturus\Documents\breaking test.star
WARNING [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Unable to open requested file, attempting to open backup C:\Users\arcturus\Documents\breaking test.star.bak
WARNING [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener]: Unable to open requested file (C:\Users\arcturus\Documents\breaking test.star) or any associated backup
INFO [au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener]: Opening D:/Users/arcturus/Documents/breaking test.star
au.gov.asd.tac.constellation.graph.file.io.GraphParseException: Entry graph.txt not found in graph file
	at au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader.readGraphZip(GraphJsonReader.java:122)
	at au.gov.asd.tac.constellation.graph.file.io.GraphJsonReader.readGraphZip(GraphJsonReader.java:101)
	at au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener.doInBackground(VisualGraphOpener.java:208)
	at au.gov.asd.tac.constellation.graph.interaction.gui.VisualGraphOpener$GraphFileOpener.doInBackground(VisualGraphOpener.java:158)
	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[catch] at java.base/java.lang.Thread.run(Unknown Source)
Read more comments on GitHub >

github_iconTop Results From Across the Web

'The file is corrupted and cannot be opened' word Error
How to Resolve 'The file is corrupted and cannot be opened' Error of MS Word · Go to 'Start' and in the search...
Read more >
Open a document after a file corruption error - Microsoft Support
Click File > Open > Browse and then go to the location or folder where the document (Word), workbook (Excel), or presentation (PowerPoint)...
Read more >
How to Recover Microsoft Word Documents? - ugetfix.com
By AutoSaving the document to a different location instead of saving on top of the current existing file. The nature of this file...
Read more >
How to recover corrupted Adobe Captivate projects
If your Captivate project refuses to open, if might be corrupted. Rod Ward explains several ways to recover a corrupted project and avoid...
Read more >
What Are Corrupted Windows Files and How to Fix Them
Firstly, attempt to open the file on another device or computer. If the file opens fine on another device, it's likely that the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found