Forum .LRN Q&A: notes on upgrading dotLRN to 2.2.0a1

We are testing upgrade process from dotlrn-2-1-3 to dotlrn-2-2-0a1 (oacs-5-2).

Some reports about process maybe could be usefull for dotlrn new release:

Situation: 2.1.3 is a testing install with many objects created (terms, departments, classes and content objects).

Notes:

A. we noted some fixes are needed to correct provides url version number in .info files.

suggested fixes we used in our upgrade process is here

https://openacs.org/bugtracker/openacs/patch?patch%5fnumber=747

B. there is an error upgrading acs-subsite from core:

[06/Dec/2005:15:35:48][5696.49156][-conn:upgrade::0] Notice: apm_invoke_callback_proc: invoking callback after-upgrade with command subsite::after_upgrade -from_version_name 5.1.5 -to_version_name 5.2.0b9
[06/Dec/2005:15:35:48][5696.49156][-conn:upgrade::0] Error: Ns_PgExec: result status: 7 message: ERROR: function content_item__new(integer, character varying, integer, "unknown", timestamp with time zone, integer, integer, character varying, "unknown", "unknown", "unknown", "unknown", boolean, "unknown", "unknown", "unknown", integer) does not exist
HINT: No function matches the given name and argument types. You may need to add explicit type casts.
CONTEXT: PL/pgSQL function "content_folder__new" line 41 at assignment

function content_item__new(integer, character varying, integer, "unknown", timestamp with time zone, integer, integer, character varying, "unknown", "unknown", "unknown", "unknown", boolean, "unknown", "unknown", "unknown", integer) does not exist

we use the following fix to correct that:

https://openacs.org/bugtracker/openacs/patch?patch%5fnumber=748

The upgrade was made easy using following steps:

a) upgrade all core packages
b) upgrade all packages from dotlrn-all (except news-aggregator. We are working on fix for this package. It need to be fixed)

In the other way we try to upgrade all packages (acs-core + dotlrn-all):

The upgrade works but there were several errors regarding new parameter registration.

Messages errors were all the same:

[06/Dec/2005:19:56:45][9091.114696][-conn:upgrade::4] Error: Ns_PgExec: result status: 7 message: ERROR: cache lookup failed for function 2424549
CONTEXT: PL/pgSQL function "apm_parameter_value__new" line 8 at assignment
PL/pgSQL function "apm__set_value" line 17 at assignment
PL/pgSQL function "apm__register_parameter" line 46 at perform

changing package name and version here:

[06/Dec/2005:19:56:45][9091.114696][-conn:upgrade::4] Error: apm_package_install: Error installing Kernel version 5.2.0b9: Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

The following packages and new parameters where not registered in the upgrade:

package new parameter
'acs-kernel', 'BugTrackerInstance',
'lars-blogger', 'CategoryContainer',
'acs-tcl', 'HtmlDocBin',
'faq', 'CategoryContainer',
'file-storage', 'AllowTextEdit',
'forums', 'ForumsSearchBoxP',
'acs-content-repository', 'CRFileLocationRoot',
'acs-developer-support', 'AdpRevealEnabledP',
'news', 'ImageFormat',
'acs-subsite','IndexInternalRedirectUrl'

We are going into these errors this week and we hope bring a more positive report in the next days

\Orzenil

Collapse
Posted by Malte Sussdorff on
How did you circumwent the problem that new portal upgrade destroys the community portals? At least in none of our tested upgrades we were able to access a community portal anymore and all community portals just showed the user portal.

So we upgraded acs-core without the new-portal or dotlrn part and things a working just fine :)

Collapse
Posted by Malte Sussdorff on
Oh, and could someone give Orzenil commit rights to the CVS. His patches and the Poll module seem to work, so I think we could save ourself a little bit of time (as OCT members) and give him access directly 😊.
Collapse
Posted by Rodrigo Proença on
We post a fix for news-aggregator bug (number)#2710, may be tomorow we finish the corrections to other problems.
Collapse
Posted by Malte Sussdorff on
Any news on the community portal? Did you succeed in retaining them on your installs?

Has anyone else successfully upgraded .LRN and retained the community and class portals (as in: could access them)?

Furthermore, we are now facing an issue with an undefined config(package_id) if we install a new applet. I have the slight suspicion that something is *heavily* screwed up, but I'm unable to point my finger to it due to my lack of understanding of the .LRN internals.

Collapse
Posted by Orzenil Silva Junior on
Malte,

We are working on documenting the upgrade process from 2.1.3 (tarball) to 2.2.0a1 (cvs oacs-5-2) as part of E-lane developments. The upgrade was fine, just few patches was generated, but we need carry out some tests on packages from dotlrn-all and few others from dotlrn-extras. This week we will finish this work. I am just waiting a final report from my team to produce a more detailed

I contacted Rodrigo Proença about your report and we could see in our upgrade class portals were available after upgrade and we had no problems acessing its objects. As i said we are working on dotlrn 2.1.3 test install. We created objects (departaments, classes, portals) on it and upgrade to 2.2.0a1. Is it possible to you send a database backup from your original 2.1.3 system you are trying to upgrade?

Collapse
Posted by Orzenil Silva Junior on
Hi Malte,

good news. I think we guessed what was wrong in the upgrade and we are going to fix it in a better way.

Community and Class portals were not destroyed by upgrade. Some parameters - dotlrn_level_p, community_level_p and community_type_level_p - were changed to null (we really dont know why yet) in the upgrade. Maybe apm reset all them to null?? We are trying to see how could be happen...

Just go into your class or community package instance and change this parameters in site-map setting them as they were configured originally on community or class creation:

ad_parameter -package_id $package_id -set 0 dotlrn_level_p

ad_parameter -package_id $package_id -set 0 community_type_level_p

ad_parameter -package_id $package_id -set 1 community_level_p

Here we go... your portal is up!

Second problem:

we had undefined config(package_id) for some new applets as curriculum and news-agregator. I tryed just drop actual portlet implementation, change portal_datasource__set_def_param value for package_id from "" to "list" and load implementation again.

After that go into your portlet procedures and add the switch

-extra_params [list package_id $package_id]

where you declare the call to proc

portal::add_element_parameters and portal::remove_element_parameters

It worked

We are preparing changes to do on upgrade.

If the community could make some advices on how to solve it it will be very appreciated

Thank you

\Orzenil

Collapse
Posted by Malte Sussdorff on
the portal_source__set_def_param problem was due to the fact that at one point in time (at least in our installation) the SQL procedure did not insert into the portal_def_params table, but into the portal_params table.

This screwed up any new installations of portlets, like news-aggregator and weblogger. So it might be only specific to our system, but people should be aware of it (maybe you could quickly scan that for each datasource-key (or whatever the name) in portal_params there must be an entry in portal_def_params ?

Collapse
Posted by Malte Sussdorff on
Hi Orzenil,

did you manage to find out where the problem was with the parameters being set to NULL?

I just made a fresh upgrade and it failed again due to this error.

Collapse
Posted by Nima Mazloumi on
<h1>Report of upgrade from 2.1.3 to 2.2</h1>

Hi all,
we just upgraded our test system from 2.1.3 to oacs5-2 with .LRN 2.2.0a2.
<h2>Upgrade Problems</h2>

Here the problemes we faced during upgrade:

  • For some reason upgrade of file-storage, content-repository and dotlrn were always hanging. Also the after upgrade callback of news resulted to an error saying that we have a duplicate value for the service contract in our database.
  • fter several runs file-storage went through. What was hanging was the update calls at the end of file-storage/sql/postgresql/upgrade/upgrade-5.1.0a16-5.1.0a17.sql
  • dotlrn upgrade stopped after running the sql/postgresql/upgrade/upgrade-2.1.3-2.2.0d1.sql script. So I assume dotlrn::apm::after_upgrade has not been called. But I need to check that. APM at least is displaying version 2.2.0a2.
  • Regarding content repository it turned out that the temporary function __tmp_crnewtree() in upgrade-5.2.0b2-5.2.0b3.sql was the reason why upgrade hanging. We found out accidently after 20 minutes that the upgrade continued.
<h2>Testing the site</h2>

Here a first report testing after the upgrade:
<h4>Static Portlet</h4>

  • For some reason all static portlets have an error because a column body is expended but we have a column content inside our database. No idea where that is coming from.
    select body, pretty_name, format from static_portal_content where content_id = xyz
  • Creating a new static portlet therefore fails

<h4>Classes, Communities, Subgroups</h4>

  • Navigation to classes, courses, subgroups and communities work
  • Creating subgroups fails:
    Database operation "dml" failed (exception ERROR, "FEHLER:  Einfügen oder Aktualisieren in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_objects_package_id_fk«
    DETAIL:  Schlüssel (package_id)=(0) ist nicht in Tabelle »apm_packages« vorhanden.
    ")

    FEHLER: Einfügen oder Aktualisieren in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_objects_package_id_fk« DETAIL: Schlüssel (package_id)=(0) ist nicht in Tabelle »apm_packages« vorhanden.

    SQL: update acs_objects set package_id = '0' where object_id = '2238349'

  • Copying a group fails
    Database operation "dml" failed (exception ERROR, "FEHLER:  Einfügen oder Aktualisieren in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_objects_package_id_fk«
    DETAIL:  Schlüssel (package_id)=(0) ist nicht in Tabelle »apm_packages« vorhanden.
    ")

    FEHLER: Einfügen oder Aktualisieren in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_objects_package_id_fk« DETAIL: Schlüssel (package_id)=(0) ist nicht in Tabelle »apm_packages« vorhanden.

    SQL: update acs_objects set package_id = '0' where object_id = '2238641' while executing "ns_pg_bind dml nsdb0 { update acs_objects set package_id = :object_id where object_id = :node_id }"

  • Archiving a group works
  • unarchiving a group works
  • Managing members
    • adding a new member works
    • changing role works (slow)
    • removing member works
  • Changing portlet name works but
    • For some reason so portlet headers dont shown anymore
    • Simply displaying a page number instead of page name not good
  • Changing system template fails:
    expected boolean value but got ""
        while executing
    "if {[parameter::get -package_id $dotlrn_package_id -parameter AdminChangeSiteTemplate_p]} {
    	    set site_template_id [get_site_template_id -community..."
        (procedure "dotlrn_community::get_site_template_id_not_cached" line 5)
        invoked from within
    "dotlrn_community::get_site_template_id_not_cached -community_id 2093034"
        ("eval" body line 1)
        invoked from within
    "eval $script"

  • Creating welcome message for group works. Wether it is send out, no idea

<h4>Forums</h4>

  • Creating a new forum works
  • Creating a new thread works works
  • Replying a post works
  • Move of thread to another thread/forum works
  • disabling forums works
  • Move to other thread not i18n-ized
  • Subscribe others not i18n-ized
  • Confirmation of moving to another thread not i18n-ized
  • statistics not i18n-ized

Note: We should provide a feature to delete a forum, no?

<h4>FAQ</h4>

  • Creating/deleting an FAQ works
  • create/delete/preview q&a works
  • separte page for each q&a works
  • Create form of faq not i18n
  • Configure link and configure form not i18n

<h4>Calendar</h4>

  • Creating a new item - Javascript to display date selector fails
  • Creating an new item works
  • Display of items works on all portlets and views
  • Deleting an item works
  • Editing an item works
  • Changing an recurring item is not provided
  • Creating a recurring item fails
    Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

    FEHLER: ungültige Eingabesyntax für Typ timestamp with time zone: »12-Mai-2006 0:0«

    SQL: select recurrence__new('week', '2', '1 2 4', '12-Mai-2006 0:0', NULL)

<h4>Bulk Mail</h4>
  • Simply sending a mail worked

<h4>News</h4>

  • Creating a new item works
  • "Choose an image" not i18n
  • "Return to edit" not i18n
  • Upload of an image fails ..."Image must be one of the following types:", error text not complete, text not i18n-ized
  • return to edit works
  • preview works
  • confirmation works
  • link to administer news on the right not using class button of style sheet
  • item displays on porlet

<h4>Survey</h4>

  • Creating/deleting a new survey works
  • Creating a new question works
  • Preview works
  • Different display types table, list, sections work
  • admin image on the right broken on page survey/one-survey
  • processing a survey works
  • display of given answers works
  • changing a given answer works
  • Link on survey portlet "view/edit previous responses" not i18n
  • activation/deactivation of survey works
  • copy of questions work
  • deleting a question works
  • moving questions work

<h4>File-Storage</h4>

  • File upload works
  • new revision works
  • delete revision works
  • rename works
  • copy of files works
  • deleting a file works
  • moving a file works (slow)
  • creating a new folder works (slow)
  • moving folder works (slow)
  • Parent folder display emtpy if child folder is empty as well (not good)
  • deleting a folder works (slow)
Collapse
Posted by Nima Mazloumi on
To be done:
- Deparments
- Classes
- Add applets (we need to be able to remove them as well)
- Install packages
- Instantiate/Move/Remove instances
- Test notification
- Test ETP, Project Manager, Bug-Tracker, Homework, ...
- Simplify adding new themes and applying to all groups
Collapse
Posted by Nima Mazloumi on
/dotlrn/control-panel a valign="top" is missing for the left column with the portlet "Help and Personal Configuration"
Collapse
Posted by Dave Bauer on
Nima,

CR upgrade can take some time, I don't believe it is hanging or failing. Please make sure you fix errors in one package before reporting errors in other packages that are installed later. Once you have one error, you can't be sure if it is causing the later errors.

It is best to address the first error you see during upgrade and fix that before worrying about the later ones.

Collapse
Posted by Nima Mazloumi on
Alright,

dotlrn installation fails as soon as the proc apm_parameter_register is called. So some reason the sql query parameter_register never returns.

Looking at the code I have a question. The query text is written directly inside the proc but there is a postgresql.xql where the query is available as well. Which query is in this case executed by the system?

Inside apm-procs.tcl is written

begin
:1 := apm.register_parameter(
parameter_id => :parameter_id,
parameter_name => :parameter_name,
package_key => :package_key,
description => :description,
datatype => :datatype,
default_value => :default_value,
section_name => :section_name,
min_n_values => :min_n_values,
max_n_values => :max_n_values
);
end;

And in the apm-procs-postgresql.xql is written:

select apm__register_parameter(
:parameter_id,
:package_key,
:parameter_name,
:description,
:datatype,
:default_value,
:section_name,
:min_n_values,
:max_n_values
);

The function apm__register_parameter is defined as this:

-- Function: apm__register_parameter(int4, varchar, varchar, varchar, varchar, varchar, varchar, int4, int4)

-- DROP FUNCTION apm__register_parameter(int4, "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", int4, int4);

CREATE OR REPLACE FUNCTION apm__register_parameter(int4, "varchar", "varchar", "varchar", "varchar", "varchar", "varchar", int4, int4)
RETURNS int4 AS
'
declare
register_parameter__parameter_id alias for $1; -- default null
register_parameter__package_key alias for $2;
register_parameter__parameter_name alias for $3;
register_parameter__description alias for $4; -- default null
register_parameter__datatype alias for $5; -- default \'string\'
register_parameter__default_value alias for $6; -- default null
register_parameter__section_name alias for $7; -- default null
register_parameter__min_n_values alias for $8; -- default 1
register_parameter__max_n_values alias for $9; -- default 1

v_parameter_id apm_parameters.parameter_id%TYPE;
cur_val record;
begin
-- Create the new parameter.
v_parameter_id := acs_object__new(
register_parameter__parameter_id,
\'apm_parameter\',
now(),
null,
null,
null,
\'t\',
register_parameter__package_key || \': Parameter \' || register_parameter__parameter_name,
null
);

insert into apm_parameters
(parameter_id, parameter_name, description, package_key, datatype,
default_value, section_name, min_n_values, max_n_values)
values
(v_parameter_id, register_parameter__parameter_name,
register_parameter__description, register_parameter__package_key,
register_parameter__datatype, register_parameter__default_value,
register_parameter__section_name, register_parameter__min_n_values,
register_parameter__max_n_values);

-- Propagate parameter to new instances.
for cur_val in select ap.package_id, p.parameter_id, p.default_value
from apm_parameters p left outer join apm_parameter_values v
using (parameter_id), apm_packages ap
where p.package_key = ap.package_key
and v.attr_value is null
and p.package_key = register_parameter__package_key
loop
PERFORM apm__set_value(
cur_val.parameter_id,
cur_val.package_id,
cur_val.default_value
);
end loop;

return v_parameter_id;

end;'
LANGUAGE 'plpgsql' VOLATILE;

Maybe this is the reason why none of the parameters of the packages are added.

Any idea?

Collapse
Posted by Nima Mazloumi on
This behaviour is not dotlrn specific. If I go to the APM and try to add a new parameter the same happens. Ther proc is called and never returns.
Malte,

Finally we found a way to manage problems due dotlrn parameters (community_level_p, community_type_level_p and dotlrn_level_p) being set to NULL after upgrade.

We tried this solution with recent upgrades we did from dotlrn-2.1.1 to dotlrn-2.2.0a3 and dotlrn-2.1.3 to dotlrn-2.2.0a3, using postgresql

We just create an auxiliary table with sql upgrade script to preserve old parameters values stored in apm_parameter_values and introduced a callback in dotlrn/tcl/apm-callbacks.tcl. This callback is responsible to copy attr_values from auxiliary table to apm_parameter_values after upgrade.

It works for us and upgrade was made easy. Community portals are showed after upgrade and besides not all aplications were fully tested yet we think this solution could be interesting.

We will continue this week looking at dotlrn installations we upgraded searching for bugs or inconvenients after upgrade and testing packages for dotlrn-all. I will post a patch for dotlrn with our suggestion so you could appreciate. Nima, your considerations would be great too.

Patch for bug:

https://openacs.org/bugtracker/openacs/bug?f%5fcomponent=56129&format=table&f%5fstate=7&bug%5fnumber=2717&project%5fid=56106

Collapse
Posted by Deds Castillo on
This bit me hard making me lose some twelve values to custom xowiki parameters. Cause for the parameters that are set to null are below. This a somewhat critical bug due to what it can do.

The upgrade overwrites the sql proc apm__register_parameter from acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0d1-5.2.0d2.sql which has an erratic definition than what's present in apm-create.sql. Should we be using the one on the upgrade or the one on apm-create?

In any case, you can correct the upgrade version by adding an extra where clause "and v.package_id = ap.package_id".

Note that even if Orzenil has dotlrn fixed using a workaround, you still need to fix your erratic apm__register_parameter proc or any attempt to upgrade ANY package which has a null in attr_value from apm_parameter_values will overwrite all similar parameter attribute values using default value from apm_parameters.

I'm not sure if we should be following the one on the upgrade (with the correction) or the one on apm-create. So someone please write a proper upgrade script.

Collapse
Posted by Nima Mazloumi on
Hi all,


as I can see there are still two different apm_register_parameter functions defined in acs-kernel:


apm-create.sql:

create or replace function apm__register_parameter (integer,varchar,varchar,varchar,varchar,varchar,varchar,integer,integer)
returns integer as '
declare
  register_parameter__parameter_id           alias for $1;  -- default null
  register_parameter__package_key            alias for $2;
  register_parameter__parameter_name         alias for $3;
  register_parameter__description            alias for $4;  -- default null
  register_parameter__datatype               alias for $5;  -- default ''string''
  register_parameter__default_value          alias for $6;  -- default null
  register_parameter__section_name           alias for $7;  -- default null
  register_parameter__min_n_values           alias for $8;  -- default 1
  register_parameter__max_n_values           alias for $9;  -- default 1

  v_parameter_id         apm_parameters.parameter_id%TYPE;
  v_value_id             apm_parameter_values.value_id%TYPE;
  v_pkg                  record;

begin -- Create the new parameter. v_parameter_id := acs_object__new( register_parameter__parameter_id, ''apm_parameter'', now(), null, null, null, ''t'', register_parameter__package_key || '' - '' || register_parameter__parameter_name, null ); insert into apm_parameters (parameter_id, parameter_name, description, package_key, datatype, default_value, section_name, min_n_values, max_n_values) values (v_parameter_id, register_parameter__parameter_name, register_parameter__description, register_parameter__package_key, register_parameter__datatype, register_parameter__default_value, register_parameter__section_name, register_parameter__min_n_values, register_parameter__max_n_values); -- Propagate parameter to new instances. for v_pkg in select package_id from apm_packages where package_key = register_parameter__package_key loop v_value_id := apm_parameter_value__new( null, v_pkg.package_id, v_parameter_id, register_parameter__default_value ); end loop; return v_parameter_id;

end;' language 'plpgsql';



upgrade-5.2.0d1-5.2.0d2.sql:

create or replace function apm__register_parameter (integer,varchar,varchar,varchar,varchar,varchar,varchar,integer,integer)
returns integer as '
declare
  register_parameter__parameter_id           alias for $1;  -- default null
  register_parameter__package_key            alias for $2;
  register_parameter__parameter_name         alias for $3;
  register_parameter__description            alias for $4;  -- default null
  register_parameter__datatype               alias for $5;  -- default ''string''
  register_parameter__default_value          alias for $6;  -- default null
  register_parameter__section_name           alias for $7;  -- default null
  register_parameter__min_n_values           alias for $8;  -- default 1
  register_parameter__max_n_values           alias for $9;  -- default 1

  v_parameter_id         apm_parameters.parameter_id%TYPE;
  cur_val                record;
begin
    -- Create the new parameter.
    v_parameter_id := acs_object__new(
       register_parameter__parameter_id,
       ''apm_parameter'',
       now(),
       null,
       null,
       null,
       ''t'',
       register_parameter__package_key || '': Parameter '' || register_parameter__parameter_name,
       null
    );

    insert into apm_parameters
    (parameter_id, parameter_name, description, package_key, datatype,
    default_value, section_name, min_n_values, max_n_values)
    values
    (v_parameter_id, register_parameter__parameter_name,
     register_parameter__description, register_parameter__package_key,
     register_parameter__datatype, register_parameter__default_value,
     register_parameter__section_name, register_parameter__min_n_values,
     register_parameter__max_n_values);

    -- Propagate parameter to new instances.
    for cur_val in select ap.package_id, p.parameter_id, p.default_value
       from apm_parameters p left outer join apm_parameter_values v
             using (parameter_id), apm_packages ap
      where p.package_key = ap.package_key
        and v.attr_value is null
        and p.package_key = register_parameter__package_key
      loop
        PERFORM apm__set_value(
            cur_val.parameter_id,
            cur_val.package_id,
            cur_val.default_value
            );
      end loop;

    return v_parameter_id;

end;' language 'plpgsql';



Which one is correct? The one in the upgrade skript results to null values. So it is definetly wrong. But what about the other?


Can someone help?

Collapse
Posted by Nima Mazloumi on
I tried to upgrade from 2.1.x to 2.2.x. When I try to create a new subgroup I get the following error:
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

FEHLER:  NULL-Value in column »object_id« violates Not-Null-Constraint
CONTEXT:  SQL-Query »insert into site_node_object_mappings (object_id, node_id) values ( $1 ,  $2 )«
PL/pgSQL function "site_node_object_map__new" line 7 at SQL statement

SQL: 
            select site_node_object_map__new(NULL, '3352108')
Collapse
Posted by Malte Sussdorff on
When (at what stage are you creating the new subgroup). Is this after upgrade?
Collapse
Posted by Dave Bauer on
The function in the create.sql is correct. It was changed around 5.1 and should have stayed that way.

Try replacing the function. We can fix that in CVS and it will go in the next release of OpenACS/.LRN

Collapse
Posted by Nima Mazloumi on
I used the correct function in the create.sql of acs-kernel. Now I can access the communities. But when I try to create a new subgroup or community I get the following exception:

Database operation "dml" failed (exception ERROR, "FEHLER: Einfügen oder Aktualisieren in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_objects_package_id_fk«
DETAIL: Schlüssel (package_id)=(0) ist nicht in Tabelle »apm_packages« vorhanden.
")

FEHLER: Einfügen oder Aktualisieren in Tabelle »acs_objects« verletzt Fremdschlüssel-Constraint »acs_objects_package_id_fk«
DETAIL: Schlüssel (package_id)=(0) ist nicht in Tabelle »apm_packages« vorhanden.

SQL:
update acs_objects
set package_id = '0'
where object_id = '3355574'

while executing
"ns_pg_bind dml nsdb0 {
update acs_objects
set package_id = :object_id
where object_id = :node_id
}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."
invoked from within
"db_exec dml $db $full_statement_name $sql"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
db_exec dml $db $full_statement_name $sql
}"
(procedure "db_dml" line 100)
invoked from within
"db_dml update_object_package_id {}"
(procedure "site_node::mount" line 4)
invoked from within
"site_node::mount -node_id $attachments_node_id -object_id [apm_package_id_from_key attachments]"
(procedure "dotlrn_forums::add_applet_to_community" line 14)
invoked from within
"dotlrn_forums::add_applet_to_community $community_id"
(procedure "AcsSc.dotlrn_applet.addapplettocommunity.dotlrn_forums" line 1)
invoked from within
"AcsSc.dotlrn_applet.addapplettocommunity.dotlrn_forums 3355385"
("uplevel" body line 1)
invoked from within
"uplevel $func_and_args"
(procedure "apply" line 3)
invoked from within
"apply $proc_name $arguments"
(procedure "acs_sc_call" line 6)
invoked from within
"acs_sc_call dotlrn_applet $op $list_args $applet_key"
(procedure "applet_call" line 2)
invoked from within
"applet_call $applet_key AddAppletToCommunity [list $community_id]"
invoked from within
"set package_id [applet_call $applet_key AddAppletToCommunity [list $community_id]]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 1)
invoked from within
"db_transaction {
set package_id [applet_call $applet_key AddAppletToCommunity [list $community_id]]

register_a..."
(procedure "dotlrn_community::add_applet_to_community" line 2)
invoked from within
"dotlrn_community::add_applet_to_community $community_id $applet_key"
("foreach" body line 3)
invoked from within
"foreach applet_key $default_applets_list {
if {[dotlrn_applet::applet_exists_p -applet_key $applet_key]} {
dotlrn_..."
("uplevel" body line 68)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 39)
invoked from within
"db_transaction {
set user_id [ad_conn user_id]
set community_id [package_instantiate_object -extra_vars $extra_vars $object_ty..."
(procedure "dotlrn_community::new" line 26)
invoked from within
"dotlrn_community::new -parent_community_id $parent_community_id -description $description -community_type dotlrn_community -pretty_name $pretty_na..."
invoked from within
"set subcomm_id [dotlrn_community::new -parent_community_id $parent_community_id -description $description -community_type dotlrn_community -pretty..."
("uplevel" body line 2)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 39)
invoked from within
"db_transaction {
set subcomm_id [dotlrn_community::new -parent_community_id $parent_community_id -description $description -community_type ..."
invoked from within
"if {[form is_valid add_subcomm]} {
form get_values add_subcomm pretty_name description join_policy referer

# we set some extra vars based on..."
("uplevel" body line 57)
invoked from within
"uplevel {
#
# Copyright (C) 2001, 2002 MIT
#
# This file is part of dotLRN.
#
# dotLRN is free software; you can redistribute it and/or modify it u..."
(procedure "code::tcl::/www/unima0/packages/dotlrn/www/subcommunity-new" line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {

if { [file exists $__adp_stub.tcl] } {

# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare "
(procedure "template::adp_parse" line 30)
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 5)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info..."

Collapse
Posted by Dave Bauer on
Nima,

Its trying to set package_id to 0

SQL:
update acs_objects
set package_id = '0'
where object_id = '3355574'

So why is that happening?

Any idea, can you trace it further?

Collapse
Posted by Nima Mazloumi on
I turned on ds and tried again with db on. here the db stack around the relevant part:

dbqd.acs-tcl.tcl.apm-procs.apm_package_registered_p.apm_package_registered_p: 0or1row nsdb0
select 1 from apm_package_types
where package_key = 'attachments'

2 ms 0or1row dbqd.dotlrn.tcl.community-procs.dotlrn_community::applet_active_p.select_active_applet_p: 0or1row nsdb0
select 1
from dotlrn_community_applets,
dotlrn_applets
where dotlrn_community_applets.community_id = '3355576'
and dotlrn_community_applets.applet_id = dotlrn_applets.applet_id
and dotlrn_applets.applet_key = 'dotlrn_fs'
and dotlrn_community_applets.active_p = 't'
and dotlrn_applets.active_p = 't'

2 ms 0or1row dbqd.acs-subsite.tcl.package-procs.package_instantiate_object.package_select: 0or1row nsdb0

select t.package_name
from acs_object_types t
where t.object_type = 'site_node'

6 ms 0or1row dbqd.acs-subsite.tcl.package-procs.package_instantiate_object.create_object: 0or1row nsdb0

select site_node__new(NULL,'3355756',null,NULL,'t','t','27685','134.155.48.12')

2 ms select dbqd.acs-subsite.tcl.subsite-callback-procs.subsite_callback.select_callbacks: select nsdb0

select distinct callback, callback_type
from subsite_callbacks
where object_type in (select t2.object_type
from acs_object_types t1, acs_object_types t2
where t2.tree_sortkey <= t1.tree_sortkey
and t1.tree_sortkey between t2.tree_sortkey and tree_right(t2.tree_sortkey)
and t1.object_type = 'site_node')
and event_type = 'insert'

2 ms dml dbqd.acs-tcl.tcl.site-nodes-procs.site_node::mount.mount_object: dml nsdb0
update site_nodes
set object_id = '0'
where node_id = '3355765'

3 ms dml dbqd.acs-tcl.tcl.site-nodes-procs.site_node::mount.update_object_package_id: dml nsdb0
update acs_objects
set package_id = :object_id
where object_id = :node_id

Collapse
Posted by Nima Mazloumi on
Something inside the call

site_node::mount -node_id $attachments_node_id -object_id [apm_package_id_from_key attachments]

goes wrong.

Collapse
Posted by Nima Mazloumi on
I don't think this has something todo with this problem here but the after-upgrade service contract of the news packages breaks during upgrade:

news::install::after_upgrade -from_version_name 5.0d7 -to_version_name 5.2.0d6

Collapse
Posted by Nima Mazloumi on
by the way: I am using the tarball for upgrade. shall I download from cvs? if yes which branch or version. I will try the upgrade tomorrow and post again. Until then I am thankful for any help. Good night.
Collapse
Posted by Dave Bauer on
Try this from the ds/shell

[apm_package_id_from_key attachments]

and see what it returns. It apparently is returning 0 which seems wrong unless attachements isn't installed or someting.

Collapse
Posted by Dave Bauer on
https://openacs.org/api-doc/proc-view?proc=apm%5fpackage%5fid%5ffrom%5fkey

The doc says it returns 0 is the package doesn't exist. I am not sure how you could not have attachments, check your APM.

Collapse
Posted by Nima Mazloumi on
Not being able to accesss a community is fixed when using the function defined in the acs-kernel-create.sql instead of that in the upgrade script.

Now to the attachments issue.

Ok. from what I see during the upgrade I should have permitted the apm to create an attachments instance under /attachments. Since I had attachments installed but no instance of it the new dependency of forums broke the creation and cloning of communities. The problem is, that apm always recommends you to create an instance of some packages under /. Normally you don't need to do that because its not necessary, right? But not in this case.

After creating an instance I got an new error message when creating a community: CommDefaultSiteTemplate_p parameter of dotlrn was missing which should have been installed after upgrade of dotlrn package. I tried to do that manually and it took at least 5 min to create the parameter with apm. I guess this must have been the case during upgrade and a server restart caused this to remain unfinished.

After adding the parameter manually the creation of communties works again.

Now my question is: I would like to make another clean upgrade for a last time before I start checking all the common functionalities of dotlrn. So far I have been using the tarball .LRN 2.2.0 Final. What shall I use this time? HEAD, oacs-5-2 branch?

Greetings,
Nima

Collapse
Posted by Malte Sussdorff on
Which function are you talking about in acs-kernel-create.sql? I would immediately correct this with a new upgrade script...

I highly recommend the oacs-5-2 branch. Obviously all bug fixes will only make it to the branch and not to the tarball until a new release is cut.

Collapse
Posted by Nima Mazloumi on
Malte: its apm__register_parameter
Collapse
Posted by Nima Mazloumi on
Just a quick note. I have downloaded the latest code from branch oacs-5-2 and will try an upgrade again today.
Collapse
Posted by Emmanuelle Raffenne on
Nima,

Did you try the upgrade? Did you have any problem with it? Please, give us feedback on this to include posible issue in the agenda of .lrn meeting.

Collapse
Posted by Nima Mazloumi on
Emma, we have bug bash and upgrade session since thursday until sunday.

yesterday we test upgraded a copy of our production site. despite the problem with two package ids since we have also a subsite installed and two after::upgrade procs (news, dotlrn) not being called all went well.

Today we merged all our local fixes and improvements:
- usage of screen names in forums
- calendar improvements
- several UI improvements on portlets (faq, forums, news, file-storage user portlet...)
- i18 fixes of several packages
- support for background delivery
- support for reverse proxies like pound

Tomorrow we will test on a fresh installation that everything works fine. And if yes commit all our work.
I just installed a fresh copy and it went through without a problem.

If we have a day left we will finally upgrade our production site from oacs-5-2 branch.

Greetings,
Nima

Collapse
Posted by Nima Mazloumi on
Alright. We have finished our upgrade and merging work and will commit all our fixes in 1-2 hours.
Collapse
Posted by Emmanuelle Raffenne on
Nima,

Congrats!

During the last virtual bugs bashes we have been working on portlets (forums, calendar, news, file-storage, dotlrn portlets, etc.) improving accessibility (html fixes, adding title for A tag, fixing tables, etc.) and fixing also missing i18n keys. Please, be aware of that when you'll commit your work. Feel free to email me if you have any questions/problems, I'll keep an eye on my mail during all day.