Troubleshooting masters

Build 1501 on 14/Nov/2017  This topic last edited on: 18/Mar/2016, at 12:12

Problem

Cause

Solutions

There is no row with id XXX in gn_DataTable (ERR0219)

It's a known issue in builds prior to 1.6 when a new edition gets created from a template - the thumbnails of the masters in the new edition are linked to the ones of the template, therefore the edition created has the same thumbnail (binary) of the edition template. Then, when the edition is deleted and purged, the thumbnails of the masters are deleted (but being the same thumbnails of the edition template masters, there are also deleted).

It is fixed in 1.6: http://tracking.teradp.com/gn4/issues/GN4-1507

The fix cannot be integrated in versions prior to 1.6 - upgrade.

A "fix" is to either duplicate the offending master page (hence creating a new master page "Copy of X"), then deleting the original master page "X" and then re-naming "Copy of X" as "X"

Otherwise, there is an SQL command to run to re-set the thumbnail ID to zero within the master page.

update s_mastertable set s_thumbnail = 0 where s_thumbnail = 18493

Upgrade to 1.6.

An item with the same key has already been added.

 

 

Masters have duplicates of thumbnails.

This query creates a table named _DupMasterTable with IDs of the duplicated masters and then the last line of the query updates the master table, removing duplicated thumbnails.

If you intend to run it more times, uncomment the first line to remove the table created in the previous run:

--drop table _DupMasterTable

create table _DupMasterTable (Id int)

 

declare @id int, @thumbid int

declare @previd int

 

declare dupid cursor for

 

select s_id, s_thumbnail from s_MasterTable s where s_thumbnail>0 and 

(select count(*) from s_MasterTable where s.s_thumbnail=s_thumbnail)>1

order by s_thumbnail

 

open dupid

 

FETCH NEXT FROM dupid INTO @id, @thumbid

select @previd = 0

WHILE @@FETCH_STATUS = 0

BEGIN

      if @previd = @thumbid

      begin

            insert _DupMasterTable(Id) values(@id)

      end

      select @previd = @thumbid

      FETCH NEXT FROM dupid INTO @id, @thumbid

END 

 

CLOSE dupid

DEALLOCATE dupid

 

select * from _DupMasterTable

update s_MasterTable set s_thumbnail = null where s_id in (select id from _DupMasterTable)