My app freezes when installing new update

Asked by BS0D

Hello,

I've finally managed to get sparkle to work... Everything works fine, up until I click on "Install and Relaunch"

The dialog shows a blue progress bar, but then freezes immediately (and I have to force quit my app).

For the info, I may have a problem because the name of my app contains a "&" character and I cannot change it. I found a workaround by writing it in html signs (" & ") in the RSS feed, so it stills detects the update but won't install it.
Could that have anything to do with it?

What could be the cause of this ?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Solved by:
BS0D
Solved:
Last query:
Last reply:
Revision history for this message
Andy Matuschak (andymatuschak) said :
#1

Hm. That could conceivably be it. Anything in the console?

Revision history for this message
BS0D (bs0d) said :
#2

How do I get the console report ?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#3

If you're running from Xcode, Run -> Console. If you're running elsewhere, /Applications/Utilities/Console.app

Revision history for this message
BS0D (bs0d) said :
#4

[Session started at 2009-01-07 19:43:39 +0100.]
2009-01-07 19:43:39.833 Search&Replace[13129:10b] Error loading /Library/ScriptingAdditions/Satimage.osax/Contents/MacOS/Satimage: dlopen(/Library/ScriptingAdditions/Satimage.osax/Contents/MacOS/Satimage, 262): no suitable image found. Did find:
 /Library/ScriptingAdditions/Satimage.osax/Contents/MacOS/Satimage: mach-o, but wrong architecture
Search&Replace: OpenScripting.framework - scripting addition /Library/ScriptingAdditions/Satimage.osax declares no loadable handlers.

It says something about scripting additions, but nothing that seems interesting ...

Revision history for this message
BS0D (bs0d) said :
#5

OK, isnt there a way to set up Sparkle so that it just downloads the update to a folder without trying to install it instead ?
I'd prefer that solution anyway ... it leaves the users the choice to backup the old version if they want to...

Revision history for this message
Andy Matuschak (andymatuschak) said :
#6

No, Sparkle doesn't support independently saving the updates. There's nothing in the console that says Sparkle? What about a crash log? If it actually crashed, one will have been recorded. The stack trace would be useful in diagnosing this problem.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#7

If the app freezes instead of crashing, please attach samples instead of a crashlog.

Revision history for this message
BS0D (bs0d) said :
#8

hmm... attach samples of what ?
There is nothing in the console, and the crash report doesnt even mention my app.

I figure the app doesnt even crash or freeze actually, because I realized I can still close it normally and ignore the update dialog thats on top. Seems like it's just sparkle that freezes ...

I really dont know what to do

Revision history for this message
BS0D (bs0d) said :
#9

what are the conditions for a successful update ?

- does it have to be a zip or a dmg, or either ?
- does it have a specific name pattern ?
- do I have to add the "length" attribute" to the RSS feed (I got rid of it) ? And how can I know what the length is supposed to be ?

here's the link to my feed : http://search-replace.fr.tc/downloads/updates.xml
and the application itself (with sparkle included) : http://search-replace.fr.tc/downloads/myapp.zip

Can you please tell me more about what's wrong ?

Revision history for this message
Hofman (cmhofman) said :
#10

The "&" is inside the *URL*, not a *XML value*. Therefore you must use a URL-escape rather than an XML-escape, which is %26 rather than &.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#11

Samples are like a snapshot of a piece of software in time. They give you an idea of what methods are being executed. They're an incredibly useful debugging and optimization tool. If you're unfamiliar with sampling, the easiest way to take a sample is through Activity Monitor (View -> Sample Process). Shark and Instruments provide much more information if you're comfortable with them.

If any of the things you listed (or any other known requirements) are amiss, Sparkle will complain specifically about the problem in the logs. You must have stumbled upon some edge case no one's found yet.

Hofman has definitely identified a problem in your appcast, though I'm not sure it's what's actually causing this issue, since you say Sparkle gets past the download phase. Try fixing it, though, and let us know what happens.

Revision history for this message
BS0D (bs0d) said :
#12

Right, so I used the "%26" sign instead. Kept telling me in the console that the file didnt exist.
So I renamed my app with "%26" instead of "&" and it did find the file, but same thing : freezes after downloading, when I click on "install and relaunch".
But still, the name of the app is therefore not the same as that of the update.

As for the sample when the app is frozen, here it is (I would have no clue what those lines mean...):
http://pastebin.com/m3742a3

Revision history for this message
Andy Matuschak (andymatuschak) said :
#13

The URL in your appcast presently is a 404. Set the URL to point to an actual location.

Revision history for this message
BS0D (bs0d) said :
#14

the URL is the one mentioned in my message above, and it works fine for me ... the file is there I just checked.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#15

1. curl http://search-replace.fr.tc/downloads/Search%26Replace.app 1.2.2.zip | open -f
2. Copy the enclosure URL.
3*. curl "PASTE_ENCLOSURE_URL_HERE" | open -f
4. Note that the enclosure URL results in a 404.

* At time of writing, that would read:
curl "http://search-replace.fr.tc/downloads/Search%26Replace.app 1.2.2.zip" | open -f

Revision history for this message
Andy Matuschak (andymatuschak) said :
#16

Argh, fail. That should read:

1. curl http://search-replace.fr.tc/downloads/updates.xml | open -f
2. Copy the enclosure URL.
3*. curl "PASTE_ENCLOSURE_URL_HERE" | open -f
4. Note that the enclosure URL results in a 404.

* At time of writing, that would read:
curl "http://search-replace.fr.tc/downloads/Search%26Replace.app 1.2.2.zip" | open -f

Revision history for this message
BS0D (bs0d) said :
#17

huh?
sorry I may come off as dumb here, but I don't get your point !

the file downloads fine ... the progress bar in the update dialog does not say anything about a failed download ...
???

Revision history for this message
Andy Matuschak (andymatuschak) said :
#18

Run those commands in the terminal and you'll see what I mean. Is http://search-replace.fr.tc/downloads/updates.xml actually the URL of the feed you're telling Sparkle to use?

Revision history for this message
BS0D (bs0d) said :
#19

Yes, the SUFeedURL is the URL of the feed I'm using, I just double-checked my info.plist file in my project.

I do see that its a 404 when running those commands...

with this URL : http://search-replace.fr.tc/downloads/SearchReplace.app_1.2.2.zip, the command above "works", or at least its not a 404. But it says the file is in the wrong format or something ...

so what can I do about it? does it have anything to do with the "application/octet-stream" tag ?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#20

Please provide the actual error Sparkle provides when using the URL you just mentioned.

Revision history for this message
BS0D (bs0d) said :
#21

" The document "open_dfuZIWGU.txt" could not be opened. The file is not in the proper format.
The file appears damaged, incomplete, or in a format other than that expected. "

Revision history for this message
Andy Matuschak (andymatuschak) said :
#22

Right, okay, that's not the error Sparkle provides. That's the error open provides.

So what does Sparkle do when that URL is used for the enclosure?

Revision history for this message
BS0D (bs0d) said :
#23

but what does "open_dfuZIWGU.txt" have to do with that ?

Revision history for this message
BS0D (bs0d) said :
#24

the same thing happens with sparkle with that URL : it freezes !

Revision history for this message
BS0D (bs0d) said :
#25

OK, sparkle doesnt support downloading the update to a specific location.
But is there a way to configure it so that it just tells the user a new version is available ( and display a link or something ) instead ?

I'm tired of waiting and trying to get it to work in vain ... it's been weeks and I'm still waiting to release the new version of my app!!

Revision history for this message
BS0D (bs0d) said :
#26

or do you by any chance know of another free solution for OS X developer updates ?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#27

"the same thing happens with sparkle with that URL : it freezes !"

So two different URLs both result in the successful download of the file, without you moving the file on the server? That doesn't make any sense at all.

You could find more about the problem by debugging and breaking when the app stalls.

"But is there a way to configure it so that it just tells the user a new version is available ( and display a link or something ) instead ?"

No, sorry.

"or do you by any chance know of another free solution for OS X developer updates ?"

You could try http://code.google.com/appengine/. I haven't heard much about it.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#28
Revision history for this message
Hofman (cmhofman) said :
#29

> Right, so I used the "%26" sign instead. Kept telling me in the console that the file didnt exist.
> So I renamed my app with "%26" instead of "&" and it did find the file, but same thing : freezes after downloading, when I click on "install and relaunch".
> But still, the name of the app is therefore not the same as that of the update.

Now this sounds suspicious, it makes no sense. If you did what you said, things are not supposed to work. The "%26" is ONLY an escape for the "&" in the URL. So you should certainly not be escaping the "&" in the app name. If you do, Sparkle won't find your app back, because it will search for the wrong name.

And are you really sure it freezes? Does it become unresponsive? Did you actually wait long enough? And did you make a sample? Eg, in some (recent) versions of Sparkle the progress bar during installations stops animating, so it may just LOOK like it's not doing anything. To know for sure, you need to make a sample.

> I'm tired of waiting and trying to get it to work in vain ... it's been weeks and I'm still waiting to release the new version of my app!!
> or do you by any chance know of another free solution for OS X developer updates ?

This is totally unfair to Andy. You have provided almost no useful information, it's just completely impossible to know what's going on based on your info. And then you haven't responded with the essential debugging information that was requested. And you keep changing your info (like the URLs).

Revision history for this message
BS0D (bs0d) said :
#30

Hofman,

I know I may have come off as rude there, but don't you dare call me a liar. I only report what happens when I do what I say I do. I just get irritated because everything works so well for just about everyone, and I'm stuck with this problem that no one seems to be able to help me fix.

Moreover, what I said was NOT against Andy whatsoever: I'm just looking for a clear, fast solution for an update framework which actually works for me. Andy obviously did a great job, since so many developers use Sparkle, and I'm not in a position to deny that (and I didn't, actually). Andy deserves and has all my respect, despite what you could misinterpret as disrespect from my tone of exasperation.

Also, I gave Andy all the info he asked for (what else am I supposed to do?) when he kindly tried to help me.
You obviously havent even read what I posted yourself, before asking your questions: the sample Andy asked for is right here: http://pastebin.com/m3742a3

And I'm not THAT stupid: before posting here, I waited about 7-8 minutes for the update to "finish", which it never did, and my computer started to heat up dangerously (150% of CPU resource used by my application).
Are you going to tell me it is supposed to take that long to install a 500Ko application? Come on! So obviously, my deduction is that it was frozen, yes.

Finally, the XML file's URL has not changed once since I started looking for a solution to my problem, only the enclosure URL and the name of the update file (had to try different things, right?).

Understand that after weeks of struggling with sparkle, I just want to give up because Andy himself has never run into this problem, and I'm getting desperate in case you didn"t get that from the tone of my message.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#31

It's cool, guys. Chill out.

If you're not familiar with the debugger, I'll try to step through the copy of the app you posted and figure out what's wrong sometime this weekend.

Revision history for this message
Andy Matuschak (andymatuschak) said :
#32

Aha. When I said "You must have stumbled upon some edge case no one's found yet." I had no idea!

Your app has no CFBundleVersion, a required bundle attribute, and one that really should have made things crash and burn a lot sooner. You've got a human-readable version string, but no computer-readable version string. Set a CFBundleVersion in the to-be-updated version of the app and in the update to make Sparkle work as expected.

I guess I should add some kind of "holy crap you're breaking everything" check for that in Sparkle; it shouldn't have failed so spectacularly.

Revision history for this message
BS0D (bs0d) said :
#33

JESUS CHRIST, Andy !!
Thank you, I cannot believe that it was so basic ...

Thanks for your time, patience and precious help. Everything works fine now.

Revision history for this message
Hofman (cmhofman) said :
#34

BS0D, I never said you're a liar. I apologize for not carefully reading your answer. But remember that I'm also talking about your previous question, which is basically the beginning of this one. As I already discarded the most obvious explanations (as you told me that your app had a correct CFBundleVersion), I just tried to help you by discarding other possibilities. Note that I explained WHY I said you could have possibly confused a bug in some versions of Sparkle as a hang, based on your description. Certainly in hindsight you could have saved yourself a week long of frustration by 1) providing a link to the appcast a week ago when first asked 2) give a correct answer to my CFBundleVersion question 3) try to understand yourself what CFBundleVersion is. You can help yourself lot by trying to understand the basics of xcode development, the Xcode Documentation is your friend (e.g. you could have quickly found out what CFBundleVersion is by typing it in the Search field). I'm just trying to help you avoid this is in the future.

Revision history for this message
Ovidiu (ovycom) said :
#35

Hello

A have a same problem.

Everything works fine, up until I click on "Install and Relaunch"

The dialog shows a blue progress bar, but then freezes immediately (and I have to force quit my app).

After I click "Install and Relaunch" I see that in background is replaced the app, but window is freeze, and, after restart app is Updated.