Getting "Installation failed" on updates, even on success

A nice, warm, and cozy place for all third-party developers to congregate.

Getting "Installation failed" on updates, even on success

Postby mherger » Tue Feb 07, 2012 5:07 am

Hi,

I'm working on an add-on which is returning a generic "Failed to install addon" (ADDON_INST_FAIL) error message when I install it on top of an existing installation (update). At the same time I'm mailed an "Addon Installation suceeded" mail. And it does indeed work as expected.

What is causing this spurious failure message? I tried to figure out the code which is triggering it. But I couldn't figure out what is calling that JS method. Is this something in remove.sh which might be causing it? But why would I then get the success message mailed?

Michael
mherger
ReadyNAS Newbie
 
Posts: 11
Joined: Tue Feb 07, 2012 4:57 am
ReadyNAS: Duo v2

Re: Getting "Installation failed" on updates, even on succes

Postby mherger » Tue Feb 07, 2012 5:10 am

Oh, fwiw: I'm seeing this on firmwares 4.1.8 (NV+) up to the latest 5.3.3 (Duo v2)
mherger
ReadyNAS Newbie
 
Posts: 11
Joined: Tue Feb 07, 2012 4:57 am
ReadyNAS: Duo v2

Re: Getting "Installation failed" on updates, even on succes

Postby mdgm » Tue Feb 07, 2012 5:17 am

Do you have a link to your add-on?
Useful links: My ReadyNAS Gear|FAQ|Hardware Compatibility List|Docs: Setup Guide, Manual|Downloads|Unofficial Tips|GPL|MDGM on Twitter|MDGM's Unofficial Guides
NB: A ReadyNas is not an excuse not to have a backup. Fire, theft, multiple disk failures, other hardware failure, floods, user negligence etc. can all result in loss of data.
How we users can contact NETGEAR Technical Support | Australia: 1300 361 254 / Other Numbers|Online Submission
Unofficial Guide for Moving from Sparc ReadyNAS to x86 ReadyNAS|Using Gmail with the ReadyNAS|XRAID Volume Size Calculator
User avatar
mdgm
ReadyNAS Enthusiast
 
Posts: 28917
Joined: Tue Feb 17, 2009 9:34 pm
Location: Down Under
ReadyNAS: RN516

Re: Getting "Installation failed" on updates, even on succes

Postby mherger » Tue Feb 07, 2012 5:22 am

Yes, it's all in our public repository:

http://svn.slimdevices.com/slim/7.7/trunk/platforms/readynas/addon_template/
mherger
ReadyNAS Newbie
 
Posts: 11
Joined: Tue Feb 07, 2012 4:57 am
ReadyNAS: Duo v2

Re: Getting "Installation failed" on updates, even on succes

Postby mdgm » Tue Feb 07, 2012 5:33 am

What ReadyNAS platform is that for. Is that the Sparc one?

So you see the same error on Sparc, x86 and ARM?
Last edited by mdgm on Tue Feb 07, 2012 5:39 am, edited 2 times in total.
Useful links: My ReadyNAS Gear|FAQ|Hardware Compatibility List|Docs: Setup Guide, Manual|Downloads|Unofficial Tips|GPL|MDGM on Twitter|MDGM's Unofficial Guides
NB: A ReadyNas is not an excuse not to have a backup. Fire, theft, multiple disk failures, other hardware failure, floods, user negligence etc. can all result in loss of data.
How we users can contact NETGEAR Technical Support | Australia: 1300 361 254 / Other Numbers|Online Submission
Unofficial Guide for Moving from Sparc ReadyNAS to x86 ReadyNAS|Using Gmail with the ReadyNAS|XRAID Volume Size Calculator
User avatar
mdgm
ReadyNAS Enthusiast
 
Posts: 28917
Joined: Tue Feb 17, 2009 9:34 pm
Location: Down Under
ReadyNAS: RN516

Re: Getting "Installation failed" on updates, even on succes

Postby mherger » Tue Feb 07, 2012 5:38 am

mdgm wrote:What ReadyNAS platform is that for. Is that the Sparc one?
So you see the same error on Sparc, x86 and ARM?


We're using the same script for all three platforms. And yes, we're seeing that message on all of them.

What's odd is that we used to have an older package which was originally created for the good ol' sparc models. With that old package we would only get the error on 4.2+, but not on the sparc's 4.1.8. With the new package it's the same on all of them.
mherger
ReadyNAS Newbie
 
Posts: 11
Joined: Tue Feb 07, 2012 4:57 am
ReadyNAS: Duo v2

Re: Getting "Installation failed" on updates, even on succes

Postby mdgm » Tue Feb 07, 2012 5:42 am

Ah, I found the compiled add-on here: http://downloads.slimdevices.com/nightly/?ver=7.7
Useful links: My ReadyNAS Gear|FAQ|Hardware Compatibility List|Docs: Setup Guide, Manual|Downloads|Unofficial Tips|GPL|MDGM on Twitter|MDGM's Unofficial Guides
NB: A ReadyNas is not an excuse not to have a backup. Fire, theft, multiple disk failures, other hardware failure, floods, user negligence etc. can all result in loss of data.
How we users can contact NETGEAR Technical Support | Australia: 1300 361 254 / Other Numbers|Online Submission
Unofficial Guide for Moving from Sparc ReadyNAS to x86 ReadyNAS|Using Gmail with the ReadyNAS|XRAID Volume Size Calculator
User avatar
mdgm
ReadyNAS Enthusiast
 
Posts: 28917
Joined: Tue Feb 17, 2009 9:34 pm
Location: Down Under
ReadyNAS: RN516

Re: Getting "Installation failed" on updates, even on succes

Postby mdgm » Tue Feb 07, 2012 5:45 am

When I run install.sh via the command line, I get an error:
Code: Select all
sh install.sh
grep: /c/.squeezeboxserver/prefs/server.prefs: No such file or directory
Making sure Logitech Media Server is stopped already: No squeezeboxserve found running; none killed.
Starting Logitech Media Server: .


I'll try running it again to simulate an upgrade.

Edit: no problems with update via command line.
Useful links: My ReadyNAS Gear|FAQ|Hardware Compatibility List|Docs: Setup Guide, Manual|Downloads|Unofficial Tips|GPL|MDGM on Twitter|MDGM's Unofficial Guides
NB: A ReadyNas is not an excuse not to have a backup. Fire, theft, multiple disk failures, other hardware failure, floods, user negligence etc. can all result in loss of data.
How we users can contact NETGEAR Technical Support | Australia: 1300 361 254 / Other Numbers|Online Submission
Unofficial Guide for Moving from Sparc ReadyNAS to x86 ReadyNAS|Using Gmail with the ReadyNAS|XRAID Volume Size Calculator
User avatar
mdgm
ReadyNAS Enthusiast
 
Posts: 28917
Joined: Tue Feb 17, 2009 9:34 pm
Location: Down Under
ReadyNAS: RN516

Re: Getting "Installation failed" on updates, even on succes

Postby mherger » Tue Feb 07, 2012 5:51 am

Thanks for the hint - yeah, will check for the file's existence.

How would I unpack an addon so I could run the script manually? It's not a simple tarball, is it?
Last edited by mherger on Tue Feb 07, 2012 5:54 am, edited 1 time in total.
mherger
ReadyNAS Newbie
 
Posts: 11
Joined: Tue Feb 07, 2012 4:57 am
ReadyNAS: Duo v2

Re: Getting "Installation failed" on updates, even on succes

Postby WhoCares? » Tue Feb 07, 2012 5:52 am

Most likely cause is that you're restarting Apache either in install.sh or remove.sh (the latter being the most likely cause). This will interrupt the installation process which itself is a subprocess of Apache in such a way that it will emit the "Installation failed" message. To fix this, do NOT restart Apache using either the "kill ..." or the "-k restart" method. Instead use "-k graceful" which will only restart those Apache processes that aren't occupied with a task immediately. Thus, the install subprocess will finish normally first and once that it is done it will also restart.

-Stefan

BTW: This problem currently should be specific o the ARM platform so I'm wondering why you're seeing it on Sparc and x86 as well.
Follow me on Twitter or visit my web site
If you like my add-ons (Image downloads so far), please consider a --> donation. and get your entry in the "Hall of Fame".
(Current download to donation ratio: 0,19% [405:1])
User avatar
WhoCares?
ReadyNAS Add-ons Expert
 
Posts: 2923
Joined: Tue Jan 15, 2008 6:34 am
Location: At my desk ;)
ReadyNAS: Pro

Re: Getting "Installation failed" on updates, even on succes

Postby WhoCares? » Tue Feb 07, 2012 5:57 am

And lest I forget: Another cause may be (depending on the firmware version) that the script produces an error somewhen during it's run (or in case of ARM: produces some sort of output to STDOUT). This also will trigger the "Installation failed" message.

-Stefan
Follow me on Twitter or visit my web site
If you like my add-ons (Image downloads so far), please consider a --> donation. and get your entry in the "Hall of Fame".
(Current download to donation ratio: 0,19% [405:1])
User avatar
WhoCares?
ReadyNAS Add-ons Expert
 
Posts: 2923
Joined: Tue Jan 15, 2008 6:34 am
Location: At my desk ;)
ReadyNAS: Pro

Re: Getting "Installation failed" on updates, even on succes

Postby mherger » Tue Feb 07, 2012 5:58 am

WhoCares? wrote:And lest I forget: Another cause may be (depending on the firmware version) that the script produces an error somewhen during it's run (or in case of ARM: produces some sort of output to STDOUT). This also will trigger the "Installation failed" message.


Oh, this is very likely to happen... I'll review my script and add a few redirects to /dev/null. Thanks for that hint!
mherger
ReadyNAS Newbie
 
Posts: 11
Joined: Tue Feb 07, 2012 4:57 am
ReadyNAS: Duo v2

Re: Getting "Installation failed" on updates, even on succes

Postby mdgm » Tue Feb 07, 2012 6:02 am

The remove script does restart apache using "killall -USR1 apache-ssl". So as suggested replace this with
Code: Select all
apache-ssl -f /etc/frontview/apache/httpd.conf -k graceful
Useful links: My ReadyNAS Gear|FAQ|Hardware Compatibility List|Docs: Setup Guide, Manual|Downloads|Unofficial Tips|GPL|MDGM on Twitter|MDGM's Unofficial Guides
NB: A ReadyNas is not an excuse not to have a backup. Fire, theft, multiple disk failures, other hardware failure, floods, user negligence etc. can all result in loss of data.
How we users can contact NETGEAR Technical Support | Australia: 1300 361 254 / Other Numbers|Online Submission
Unofficial Guide for Moving from Sparc ReadyNAS to x86 ReadyNAS|Using Gmail with the ReadyNAS|XRAID Volume Size Calculator
User avatar
mdgm
ReadyNAS Enthusiast
 
Posts: 28917
Joined: Tue Feb 17, 2009 9:34 pm
Location: Down Under
ReadyNAS: RN516

Re: Getting "Installation failed" on updates, even on succes

Postby WhoCares? » Tue Feb 07, 2012 6:04 am

mherger wrote:How would I unpack an addon so I could run the script manually? It's not a simple tarball, is it?

Code: Select all
#!/bin/bash
ARCH=`uname -m`
if [ "${ARCH}" == "padre" ]; then
  BSIZE=512
else
  BSIZE=16384
fi

if [ -f $1 ]; then
  TFIL=`basename $1 .bin`
  TFIL="${TFIL}.tar"
  dd if=$1 of=${TFIL} bs=${BSIZE} skip=1
else
  echo "Add-on file doesn't exist"
fi


From the top of my head so there may be syntax errors in there ;)

-Stefan
Follow me on Twitter or visit my web site
If you like my add-ons (Image downloads so far), please consider a --> donation. and get your entry in the "Hall of Fame".
(Current download to donation ratio: 0,19% [405:1])
User avatar
WhoCares?
ReadyNAS Add-ons Expert
 
Posts: 2923
Joined: Tue Jan 15, 2008 6:34 am
Location: At my desk ;)
ReadyNAS: Pro

Re: Getting "Installation failed" on updates, even on succes

Postby WhoCares? » Tue Feb 07, 2012 6:06 am

mdgm wrote:The remove script does restart apache using "killall -USR1 apache-ssl". So as suggested replace this with
Code: Select all
apache-ssl -f /etc/frontview/apache/httpd.conf -k graceful


I prefer to use this:
Code: Select all
/usr/sbin/apache-ssl -f /etc/frontview/apache/httpd.conf -t && /usr/sbin/apache-ssl -f /etc/frontview/apache/httpd.conf -k graceful

This makes sure that apache only gets restarted if it has a valid config. Prevents killing off Frontview ..

-Stefan
Follow me on Twitter or visit my web site
If you like my add-ons (Image downloads so far), please consider a --> donation. and get your entry in the "Hall of Fame".
(Current download to donation ratio: 0,19% [405:1])
User avatar
WhoCares?
ReadyNAS Add-ons Expert
 
Posts: 2923
Joined: Tue Jan 15, 2008 6:34 am
Location: At my desk ;)
ReadyNAS: Pro

Next

Return to ReadyNAS Developers Network



Who is online

Users browsing this forum: No registered users and 5 guests