Forum OpenACS Q&A: Project Manager - must be me!

Collapse
Posted by Richard Hamilton on
I have spent many many hours now trying to eliminate an installation issue or versioning problem but have failed miserably.

Blank install of OpenACS 5.1
Create subsite called Project Management
Download oacs-5-1 tagged versions of all pm dependencies using CVS
Download logger from HEAD using CVS
Download Project Manager from HEAD (v1.16.2.1/Thu May 20 17:30) using CVS
Copy into packages directory

In package manager choose - Install items 'from local system'
Restart server

Mount:
Organizations
Logger
project Manager

on the subsite

Click on Project Manager
Add a project
Complete the form
Submit
Error log below.

I have posted this on the bug tracker but would really appreciate some pointers if the error is obvious to someone. Looks to me as if it is something to do with the content repository or a broken function trying to put something into the content repository, but I am not clear at this stage exactly what.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

NOTICE:  adding missing FROM-clause entry for table "acs_object_id_seq"
CONTEXT:  PL/pgSQL function "pm_project__new_project_item" line 26 at select into variables
NOTICE:  creating a new root repository folder
CONTEXT:  PL/pgSQL function "pm_project__new_project_item" line 28 at assignment
NOTICE:  adding missing FROM-clause entry for table "acs_object_id_seq"
CONTEXT:  PL/pgSQL function "pm_project__new_unique_name" line 11 at select into variables
PL/pgSQL function "pm_project__new_root_folder" line 11 at assignment
PL/pgSQL function "pm_project__get_root_folder" line 27 at assignment
PL/pgSQL function "pm_project__new_project_item" line 28 at assignment
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Error: Ns_PgExec: result status: 7 message: ERROR:  -20000: This folder does not allow subfolders to be created
CONTEXT:  PL/pgSQL function "content_folder__new" line 7 at return
PL/pgSQL function "pm_project__new_root_folder" line 13 at assignment
PL/pgSQL function "pm_project__get_root_folder" line 27 at assignment
PL/pgSQL function "pm_project__new_project_item" line 28 at assignment

[02/Jun/2004:09:54:13][15899.98311][-conn3-] Error: dbinit: error(localhost::tradeadev,ERROR:  -20000: This folder does not allow subfolders to be created
CONTEXT:  PL/pgSQL function "content_folder__new" line 7 at return
PL/pgSQL function "pm_project__new_root_folder" line 13 at assignment
PL/pgSQL function "pm_project__get_root_folder" line 27 at assignment
PL/pgSQL function "pm_project__new_project_item" line 28 at assignment
): '
        select pm_project__new_project_item (
                'Testproject',
                NULL,
                NULL,
                'Get this bloody thing working',
                'This is a test',
                'text/plain',
                to_timestamp('2004 06 02 00 00 00','YYYY MM DD HH24 MI SS'),
                to_timestamp(NULL,'YYYY MM DD HH24 MI SS'),
                null,
                null,
                '642',
                't',
                '1',
                '640',
                current_timestamp,
                '448',
                '81.178.94.71',
                '622'
        );
    '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
      select apm_parameter_values.attr_value
      from apm_parameters, apm_parameter_values
      where apm_parameter_values.package_id = '65'
      and apm_parameter_values.parameter_id = apm_parameters.parameter_id
      and apm_parameters.parameter_name = 'RestrictErrorsToAdminsP';'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
      select apm_parameter_values.attr_value
      from apm_parameters, apm_parameter_values
      where apm_parameter_values.package_id = '65'
      and apm_parameter_values.parameter_id = apm_parameters.parameter_id
      and apm_parameters.parameter_name = 'RestrictErrorsToAdminsP'
    '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
            select 1
            where 't' = acs_permission__permission_p('622', '448', 'admin');'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
            select 1
            where 't' = acs_permission__permission_p('622', '448', 'admin')
        '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
            select 1
            where 't' = acs_permission__permission_p('452', '448', 'admin');'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
            select 1
            where 't' = acs_permission__permission_p('452', '448', 'admin')
        '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '

    select object_id from acs_magic_objects where name = 'security_context_root';'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '

    select object_id from acs_magic_objects where name = 'security_context_root'

      '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
            select 1
            where 't' = acs_permission__permission_p('-4', '448', 'admin');'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
            select 1
            where 't' = acs_permission__permission_p('-4', '448', 'admin')
        '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
        select version_id
        from apm_enabled_package_versions
        where package_key = 'acs-kernel';'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
        select version_id
        from apm_enabled_package_versions
        where package_key = 'acs-kernel'
    '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
        select v.version_id,
              v.package_key,
              v.version_name,
              v.version_uri,
              v.summary,
              v.description_format,
              v.description,
              to_char(v.release_date, 'YYYY-MM-DD') as release_date,
              v.vendor,
              v.vendor_uri,
              v.enabled_p,
              v.installed_p,
              v.tagged_p,
              v.imported_p,
              v.data_model_loaded_p,
              v.cvs_import_results,
              v.activation_date,
              v.deactivation_date,
              v.item_id,
              v.content_length,
              v.distribution_uri,
              v.distribution_date,
              v.auto_mount,
              t.pretty_name,
              t.pretty_plural
        from  apm_package_versions v,
              apm_package_types t
        where  v.version_id = '10'
        and    t.package_key = v.package_key;'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
        select v.version_id,
              v.package_key,
              v.version_name,
              v.version_uri,
              v.summary,
              v.description_format,
              v.description,
              to_char(v.release_date, 'YYYY-MM-DD') as release_date,
              v.vendor,
              v.vendor_uri,
              v.enabled_p,
              v.installed_p,
              v.tagged_p,
              v.imported_p,
              v.data_model_loaded_p,
              v.cvs_import_results,
              v.activation_date,
              v.deactivation_date,
              v.item_id,
              v.content_length,
              v.distribution_uri,
              v.distribution_date,
              v.auto_mount,
              t.pretty_name,
              t.pretty_plural
        from  apm_package_versions v,
              apm_package_types t
        where  v.version_id = '10'
        and    t.package_key = v.package_key
    '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: Querying '
            select 1
            where 't' = acs_permission__permission_p('340', '448', 'admin');'
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Notice: dbinit: sql(localhost::tradeadev): '
            select 1
            where 't' = acs_permission__permission_p('340', '448', 'admin')
        '
[02/Jun/2004:09:54:13][15899.98311][-conn3-] Error: POST http://63.246.8.13:8447/project-management/projects/add-edit?
referred by "https://63.246.8.13:8447/project-management/projects/add-edit"
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
    while executing
"ns_pg_bind 0or1row nsdb0 {
        select pm_project__new_project_item (
                :project_name,
                :project_code,
              ..."
    ("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 0or1row $db $full_statement_name $sql"
    invoked from within
"if {[regexp -nocase -- {^\s*select} $test_sql match]} {
                ns_log Debug "PLPGSQL: bypassed anon function"
                set selection [..."
    ("uplevel" body line 6)
    invoked from within
"uplevel 1 $code_block "
    invoked from within
"db_with_handle -dbn $dbn db {
            # plsql calls that are simple selects bypass the plpgsql
            # mechanism for creating anonymous fun..."
    (procedure "db_exec_plsql" line 57)
    invoked from within
"db_exec_plsql new_project_item { *SQL }"
    (procedure "pm::project::new" line 18)
    invoked from within
"pm::project::new  -project_name $project_name  -project_code $project_code  -parent_id $parent_id  -goal $goal  -description $description  -planned_st..."
    invoked from within
"set project_id [pm::project::new  -project_name $project_name  -project_code $project_code  -parent_id $parent_id  -goal $goal  -description $descript..."
    ("uplevel" body line 3)
    invoked from within
"uplevel #$level $new_data"
    ("1" arm line 1)
    invoked from within
"switch $errno {
                    0 {
                        # TCL_OK
                    }
                    1 {
                        # TCL_E..."
    (procedure "ad_form" line 612)
    invoked from within
"ad_form -extend -name add_edit  -select_query_name project_query  -on_submit {


        set user_id [ad_conn user_id]
        set peeraddr [a..."
    ("uplevel" body line 174)
    invoked from within
"uplevel {
          ad_page_contract {

    Simple add/edit form for projects

    @author mailto:jader@bread.com, mailto:ncarroll@ee.usyd.edu.au
    @creation-date 20..."
    (procedure "code::tcl::/web/tradeadev/packages/project-manager/www/add-e..." 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 Jade Rubick on
Sorry for the troubles, Richard!

Richard, please swing by on #openacs on IRC if you get a chance. I can walk you through how to fix that problem.

I'm also planning on uploading the next version of project-manager today or tomorrow. I'll test it on a vanilla OpenACS 5.1 install.

Collapse
Posted by Richard Hamilton on
Jade,

Thanks for the reply.

I really appreciate your offer of help on IRC but I have never used it before. I have tried to connect to irc://irc.freenode.net/#openacs it won't let me in for some reason.

Is the solution very convoluted or is it something I could follow on the forum or via email?

Regards
Richard

Collapse
Posted by Bart Teeuwisse on
Richard,

see https://openacs.org/irc/ for links to IRC clients and an IRC primer.

/Bart

Collapse
Posted by Jade Rubick on
Richard, I do recommend learning IRC -- it's an excellent 'place' to chat with developers in real-time, and get and offer help.

However, if you're busy at the moment, we are trying to track down this bug on IRC right now. I'll post a follow up here.

Collapse
Posted by Jade Rubick on
This seems to fix things (on one install at least)

If you go into psql, and paste the following, it should fix project-manager:

Please let me know if it works or not after this. I'll be including this in an upgrade script if it turns out to work. I'm planning on posting updates to logger and project-manager today.

------------------------------------------------

select define_function_args('pm_project__new_root_folder', 'package_id');

create or replace function pm_project__new_root_folder (integer)
returns integer as '
declare
        p_package_id            alias for $1;

        v_folder_id            cr_folders.folder_id%TYPE;
        v_folder_name          cr_items.name%TYPE;
begin

        -- raise notice ''in new root folder'';

        -- Set the folder name
        v_folder_name := pm_project__new_unique_name (p_package_id);

        v_folder_id := content_folder__new (
            v_folder_name,                              -- name
            ''Projects'',                              -- label
            ''Project Repository'',                    -- description
            null,                                      -- parent_id
            p_package_id,                              -- context_id
            null,                                      -- folder_id
            null,                                      -- creation_date
            null,                                      -- creation_user
            null                                        -- creation_ip
        );

        -- Register the standard content types
        PERFORM content_folder__register_content_type (
                v_folder_id,            -- folder_id
                ''pm_project'',        -- content_type
                ''f''                  -- include_subtypes
        );

        -- there is no facility in the API for adding in the package_id,
        -- so we have to do it ourselves

        update cr_folders
        set package_id = p_package_id
        where folder_id = v_folder_id;

        -- TODO: Handle Permissions here for this folder.

        return v_folder_id;
end;' language 'plpgsql';

Collapse
Posted by Richard Hamilton on
Jade,

My apologies for not being able to organise the IRC earlier, I was under tight time constraints because I was preparing to leave on a four day trip and had run out of time. I will get IRC set up when I get back.

Thank you very much for posting the fix. I should have a chance to try this tomorrow (if GPRS holds up!) and will let you know how I get on.

Regards & thanks
Richard

Collapse
Posted by Richard Hamilton on
Jade,

Just managed to find a useable internet connection on my travels and applied the function definition. Worked beautifully - thank you.

Looks fantastic.

I will now try upgrading to the new version 1.05.

Regards
Richard