Summary
When you view the Recycle Bin in Laserfiche Client 8.1.x, you may receive the following error message:
General database error. [9008]
In the Windows Event Log on the Laserfiche Server, you may see an LFS warning with event ID 10050 that is similar to the following message:
Database statement execution error encountered. Session ID: nnnn; Dialog ID: nnnnnnn; Repository: 'MyRepository'; CLI routine: SysRecycleBinOpenListing; Message: [Microsoft][SQL Native Client][SQL Server]Arithmetic overflow error converting expression to data type int.; SQL Statement: 'select c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17 from(select top 500 c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17 from(select top 78321 tocid as c1, etype as c2, case when (type = 1 or type = 2) and orig_name is not null then 'RECYCLE BIN' else orig_parent end as c3, deleted as c4, created as c5, deleter as c6, toc_uuid as c7, case when orig_name is null then parent_name else orig_name end as c8, trustee_name as c9, account_name as c10, edoc_mime as c11, edoc_ext as c12, type as c13, page_num as c14, page_count as c15, edoc_storeid as c16, file_size as c17 from global_recycle_bin where deleter is not null order by c1 asc) as q1 order by c1 desc) as q2 order by c1 asc'; SQL variable: ''; SQL State: 22003.
This error can occur when the Recycle Bin contains a document that has more than 2147483647 bytes of page part data. This issue does not prevent the Laserfiche Administration Console from displaying the contents of the Recycle Bin.
Resolution
Update the "global_recycle_bin" view in the SQL Server database to resolve this issue.
Note: This issue does not affect Oracle databases.
Download the following zip file containing a SQL script file. The script file updates a view in your Laserfiche database.
Note: Please stop the Laserfiche Server prior to running the script.
The script contains the following ALTER statement.
alter view global_recycle_bin
(
tocid, etype, type, orig_parent, deleted, created, deleter, toc_uuid, parent_name, orig_name,
trustee_name, account_name, edoc_mime, edoc_ext, page_num, page_count, edoc_storeid, file_size
)
as
select
toc.tocid, etype, 0, orig_parent, deleted,
created, deleter, toc_uuid, NULL, orig_name, trustee_name,
account_name, edoc_mime, edoc_ext, 0, pagecount,
0, isnull(edoc_size, 0) +
(select isnull(sum(cast(img_size as bigint)),0) + isnull(sum(cast(txt_size as bigint)),0) +
isnull(sum(cast(loc_size as bigint)),0) + isnull(sum(cast(lft_size as bigint)),0)
from doc where doc.tocid = toc.tocid)
from recycle_bin join toc on recycle_bin.tocid = toc.tocid
left outer join trustee on recycle_bin.deleter = trustee.sid
left outer join account_cache on recycle_bin.deleter = account_cache.account_sid
union all
select
toc.tocid, etype, 1, doc.orig_parent, doc.deleted,
created, doc.deleter, toc_uuid, toc.name, recycle_bin.orig_name, trustee_name,
account_name, edoc_mime, edoc_ext, old_pagenum, 1,
storeid, isnull(img_size, 0) + isnull(txt_size,0) + isnull(loc_size,0) + isnull(lft_size,0)
from doc join toc on doc.tocid = toc.tocid
left outer join trustee on doc.deleter = trustee.sid
left outer join account_cache on doc.deleter = account_cache.account_sid
left outer join recycle_bin on doc.tocid = recycle_bin.tocid
where pagenum < 0
union all
select
toc.tocid, etype, 2, recycle_elec.orig_parent, recycle_elec.deleted,
created, recycle_elec.deleter, toc_uuid, toc.name, recycle_bin.orig_name, trustee_name,
account_name, recycle_elec.edoc_mime, recycle_elec.edoc_ext, 0, 0,
recycle_elec.edoc_storeid, recycle_elec.edoc_size
from recycle_elec join toc on recycle_elec.tocid = toc.tocid
left outer join trustee on recycle_elec.deleter = trustee.sid
left outer join account_cache on recycle_elec.deleter = account_cache.account_sid
left outer join recycle_bin on recycle_elec.tocid = recycle_bin.tocid
GO