Corrupted protocol

Hi Francois,
I have a problem: when I open Brainstorm it gives me this error

Error: Cannot read protocol file “NAME_OF_MY_PROTOCOL.mat” (the protocol I am currently working on).

Than the interface opens, all my previous files are there, but I can’t save anything new. If I try to generate a new file, I get the error:

line 94: bst_save(line 94)
could not save file: …
Disk full, disconnected or read only (which is not the case)

I checked and the file NAME_OF_MY_PROTOCOL.mat is in the data folder, but if I try to open it on matlab it gives me

Unable to read MAT-file
/…/NAME_OF_MY_PROTOCOL.mat.
File might be corrupt.

Then when I stop Brainstorm, it says

BST> Saving protocol “NAME_OF_MY_PROTOCOL”…
Warning: unable to get file position from file.
BST> Error: Could not write file: /…/brainstorm_db/NAME_OF_MY_PROTOCOL/data/NAME_OF_MY_PROTOCOL.mat
BST> Disk full, disconnected or read-only.
BST> Emptying temporary directory…
BST> Brainstorm stopped.

It happened after I deleted (using the Brainstorm interface, NOT manually) 3 source files (projections on source template) that were stored in the sub-folder Group_analysis/@intra. Before all was working good.

What have I done wrongly? Is there a way to fix this without losing all the data? I already tried saving again the protocol from the interface. No errors while saving, but then nothing changes.

Thank you!

Cheers,

Rocco

Hi Rocco,

I don’t know what could corrupt your database like this.
This file NAME_OF_MY_PROTOCOL.mat is not necessary, it does not contain any data of interest. It just contains the structure of the protocol, so that Brainstorm does not have to parse the hard drive continuously.

Try the following:

  1. Make a backup of everything, in case anything goes wrong (you should always have full backups of your work)
  2. Menu File > Remove protocol > Only detach from database
  3. Delete the file NAME_OF_MY_PROTOCOL.mat
  4. Menu File > Load protocol > Load from folder > Select “brainstorm_db/NAME_OF_MY_PROTOCOL”

What happens after that?
If it does not work, there is something else corrupted, on top of the NAME_OF_MY_PROTOCOL.mat

Francois

Hi Francois,
there had been a problem with the server that interfered with Brainstorm while it was deleting the files and saving the protocol. I moved the database and reloaded it. Now it all works.

Thank you for your help!

Rocco