Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Settings.json corrupted after power loss #476

Closed
littleskunk opened this issue Dec 30, 2016 · 5 comments
Closed

Settings.json corrupted after power loss #476

littleskunk opened this issue Dec 30, 2016 · 5 comments
Labels

Comments

@littleskunk
Copy link
Contributor

Versions

Replace the values below with your own:

Storj Share 4.0.8
Core Library 6.0.11
Protocol 1.0.0

Expected Behavior

Please describe the program's expected behavior.

GUI should start without any problems after power loss, forced reboots or task manager kill.

Actual Behavior

Please describe the program's actual behavior. Please include any stack traces
or log output in the back ticks below.

Sometimes settings.json gets corrupted. Private key / nodeID and all other settings lost. The shards still exists but without the private key they are useless.

settings.json.txt

Steps to Reproduce

Please include the steps the reproduce the issue, numbered below. Include as
much detail as possible.

  1. I was not able to reproduce this issue. I guess a good timing is needed.

Screenshots (Optional)

If the error is graphical in nature it is helpful to provide a screenshot.
error 1

@littleskunk
Copy link
Contributor Author

Workaround: Create a backup settings.json. If you see the error restore the backup. Make sure each drive get the old private key again. (The easy way to do that: Create a new backup every time you change storage location or add or remove a new drive)

@super3
Copy link
Contributor

super3 commented Jan 6, 2017

This should be really rare, as Storj Share would have to be writing to the config at the time of the shutdown. Don't think there is anything we can do here except recommend farmers with lots of data manually backup their settings and keys.

@super3 super3 closed this as completed Jan 6, 2017
@littleskunk
Copy link
Contributor Author

Sorry I have to reopen this issue. I would expect the same as you. The settings file should only be written if the user is changing any settings. In that case it would be nearly impossible to kill the GUI at the moment it is writing the file.

The current behavior is unexpected. The GUI writing the settings every time one of these values changes:

      "usedspace": {
        "size": "126.954",
        "unit": "GB"
      },
      "remainingspace": {
        "size": 0,
        "unit": "B"
      },
      "contracts": {
        "total": 34741
      },
      "lastChange": "2017-01-07T02:34:11.333Z"
    }

@littleskunk littleskunk reopened this Jan 7, 2017
@littleskunk
Copy link
Contributor Author

A possible solution would be to remove this from settings.json and store it somewhere else.

@ghost
Copy link

ghost commented Jan 14, 2017

don't leave it open after read or write i suggest? close it right away so any meta data is commit flushed to disk.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants