I have the code but and problem

Author: RM

Date: 2011-07-05
I have a site on Plone 4 on a localhost.
When i try to validate the code it writes Error Type
IntegrityError
Error Value
ERROR: insert or update on table "site_tokens" violates foreign key constraint "$2" DETAIL: Key (token_id)=(37188) is not present in table "tokens". select nextval(tokens_token_id_seq
); insert into tokens (token_id, start_date , service_id , value , customer , self_destruct ) select currval(tokens_token_id_seq
) , now() , s.service_id ,52428800
,ma23383
,1 from services as s inner join categories as c on c.category_id = s.category_id and s.description = Storage
and c.name = objectis
; insert into site_tokens (site_id,token_id) select 18641, currval(tokens_token_id_seq
); select token_id from tokens where token_id = currval(tokens_token_id_seq
)
Can you tell me where is my problem, is the problem if i havent configuration for smpt server for mails,or sql base.Thank you for the attencion and i hope to get the answer with Your help!