Forum OpenACS Q&A: Delete Subsite Error

Collapse
Posted by Iuri Sampaio on
I'm trying to access the subsite i created and i get this error:
*************************
Server Error
The requested URL cannot be accessed due to a system error on this server.
AOLserver/4.0.10 on http://www.myybiz.net
******************************

I've got this error when i tryed to delete a subsite:
**************************
Error Deleting Instance
/ home / yabt / yabt / packages / dotlrn / www / dotlrn-master-kelp
The following error was returned:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: update or delete on "acs_objects" violates foreign key constraint "acs_objects_context_id_fk" on "acs_objects"
DETAIL: Key (object_id)=(196538) is still referenced from table "acs_objects".

SQL:
select apm_package__delete('196538');
*****************************

And if i try to unmount it i get this error:
*****************************
Server Error
/ home / yabt / yabt / packages / dotlrn / www / dotlrn-master-kelp
There was a server error processing your request. We apologize.

Take me back where I was (before the error)
wrong # args: should be "apm_package_key_from_id_mem package_id"
while executing
"apm_package_key_from_id_mem "
("eval" body line 1)
invoked from within
"eval $script"
invoked from within
"ns_cache eval util_memoize $script {
list $current_time [eval $script]
}"
(procedure "util_memoize" line 20)
invoked from within
"util_memoize "apm_package_key_from_id_mem $package_id""
(procedure "apm_package_key_from_id" line 2)
invoked from within
"apm_package_key_from_id $package_id"
(procedure "site_node::unmount" line 4)
invoked from within
"site_node::unmount -node_id $node_id"
("uplevel" body line 16)
invoked from within
"uplevel {
# packages/acs-core-ui/www/admin/site-nodes/unmount.tcl

ad_page_contract {

@author mailto:rhs@mit.edu
@creation-date 2000-09-12
@cvs-..."
(procedure "code::tcl::/home/yabt/yabt/packages/acs-subsite/www/admin/si..." 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
2: Re: Delete Subsite Error (response to 1)
Posted by Pavel Boghita on
I found that deleting stuff in OpenACS is generally messy, because various dependencies within the database.
I prefer not to do it. It's much easier to start all over again with a new database.
Collapse
Posted by Iuri Sampaio on
Well, what happens when you already have the structure already created and all the content on it. will you start over again?
It doesn't sound smart. You will have a slave job to re-create everything.
Collapse
Posted by Iuri Sampaio on
By the way...

Does anybody knows what would happen if i go to the respective table and just take away the duplicated records? Would that work out?

Collapse
5: Re: Delete Subsite Error (response to 1)
Posted by Dave Bauer on
What packages are in your subsite.

Each package is responsible to clean up after itself on delete. There is an APM callback that should be implemented.

So if you can tell us which packages are a problem and can't be deleted, it would hopefully lead to improvements to these packages.

In generaly to do this in the database you'd need to, at a minimum,

Call acs_object__delete() for every object that has the package_id in question as a foreign key in the acs_objects table.

If you are lucky that will completely delete all references to the object. If the object specific storage table has other foreign keys without on delete cascade, you'd have to track those down as well.

Collapse
Posted by Iuri Sampaio on
No Dave, i'm able to delete the pkg and the subsite as well.

On each subsite i installed only "edit-this-page pkg". But i believe the problems are on the references of that, which i don't know where they are located.

Because I "unmounted" and "deleted" edit-this-page on each subsite and after i "delete" the subsite. Then i create a new subsite with the same name and url, and install the edit-this-page aplication with the same name.

I did that because i created a structure of subsites but then i realised that i missed one level. then i had to re-built again. So, i just did the same process with the same names, in order to get rid of the problem, but then the bug show up.

however i'm concerned the pkg-keys are unique for each instance, even if you uninstall and install another with the same names, the new one will receive a different pkg-key.
So it means the references haven't been deleted of the system.

Collapse
Posted by Iuri Sampaio on
By the way,
I found a link that takes me to unmounted packages. there i found all the packages i had unmounted and deleted, But they are stills there. Why?
Futhermore, i tried to delete them and i got this error message:

Error Deleting Instance
/ home / yabt / yabt / packages / dotlrn / www / dotlrn-master-kelp
The following error was returned:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: update or delete on "apm_packages" violates foreign key constraint "cr_fldr_pkg_id_fk" on "cr_folders"
DETAIL: Key (package_id)=(197967) is still referenced from table "cr_folders".

SQL:
select apm_package__delete('197967');

Collapse
8: Re: Delete Subsite Error (response to 1)
Posted by Dave Bauer on
You have unmounted the package instance, and removed the site node, but not the package instance.

A package key is never unique. You can have many instances of the same package "forums" or "file-storage".

If you need to put a package instance in another subsite unmounting it, and then re-mounting it in the new subsite is a good solution.

Create a new folder then click on mount next to the new folder and you will get a list on unmounted package instances you can put into that folder in the site-map.

Collapse
Posted by Iuri Sampaio on
Thanks,I understood that.
But what if i want to get rid of it. Because i believe that's why i'm getting the error message bellow, ins't it?

**************************
Error Deleting Instance
/ home / yabt / yabt / packages / dotlrn / www / dotlrn-master-kelp
The following error was returned:

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: update or delete on "acs_objects" violates foreign key constraint "acs_objects_context_id_fk" on "acs_objects"
DETAIL: Key (object_id)=(196538) is still referenced from table "acs_objects".

SQL:
select apm_package__delete('196538');
*****************************

And if i try to unmount it i get this error:
*****************************
Server Error
/ home / yabt / yabt / packages / dotlrn / www / dotlrn-master-kelp
There was a server error processing your request. We apologize.

Take me back where I was (before the error)
wrong # args: should be "apm_package_key_from_id_mem package_id"
while executing
"apm_package_key_from_id_mem "
("eval" body line 1)
invoked from within
"eval $script"
invoked from within
"ns_cache eval util_memoize $script {
list $current_time [eval $script]
}"
(procedure "util_memoize" line 20)
invoked from within
"util_memoize "apm_package_key_from_id_mem $package_id""
(procedure "apm_package_key_from_id" line 2)
invoked from within
"apm_package_key_from_id $package_id"
(procedure "site_node::unmount" line 4)
invoked from within
"site_node::unmount -node_id $node_id"
("uplevel" body line 16)
invoked from within
"uplevel {
# packages/acs-core-ui/www/admin/site-nodes/unmount.tcl

ad_page_contract {

@author mailto:rhs@mit.edu
@creation-date 2000-09-12
@cvs-..."
(procedure "code::tcl::/home/yabt/yabt/packages/acs-subsite/www/admin/si..." 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..."