Forum OpenACS Q&A: Upgrading problem: Could not find a root folder for item ID 0

Hi.

I've got an error while I was upgrading acs-content-repository from version "5.1.5" TO "5.2.0d16", but after upgrading I tried to add a comment in the lars-blogger package and I got this error:

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

ERROR: -20000: Could not find a root folder for item ID 0. Either the item does not exist or its parent value is corrupted.
CONTEXT: PL/pgSQL function "content_item__new" line 50 at assignment
PL/pgSQL function "content_item__new" line 20 at assignment
PL/pgSQL function "acs_message__new" line 50 at assignment

SQL:
select acs_message__new (
'14627', -- 1 p_message_id
NULL, -- 2 p_reply_to
current_timestamp, -- 3 p_sent_date
NULL, -- 4 p_sender
NULL, -- 5 p_rfc822_id
'Test6', -- 6 p_title
NULL, -- 7 p_description
'text/plain', -- 8 p_mime_type
NULL, -- 9 p_text
NULL, -- empty_blob(), -- 10 p_data
0, -- 11 p_parent_id
'14602', -- 12 p_context_id
'1709', -- 13 p_creation_user
'172.16.0.248', -- 14 p_creation_ip
'acs_message', -- 15 p_object_type
't' -- 16 p_is_live
)

I tried to put a null value in p_parent_id but it throw me another error:

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

ERROR: -20000: This items content type acs_message_revision is not registered to this folder -100
CONTEXT: PL/pgSQL function "content_item__new" line 20 at assignment
PL/pgSQL function "acs_message__new" line 50 at assignment

SQL:
select acs_message__new (
'14629', -- 1 p_message_id
NULL, -- 2 p_reply_to
current_timestamp, -- 3 p_sent_date
NULL, -- 4 p_sender
NULL, -- 5 p_rfc822_id
'Test6', -- 6 p_title
NULL, -- 7 p_description
'text/plain', -- 8 p_mime_type
NULL, -- 9 p_text
NULL, -- empty_blob(), -- 10 p_data
NULL, -- 11 p_parent_id
'14602', -- 12 p_context_id
'1709', -- 13 p_creation_user
'172.16.0.248', -- 14 p_creation_ip
'acs_message', -- 15 p_object_type
't' -- 16 p_is_live
)

Any suggestions on how can I solved this problem ??
If you need more info of the problem, just tell me.

Paolo