Page 1 of 1

Scratch "Bad Header" Issue

Posted: Fri Sep 21, 2012 11:16 am
by HiggleBottom
Hi.
I am trying to make a Scratch project, which I started on my home computer. I then edited the file on my RPi, saved it, exited out of X, and unplugged my pi. I then took my flash drive out of the Powered USB hub, plugged it into my computer, opened the file in Scratch and it came up with this error:

Code: Select all

Could not read project; file may be damaged: (Bad Header)
It took me ages to make this project and am really dissapointed. Any help would be appreciated.
Thanks!
P.S. The file comes up with 0KB when I look at it on my Windows Machine!

Re: Scratch "Bad Header" Issue

Posted: Fri Sep 21, 2012 12:32 pm
by ked
PM'ed you

Edit: Just noticed your PS. Have you tried copying it again?

Re: Scratch "Bad Header" Issue

Posted: Fri Sep 21, 2012 7:54 pm
by lightnin
This happens on many other systems as well when the storage media isn't unmounted properly - basically the file gets corrupted (as other files may as well). There's no known fix, I'm afraid. :(

Re: Scratch "Bad Header" Issue

Posted: Fri Sep 21, 2012 9:52 pm
by HiggleBottom
ked wrote:PM'ed you

Edit: Just noticed your PS. Have you tried copying it again?
What do you mean copy it again? Like copy and paste?

Re: Scratch "Bad Header" Issue

Posted: Fri Sep 21, 2012 10:53 pm
by ked
Does the RPi still boot from the card? Is so, can you see the file on the RPi in a terminal/file-manager and is the size still zero? If not zero then try opening it in Scratch.

Re: Scratch "Bad Header" Issue

Posted: Fri Dec 21, 2012 8:11 am
by Bibbleycheese
I have a similar problem.
Working Scratch files which I have uploaded to the Scratch website, then download to the R-Pi via Midori.
When I try to open the downloaded .sb file in Scratch, Scratch gives an error box;
Could not read project; file may be damaged: (bad header)
Where should I start looking to work out what is going on here?

Re: Scratch "Bad Header" Issue

Posted: Sun Dec 23, 2012 11:31 am
by simplesi
Cab you post a link to your projects so we can try them out please?

Simon

Re: Scratch "Bad Header" Issue

Posted: Sat Feb 09, 2013 7:44 pm
by bpalfreyman
Hi,

I'm having the same problem too as I made a big project on Scratch (20+ sprites, even more scripts and complicated variables) and I lost it this way after I unplugged the Raspberry PI and then booted it up again (very annoying). I believe it may be down to file size and complexity as I have tested with smaller, simple projects and I can still run those on Scratch without any errors and I have also tested at various stages of trying to build the project again - at the simpler stages the project still runs when I unplug the Pi and then reboot. Maybe the Pi just isn't powerful enough to handle those big projects on Scratch?

Re: Scratch "Bad Header" Issue

Posted: Sat Feb 09, 2013 10:46 pm
by simplesi
AFIK Its to do with the file system.

This is what I've been told by Linux gurus.

The file system on an RPi DOESN'T actually save a file when you asks it to - it just remembers that you asked it to and it decides that it will actually save it when you carefully shutdown.

The problem is that there is no nice shutdown menu option or desktop short cut and so everyone just unplugs their RPi and you end up with a corrupted filesystem

Most of the time, the corruptions are not important and are ignored/dealt with but Scratch files seem to take a big hit :(

So there best way (until the Raspian/LXDE overlords give us a nice menu option) is to create a shortcut that runs a sudo halt command and stick it on the desktop

regards
Simon

Re: Scratch "Bad Header" Issue

Posted: Sun Feb 10, 2013 2:17 pm
by simplesi
Oops :(
:embarrasing:

Just noticed that the logout button at bottom right has shutdown and reboot optionse when you click on it!

Wonder how long that's been there :)

So - no excuse for us all now :)

Simon

Re: Scratch "Bad Header" Issue

Posted: Sun Apr 21, 2013 2:27 pm
by lordcreeper
I am having the same problem with scratch

Re: Scratch "Bad Header" Issue

Posted: Sun Apr 21, 2013 6:25 pm
by simplesi
Just make sure you shutdown or reboot properly using the button at bottom right and your problems should go away :)

Simon

Re: Scratch "Bad Header" Issue

Posted: Wed May 18, 2016 7:35 pm
by backsmith
I have a powered usb hub and a modified USB lead (draws power, no data link) so I can use one hub to power the R-pi and also piggy back usb devices. All is well until I power on some USB powered speakers, this causes a power drain and the R-pi reboots. Even saving files does not protect them, as the most recently opened scratch file seems to bite the dust. Previously I managed to brick an SD card by doing the old turn it off and on again routine. I think the polite shut down is good advice.

I have now got my speakers on their own power supply.

The loss of an SD card is nothing compared to the upset 8 year old whose scratch projects were toast. I am now copying the files with cute ftp to an ftp drive on a windows machine in the house.

Re: Scratch "Bad Header" Issue

Posted: Tue May 24, 2016 5:14 pm
by timrowledge
See also https://github.com/raspberrypi/scratch/issues/196 - a fix for this (at least I hope so!) will be in the next release