Upgrade to quantal

From Finninday
Jump to: navigation, search

upgrade process

sofficerc
take new version

/etc/gdm/custom.conf
take new verison

dpkg problem report to developers
including /etc/hobbit/clientlaunch.cfg
problem in xymon-client
problem cannot be reported.  you have already encountered this package installation failure.

upgrade did not complete.
rebooted
came up clean
xymon was not running

fixing

xymon package clean up

couldn't find any installer logs that told more about the failure or current state

ran apt-get upgrade to clean up 2 packages not fully installed or removed setting up xymon-client crash, maxreports is already reached

apt-get autoremove: 139 packages failed to configure xymon-client

dpk-reconfigure xymon-client xymon-client is broken or not fully installed

found a bug on launchpad (1069227) that said a fix was to have a process running as hobbit that the script could kill. This worked and apt-get now reports that all packages are installed.

mediawiki schema update

wiki and hobbit are not running.

trying to create a new page fails with a page reset. The apache error logs show child pid exit signal segmentation fault (11)

A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script Query: SELECT lc_value FROM `mw_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'deps' LIMIT 1 Function: LCStore_DB::get Error: 1146 Table 'wikidb.mw_l10n_cache' doesn't exist (localhost)

php maintenance/update.php

fixed it.

xymon/hobbit name change

trying to get to xymon generates this error in apache error logs: file does not exist: /var/lib/hobbit


did apt-get remove xymon apt-get install xymon

that didn't get me much closer I was left with lots of broken links as a result of the name change from hobbit to xymon

apt-get purge xymon apt-get install xymon that didn't seem to work either, but after five minutes it ran and showed a working clean install Now I need to restore my custom configs, but in xymon directories instead of hobbit directories

first, rewrite puppet module that pushes my config for hobbit

lost my cputemp, heater, and bandwidth scripts, so must rewrite them

puppet module is much cleaner now, controlling just custom snippets instead of files that will be overwritten with the next upgrade.

phpmyrecipebook: mysql config, session managment, yucky schema upgrade

lost ability to view the recipebook. Trying to view a page yields a blank page with no error. The apache error logs show a php seg fault: PHP Fatal error: Call to undefined function session_register() in /var/www/phprecipebook-3.01/libs/phpsm/core_API.php on line 94

The session_register() function is deprecated in php 5.3 and removed in php 5.4 I happen to be using php 5.4.6 now.

Upgraded to the latest code for phprecipebook (4.04b) and the error is still present.

The line of code is: session_register($g_sm_session_id);

phpdocs (php.net/manual/en/function.session-register.php) say that the prefered use is $_SESSION["zim"] = "An invader from another planet.";

commenting out the session_register() function got the app to come up without a session But nothing is visible in the database.

A schema upgrade is required. I found the script in sql/upgrade mysql --user=root --password=password food <recipedb-3.00-4.00.sql ERROR 1060 at line 104: Duplicate column name 'restaurant_website'

did it work? no, it appears nothing happened. Actually something happened. The script is not idempotent so I must create a new script to make the changes that were not made by the previous run.

The schema update completed after I eliminated the changes that had previously been made. But the site does not populate with any data from mysql. Apache error log shows mysql_pconnect(): Can't connect to local MySQL server through socket '/var/lib/mysqld/mysqld.sock' (2) in /var/www/food/libs/ad0db5/drivers/adodb-mysql.inc.php on line 383, referer: http://www.finninday.net/food/index.php

has mysql changed? /etc/mysql/my.cnf looks like the new location of the socket is /var/run/mysqld/mysqld.sock making the corresponding change in custom_inc.php makes the site display all our hard-won recipes. phew.

But all my restaurant reviews are gone. Bummer.

The query that displays restaurants looks like this: select * from $db_table_restaurants left join $db_table_prices on price_id = restaurant_price where restaurant_user = '" . $DB_LINK->addq($SMObj->getUserID(), get_magic_quotes_gpc()) ."' order by restaurant_name";

That query is in modules/restaurant/index.php

select * from recipe_restaurants; shows 51 in the table.

It looks like I can't see anything without a session object. So I should work on fixing the session problem first.

xymon: load apache rewrite module

Log rotate appears wacky. The most recent apache2/access.log is access.log.1. access.log exists, but is empty.

Trying to restart apache gives a configuration error. configtest failed. syntax error on line 62 of conf.d/xymon Xymon was relying on the rewrite module being enabled, but it wasn't. Now a restart works and the log rotation looks good.

phprecipebook: fiddle with source query for restaurants

I can log into the recipebook now and make changes, but still no restaurants are displayed. When logged in the query sees me as user 3 when all the restaurants are set to user 1, so none are displayed.

Trying to log out triggers a white screen and a fatal php error: call to undefined function session_unregister() on phpSM.class.php line 265

Removing the where clause which limits by userid, I get to see all the restaurants which is the behavior I want. We should all share our restaurant reviews, not horde them to ourselves.

Commented out the session_unregister() and now login and logout function without error.

Still broken: xymon custom graphs

phprecipebook: ingredient auto-complete in recipe edit

When I try to enter a new recipe, auto-complete shows no ingredients.

  • The code for recipe edit is modules/recipes/addedit.php
    • line 299 defines the input box, but the autocompletion code is somewhere else
        echo "<div class=\"ui-widget\"><input id=\"ingredientAuto_$i\" name=\"ingredientAuto_$i\" value=\"$ingredient_name\"/></div>";
        echo "<input type=\"hidden\" id=\"ingredientId_$i\" name=\"ingredientId_$i\" value=\"$ingredient_id\">\n";
  • autocomplete is in modules/recipes/addedit.js at line 70
 function setupAutocompleteAction()
    {
        $(".ui-widget").find("input[id^='ingredientAuto_']").each(function()
        {
            $(this).autocomplete({
                source: "index.php?m=ingredients&a=get&format=no",
                minLength: 1,
                html: true,
                select: function(event, ui) {
                    var $target = $(event.target);
                    var ingredientIdName = getOtherFromName($target.attr("id"), "ingredientId");
                    $(ingredientIdName).val(ui.item.id);
                }
            });
        });
  • the autocomplete code is called from themes/default/header.php
  • the bulk of the autocomplete code is in libs/jquery.ui.autocomplete.html.js
  • the variable $incredient_name should contain the values to autocomplete against
  • the previous version, where autocomplete worked correctly, looks like this:
        // Show the Ingredient value, if AJAX support is enabled use the Auto-Complete Control
        if ($autocomplete_enabled)
        {
            $ingredientText = (isset($ingList[$ingredient_id])) ? $ingList[$ingredient_id] : "";
            echo "<div class=\"ui-widget\"><input id=\"ingredientAuto_$i\" name=\"ingredientAuto_$i\" value=\"$ingredientText\"/></div>";
            echo "<input type=\"hidden\" id=\"ingredientId_$i\" name=\"ingredientId_$i\" value=\"$ingredient_id\">\n";
  • both old and new versions of autocomplete are based on the same query:
index.php?m=ingredients&a=get&format=no

This query is in modules/ingredients/get.php and the query it uses looks like this:

$sql = "SELECT ingredient_name, ingredient_id FROM $db_table_ingredients " . ^M
    "WHERE ingredient_name LIKE '%" . $DB_LINK->addq($searchText, get_magic_quotes_gpc()) . "%' AND " .^M
    "ingredient_user = '" . $DB_LINK->addq($SMObj->getUserID(), get_magic_quotes_gpc()) ."' ORDER BY ingredient_name";^M

So I changed it back to a globally shared space like this:

$sql = "SELECT ingredient_name, ingredient_id FROM $db_table_ingredients " . ^M
    "WHERE ingredient_name LIKE '%" . $DB_LINK->addq($searchText, get_magic_quotes_gpc()) . "%' " .
    "ORDER BY ingredient_name";^M

back to fixing xymon custom graphs

  • cputemp
  • I have the script written and placed here: /usr/lib/xymon/client/ext/cputemp
  • I also created a file called cputemp here: /usr/lib/xymon/server/etc/tasks.d
[cputemp]
    ENVFILE /usr/lib/xymon/client/etc/xymonclient.cfg
    CMD /usr/lib/xymon/client/ext/cputemp
    INTERVAL 5m