Forum OpenACS Q&A: Canot create portal tables

Collapse
Posted by amit singh on
I had followed all the steps as mentioned in the portal module documentation. I had made all the relevant groups also. But at the last step when i go to portals/admin to create relevant tables. iget an error like.

Errors since 22/Aug/2001:19:32:12

[22/Aug/2001:19:32:12]
    Error: Ns_PgExec: result status: 7 message: ERROR:  Relation 'u'
does not exist
    

[22/Aug/2001:19:32:12]
    Error: dbinit: error(localhost::acs,ERROR:  Relation 'u' does not
exist
    ): '
            select first_names||' '||last_name as name 
            from   users
            where  ad_group_member_p ( user_id, 46 ) = 't'
            and u.user_id = map.user_id
            and map.group_id = 46
            and map.role in ('administrator', 'all')'

[22/Aug/2001:19:32:12]
    Error: Database operation "select" failed (exception NSDB, "Query
was not a statement returning rows.")
    Database operation "select" failed (exception NSDB, "Query was not
a statement returning rows.")
        while executing
    "ns_db select $db [db_sql_prep $sql"
        (procedure "database_to_tcl_list" line 2)
        invoked from within
    "database_to_tcl_list $db "
            select first_names||' '||last_name as name 
            from   users
            where  ad_group_member_p ( user_id, $group..."
        ("foreach" body line 8)
        invoked from within
    "foreach group_id $group_id_list {
    
        # get the name of the portal group
        set group_name [database_to_tcl_string $db "
            select group_name f..."
        (file
"/var/lib/aolserver/servers/defaultacs/www/portals/admin/index.tcl"
line 35)
        invoked from within
    "source $ad_conn(file)"
        (procedure "ad_handle_abstract_url" line 67)
        invoked from within
    "ad_handle_abstract_url cns100 {}"
    202.88.151.25 - - [22/Aug/2001:19:32:13 +0530] "GET
/portals/admin/ HTTP/1.0" 500 530 "" "Mozilla/4.75 [en] (X11; U; Linux
2.2.16-22 i686)"

[22/Aug/2001:19:32:20]
    Error: Ns_PgExec: result status: 7 message: ERROR:  Relation 'u'
does not exist
    

[22/Aug/2001:19:32:20]
    Error: dbinit: error(localhost::acs,ERROR:  Relation 'u' does not
exist
    ): '
            select first_names||' '||last_name as name 
            from   users
            where  ad_group_member_p ( user_id, 46 ) = 't'
            and u.user_id = map.user_id
            and map.group_id = 46
            and map.role in ('administrator', 'all')'

[22/Aug/2001:19:32:20]
    Error: Database operation "select" failed (exception NSDB, "Query
was not a statement returning rows.")
    Database operation "select" failed (exception NSDB, "Query was not
a statement returning rows.")
        while executing
    "ns_db select $db [db_sql_prep $sql"
        (procedure "database_to_tcl_list" line 2)
        invoked from within
    "database_to_tcl_list $db "
            select first_names||' '||last_name as name 
            from   users
            where  ad_group_member_p ( user_id, $group..."
        ("foreach" body line 8)
        invoked from within
    "foreach group_id $group_id_list {
    
        # get the name of the portal group
        set group_name [database_to_tcl_string $db "
            select group_name f..."
        (file
"/var/lib/aolserver/servers/defaultacs/www/portals/admin/index.tcl"
line 35)
        invoked from within
    "source $ad_conn(file)"
        (procedure "ad_handle_abstract_url" line 67)
        invoked from within
    "ad_handle_abstract_url cns101 {}"
    202.88.151.25 - - [22/Aug/2001:19:32:20 +0530] "GET
/portals/admin/ HTTP/1.0" 500 530 "" "Mozilla/4.75 [en] (X11; U; Linux
2.2.16-22 i686)"

can someone also help on this.
Collapse
Posted by amit singh on
I am using version 3.2.5 rpm on RH 7.0. previously i had 3.2.4 in another mac but it did not have any problems in the portal page.
Collapse
3: RPMs on RH 7.0 (response to 1)
Posted by Jonathan Marsden on
Great, someone tried my RPMs on RH 7.0 😊

I take it that the install itself was fine?  Can you confirm, so I can update my page to say that they work on RH 7.0 as well as RH 6.2 and RH 7.1?  Thanks!

I can't really help with the portals stuff; at a glance at your logs it looks like someone did "FROM users" when they may have meant "FROM users alias u" in a SELECT??  Someone who has actually used portals can hopefully help you sort this out.

Collapse
Posted by amit singh on
Yes it is working perfectly as expected. I had installed it on 6.2 and than on 7.0 i didn,t find any installation problems, except that u can change the database user in rpm install from acs to nsadmin. As the default docs mention these users and groups. I had used my previous initialisation file and had faced some dificulties in getting some things to work as the database denied access to delete the entries as there were to different set of users i was refrencing to.

Does anyone has some inputs on the portal admin page.

Thanks jonanthan

Collapse
5: Found the fix for errors (response to 1)
Posted by amit singh on
in the /portals/admin/index.tcl replace "u" with "users" and "map" with "user_group_map" in line 46 47 & 48. Else you need to create an alias before the function for u with users and map with user_group_map
Error in portals/manage-portal.tcl
23/Aug/2001:13:03:02]
    Error: Ns_PgExec: result status: 7 message: ERROR:  Relation 'pp' does not exist
    

[23/Aug/2001:13:03:02]
    Error: dbinit: error(localhost::acs,ERROR:  Relation 'pp' does not exist
    ): '
            delete from portal_table_page_map
            where page_id in (select ptgm.page_id
                              from portal_table_page_map ptgm
                              where pp.user_id = 1 and
                              pp.page_id = ptgm.page_id)
            and not (  (table_id = 5
                and page_id = 1) or  (table_id = 2
                and page_id = 1) or  (table_id = 3
                and page_id = 1) or  (table_id = 4
                and page_id = 1) or  (table_id = 1
                and page_id = 1) )'

[23/Aug/2001:13:03:02]
    Error: Database operation "dml" failed
    Database operation "dml" failed
        while executing
    "ns_db dml $db "
            delete from portal_table_page_map
            where page_id in (select ptgm.page_id
                              from portal_table_pa..."
        invoked from within
    "if {[empty_string_p $good_list] && ![empty_string_p $page_list] } {
        # delete all tables
        ns_db dml $db "delete from portal_table_page_map where..."
        (file "/var/lib/aolserver/servers/defaultacs/www/portals/manage-portal-2.tcl" line 145)
        invoked from within
    "source $ad_conn(file)"
        (procedure "ad_handle_abstract_url" line 67)
        invoked from within
    "ad_handle_abstract_url cns84 {}"
    202.88.151.25 - - [23/Aug/2001:13:03:02 +0530] "GET /portals/manage-portal-2?user_id=1&left=%7B5+2+3%7D+%7B%7D+%7B%7D+&right=%7B4+1%7D+%7B%7D+%7B%7D+&hiddennames=%7B%7D+%7B%7D+%7B%7D+&page_name1=&page_name2=&left2=null&right2=null&page_name3=&left3=null&new=null HTTP/1.0" 500 530 "http://202.88.151.25/portals/manage-portal.tcl" "Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)"
    202.88.151.25 - - [23/Aug/2001:13:03:52 +0530] "GET /admin/monitoring/watchdog/ HTTP/1.0" 200 23452 "" "Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)"
    202.88.151.25 - - [23/Aug/2001:13:03:52 +0530] "GET /pull-down-menus/style?menu_id=1 HTTP/1.0" 200 1172 "" "Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)"
    202.88.151.25 - - [23/Aug/2001:13:03:52 +0530] "GET /pull-down-menus/standard.js HTTP/1.0" 304 0 "" "Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)"
    202.88.151.25 - - [23/Aug/2001:13:03:52 +0530] "GET /pull-down-menus/pdm.js HTTP/1.0" 304 0 "" "Mozilla/4.75 [en] (X11; U; Linux 2.2.16-22 i686)"

Collapse
Posted by Peter Alberer on
Hi amit,

i think here is what you are looking for :)

https://openacs.org/sdm/one-baf.tcl?baf_id=988