Difference between revisions of "App Install"

From Amahi Wiki
Jump to: navigation, search
Line 25: Line 25:
 
We take these seriously and have incorporated additional error checking/prevention methods.  Unfortunately they don't catch everything.
 
We take these seriously and have incorporated additional error checking/prevention methods.  Unfortunately they don't catch everything.
  
 +
= Reasons for Failure =
 
Reasons for failure vary, but the most common are:
 
Reasons for failure vary, but the most common are:
 
<ul>
 
<ul>
Line 58: Line 59:
 
</ul></ul>
 
</ul></ul>
  
 +
= Recipe for Success =
 
There are some recommendation users can follow to help correct or prevent these problems.
 
There are some recommendation users can follow to help correct or prevent these problems.
  
Line 73: Line 75:
 
# [[Submit Bug Report|Submit a bug report]].  Provide details to help with [[App_troubleshooting|debugability]] of the issue.
 
# [[Submit Bug Report|Submit a bug report]].  Provide details to help with [[App_troubleshooting|debugability]] of the issue.
  
 +
= Failed Install Clean Up =
  
<!--== MANUAL CLEAN UP ==
+
:'''NOTE:''' We will use '''owncloud''' as an example of the application that failed to install.
An application install was unsuccessful, but it appears partially installed.  To return your HDA to a safe state for another install attempt, the following may help:
+
 
* Check /var/hda/web-apps directory and look for the app.   
+
An application install was unsuccessful, but it appears partially installed.  This often happens and repeatedly trying to install without clean up results in multiple failed attempts.  For example, 4 failed attempts of [https://www.amahi.org/apps/owncloud ownCloud] would create owncloud, owncloud1, owncloud2, owncloud3.
** The application short URL is the name of the directory. For example, Adminer would be adminer.
+
 
** Remove the directory
+
To return your HDA to a safe state for another install attempt, the following may help:
* Check the HDA database (hda_production, apps table)
+
* Navigate to Network>DNS Aliases in the Amahi Dashboard
 +
** Make note of the URL name
 +
** Remove entry for the failed application by selecting Delete
 +
<ul>
 +
<li>The next steps must be done from the command line as ''root'' user:</li>
 +
<ul>
 +
<li>Navigate to /etc/httpd/conf.d and determine file name to remove</li>
 +
ls -al
 +
<li>Remove ####-app.conf (substitute the number for #### and URL name for app) file</li>
 +
cd /etc/httpd/conf.d
 +
  rm -rf 1001-owncloud.conf
 +
<li>Then as ''root'' user, restart apache</li>
 +
  sysemctl restart httpd
 +
<li>Next, navigate to /var/hda/web-apps</li>
 +
cd /var/hda/web-apps
 +
<li>Remove the app directory</li>
 +
rm -rf owncloud
 +
</ul></ul>
 +
* Finally check the HDA database (hda_production, apps table).  The safest way is to use a web application such as [https://www.amahi.org/apps/adminer Adminer] or [https://www.amahi.org/apps/phpmyadmin phpMyAdmin].
 
** Look to see if there is an entry for the app that failed to install correctly.
 
** Look to see if there is an entry for the app that failed to install correctly.
** Remove that row if it exists.
+
** Remove the row(s) that exist for the application
<pre>MariaDB [hda_production]> select id,name from webapps;
+
<br />
 +
:'''EXAMPLE'''
 +
<blockquote><pre>MariaDB [hda_production]> select id,name from webapps;
 
+----+------------+
 
+----+------------+
 
| id | name      |
 
| id | name      |
 
+----+------------+
 
+----+------------+
 
|  1 | phpsysinfo |
 
|  1 | phpsysinfo |
|  2 | cups      |
+
|  4 | owncloud  |
|  4 | zm        |
+
|  5 | owncloud1  |
|  5 | zm1        |
+
|  6 | owncloud2  |
|  6 | zm2        |
+
|  7 | owncloud3 |
|  7 | zm3        |
 
|  8 | zm4        |
 
| 9 | zm5        |
 
| 10 | zm6        |
 
| 12 | zm7        |
 
| 14 | zm8        |
 
 
+----+------------+
 
+----+------------+
11 rows in set (0.00 sec)</pre>
+
5 rows in set (0.00 sec)</pre></blockquote>
* Check /etc/httpd/conf.d directory for a file that is associated with the app.  ** For example, 1001-adminer.conf would be for Adminer.
+
 
** If it exists, remove it.1
+
Once these steps are complete, it should be safe to try and install the application.  Monitor the '''/var/log/amahi-app-installer.log''' file for progress and errors via command line:
** Restart httpd.service-->
+
tail -f /var/log/amahi-app-installer.log

Revision as of 01:08, 11 August 2016

Occasionally Amahi applications fail to install properly. This is often noted by error messages in the application install log (/var/log/amahi-app-install.log).

=======  app install begin      @  2014-05-03 07:42:37 -0500 ==========
Installing   app id qf1tweahyo under /var/hda/platform/html/script/.. ENV=produc
tion
NOTICE: redirected 'http://downloads.sourceforge.net/project/linfo/Linfo%20Stabl
e%20Releases/linfo-1.11.tar.gz' --> 'http://iweb.dl.sourceforge.net/project/linf
o/Linfo%20Stable%20Releases/linfo-1.11.tar.gz' ...
file /var/hda/tmp/amahi-download-cache/9306c736dc7197b9a3ed6b4c9395d4ab6e779a48
written in cache
Your HDA services have been restarted.
Your HDA services have been restarted.
mv: cannot stat ‘unpack’: No such file or directory
sed: can't read html/config.inc.php: No such file or directory
chown: cannot access ‘html/lib’: No such file or directory
/tmp/run_script20140503-14160-1huv0uh: line 47: html/config.inc.php: No such fil
e or directory
App: Linfo installed
=======  app install end        @  2014-05-03 07:42:43 -0500 ==========

Other times, you may receive notice in the Dashboard.

DashboardAppError.png

We take these seriously and have incorporated additional error checking/prevention methods. Unfortunately they don't catch everything.

Reasons for Failure

Reasons for failure vary, but the most common are:

  • Network connection
  • Install script:
    • Taking too long
      =======  app install begin      @  2014-05-03 14:33:00 -0400 ==========
      Installing   app id yi7uxa8mlb under /var/hda/platform/html/script/.. ENV=production
      Your HDA services have been restarted.
      Your HDA services have been restarted.
      NOTE: file /var/hda/tmp/amahi-download-cache/956319338e8752e6a8f544423df61187d8b7e320 written in cache
      /var/hda/platform/html/lib/system_utils.rb:66:in `run_script': run_script had to 
      KILL this script. it was taking too long. sorry. (RuntimeError)
              from /var/hda/platform/html/app/models/app.rb:241:in `block in install_bg'
              from /var/hda/platform/html/app/models/app.rb:240:in `chdir'
              from /var/hda/platform/html/app/models/app.rb:240:in `install_bg'
              from /var/hda/platform/html/script/install-app:86:in `install_or_uninstall'
              from /var/hda/platform/html/script/install-app:107:in `main'
              from /var/hda/platform/html/script/install-app:119:in `<main>'
    • Incorrect syntax
    • Insufficient privileges
  • Application source file is unavailable:
    • New version
    • File moved
    • Wrong SHA1 hash
      WARNING: primary downloaded file /tmp/amahi-download-
      cache/b224eae4f30c011cbe6eae3c81d662f199eaa85f did not pass signature check - got 
      2da58737f99c63f47983db27789cf4b989975220, expected 
      b224eae4f30c011cbe6eae3c81d662f199eaa85f

Recipe for Success

There are some recommendation users can follow to help correct or prevent these problems.

DON'T

  1. Refresh your web browser or navigate from the page while an application is installing.
  2. Try to install an application after it initially fails. Need to diagnose issue.


DO

  1. Look at the log for details of why the app install failed.
  2. View the Dashboard Apps tab, Installed section for the app.
  3. Check /var/hda/web-apps to ensure the app did not partially install.
  4. Search the forums for a similar issue and potential solution.
  5. Visit the IRC, #amahi channel for immediate assistance.
  6. Submit a bug report. Provide details to help with debugability of the issue.

Failed Install Clean Up

NOTE: We will use owncloud as an example of the application that failed to install.

An application install was unsuccessful, but it appears partially installed. This often happens and repeatedly trying to install without clean up results in multiple failed attempts. For example, 4 failed attempts of ownCloud would create owncloud, owncloud1, owncloud2, owncloud3.

To return your HDA to a safe state for another install attempt, the following may help:

  • Navigate to Network>DNS Aliases in the Amahi Dashboard
    • Make note of the URL name
    • Remove entry for the failed application by selecting Delete
  • The next steps must be done from the command line as root user:
    • Navigate to /etc/httpd/conf.d and determine file name to remove
    • ls -al
    • Remove ####-app.conf (substitute the number for #### and URL name for app) file
    • cd /etc/httpd/conf.d rm -rf 1001-owncloud.conf
    • Then as root user, restart apache
    • sysemctl restart httpd
    • Next, navigate to /var/hda/web-apps
    • cd /var/hda/web-apps
    • Remove the app directory
    • rm -rf owncloud
  • Finally check the HDA database (hda_production, apps table). The safest way is to use a web application such as Adminer or phpMyAdmin.
    • Look to see if there is an entry for the app that failed to install correctly.
    • Remove the row(s) that exist for the application


EXAMPLE
MariaDB [hda_production]> select id,name from webapps;
+----+------------+
| id | name       |
+----+------------+
|  1 | phpsysinfo |
|  4 | owncloud   |
|  5 | owncloud1  |
|  6 | owncloud2  |
|  7 | owncloud3  |
+----+------------+
5 rows in set (0.00 sec)

Once these steps are complete, it should be safe to try and install the application. Monitor the /var/log/amahi-app-installer.log file for progress and errors via command line:

tail -f /var/log/amahi-app-installer.log