failed update 2.11 to 2.11.1

11 views
Skip to first unread message

sn...@bsd.uchicago.edu

unread,
Nov 22, 2022, 3:59:32 PM11/22/22
to ProfilesRNS
We're in the process of upgrading from 2.9 to latest. Unfortunately we've run into an issue between 2.11 and 2.11.1 as follows when running  ProfilesRNS_Upgrade_Schema.sql. The script  encountered an error building two indexes due to unique key violations and then continued.

The index creation statements are:
ALTER TABLE [Profile.Data].[Person.FacultyRank]
    ADD CONSTRAINT [UC_FacultyRank_FacultyRank] UNIQUE NONCLUSTERED ([FacultyRank]
ALTER TABLE [Profile.Data].[Person.FacultyRank]
    ADD CONSTRAINT [UC_FacultyRank_FacultyRankSort] UNIQUE NONCLUSTERED ([FacultyRankSort] ASC);

Dropping [Direct.Framework].[AddLogIncoming]...
Dropping [Direct.Framework].[AddLogOutgoing]...
Dropping [Direct.Framework].[UpdateLogOutgoing]...
Dropping [Profile.Data].[Group.GetPhotos]...
Creating [Ontology.].[ClassPropertyCustom]...
Creating [Profile.Data].[UC_Department_DepartmentName]...
Creating [Profile.Data].[UC_Division_DivisionName]...
Creating [Profile.Data].[UC_Institution_InstitutionAbbreviation]...
Creating [Profile.Data].[UC_Institution_InstitutionName]...
Creating [Profile.Data].[UC_Person_InternalUserName]...
Creating [Profile.Data].[UC_PrimaryAffiliation]...
Creating [Profile.Data].[UC_FacultyRank_FacultyRank]...
Msg 1505, Level 16, State 1, Line 129
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'Profile.Data.Person.FacultyRank' and the index name 'UC_FacultyRank_FacultyRank'. The duplicate key value is (<NULL>).
Msg 1750, Level 16, State 1, Line 129
Could not create constraint or index. See previous errors.
The statement has been terminated.
Creating [Profile.Data].[UC_FacultyRank_FacultyRankSort]...
Msg 1505, Level 16, State 1, Line 138
The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'Profile.Data.Person.FacultyRank' and the index name 'UC_FacultyRank_FacultyRankSort'. The duplicate key value is (<NULL>).
Msg 1750, Level 16, State 1, Line 138
Could not create constraint or index. See previous errors.
The statement has been terminated.
Creating [User.Account].[UC_User_InternalUserName]...
Altering [Framework.].[CreateInstallData]...
Altering [Framework.].[LoadInstallData]...
Altering [Ontology.].[CleanUp]...
Altering [Profile.Data].[Person.GetFacultyRanks]...
Altering [Profile.Data].[Person.GetPhotos]...
Altering [RDF.].[GetDataRDF]...
Creating [Direct.].[AddLogIncoming]...
Creating [Direct.].[AddLogOutgoing]...
Creating [Direct.].[UpdateLogOutgoing]...
Altering [Profile.Data].[Concept.Mesh.ParseMeshXML]...
Refreshing [Search.Cache].[Public.GetConnection]...
Refreshing [Search.Cache].[Private.GetConnection]...
Refreshing [Search.].[GetConnection]...
Update complete.

Our DBA would prefer not to proceed further until this is resolved. Pointers?

Thank you,
Stephan

Meeks, Eric

unread,
Nov 22, 2022, 4:39:41 PM11/22/22
to profi...@googlegroups.com

Looks like you have some duplicate values in the FacultyRankSort column of the [Profile.Data].[Person.FacultyRank] table, or maybe you have a NULL in that column. Just clean that up with real unique numeric values and you should get past this.

When you put values in, do so such that

SELECT * FROM [Profile.Data].[Person.FacultyRank] order by FacultyRankSort

puts things in the order in which you want them to appear in the dropdown. We redid ours a few years ago and did it in increments of 10 so that we could squeeze more in if we ever wanted to without having to alter the others, so instead of 1,2,3,… we did 10,20,30,… but really, anything that sorts them correctly is fine.

 

Eric

From: profi...@googlegroups.com <profi...@googlegroups.com> On Behalf Of sn...@bsd.uchicago.edu
Sent: Tuesday, November 22, 2022 1:00 PM
To: ProfilesRNS <profi...@googlegroups.com>
Subject: [ProfilesRNS] failed update 2.11 to 2.11.1

 

We're in the process of upgrading from 2. 9 to latest. Unfortunately we've run into an issue between 2. 11 and 2. 11. 1 as follows when running ProfilesRNS_Upgrade_Schema. sql. The script encountered an error building two indexes due to unique key

ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

--
You received this message because you are subscribed to the Google Groups "ProfilesRNS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to profilesrns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/profilesrns/b7cff443-43e7-49ae-a937-09e8e04510d6n%40googlegroups.com.

Noe, Stephan [BSD]

unread,
Nov 22, 2022, 5:24:06 PM11/22/22
to profi...@googlegroups.com

Eric –

 

Now a little more confused.

 

We have 3,544 rows in [ProfilesRNS].[Profile.Data].[Person.FacultyRank] which doesn’t seem to be consistent with the use case I’m assuming based on your response. To my knowledge we’ve never touched that table directly in any way.

 

In [ProfilesRNS].[Profile.Import].[PersonAffiliation] which we do load into, we have 3,186 rows, with exactly one row per faculty, with primaryaffiliation and affiliationorder always 1, and facultyrank and facultyrankorder always null if that matters.

 

Stephan


“This message was received from outside of the organization. Please pay special attention and practice care when clicking on any links, or providing any information to the sender. Cyber attacks commonly attempt to trick you in to thinking the sender is a reputable individual who you can trust.”

--
You received this message because you are subscribed to a topic in the Google Groups "ProfilesRNS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/profilesrns/7rufde7Lps8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to profilesrns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/profilesrns/BYAPR05MB5560B43E02E881FF3DE18C2EE50D9%40BYAPR05MB5560.namprd05.prod.outlook.com.

Meeks, Eric

unread,
Nov 22, 2022, 6:06:17 PM11/22/22
to profi...@googlegroups.com

Yeah, having NULL in facultyrank in the [Profile.Import].[PersonAffiliation] is likely messing things up. I’d try putting in an empty string for facultryrank and setting the facultyrankorder to 10 or some constant for everyone. You’ll need to clean out all the null entries in Person.FacultyRank as well. Once you get stuff cleaned up you can set the Visible flag to 0 in Person.FacultyRank so it doesn’t mess with the UI. Once all this is done you should just have the one empty string entry in Person.FacultyRank and it would be wired to everyone.


Eric

 

From: profi...@googlegroups.com <profi...@googlegroups.com> On Behalf Of Noe, Stephan [BSD]
Sent: Tuesday, November 22, 2022 2:24 PM
To: profi...@googlegroups.com
Subject: Re: [ProfilesRNS] failed update 2.11 to 2.11.1

 

Eric – Now a little more confused. We have 3,544 rows in [ProfilesRNS]. [Profile. Data]. [Person. FacultyRank] which doesn’t seem to be consistent with the use case I’m assuming based on your response. To my knowledge we’ve never touched that table

Brown, Nicholas William

unread,
Nov 22, 2022, 7:46:27 PM11/22/22
to profi...@googlegroups.com

In version 2.11.1 we added unique constraints to 7 tables. Some of the queries in the dataloading process have joins that cause a huge amount of incorrect data to be created in profiles when certain fields are not unique. This is all described in the install guide, and tested for in the [Profile.Import].[ValidateProfilesImportTables] procedure, but after helping a couple of institutions fix issues caused by data errors, I decided to add the constraints, which cause the data load transaction to roll back when the data fails these constraints.

 

You shouldn’t have any problems having facultyrank and facultyranksort null for everyone. This is fine in profiles. You may run into issues if facultyrank is null for some users and not null for others. What it sounds like happened here is that you used to load facultyrank into profiles, and you no longer do (again this should be fine) but you had some duplicate null values in the facultyrank tables. These probably didn’t cause any issues in profiles as the joins wouldn’t have matched the nulls anyway. Hence why this was never noticed. Now you are applying the uniqueness constraint, and this is breaking the constraint.

 

There are a couple of fixes you can make for this:

  1. You can run the rest of the upgrade without adding the uniqueness constraint, not having the constraint won’t affect the running of profiles, and you are not loading facultyrank, so you are not going to load any bad data.
  2. You can delete the unused facultyranks from the facultyrank table

delete from [Profile.Data].[Person.FacultyRank] where FacultyRankID not in (select distinct FacultyRankID from [Profile.Data].[Person.Affiliation])

                If this doesn’t work, you probably have inactive users with facultyrank values, you would need to fix this by updating their facultyrankID values in [Profile.Data].[Person.Affiliation] to the value for the null facultyranks (I’m not sure if this would be a null or a value) and then run EXEC [Profile.Cache].[Person.UpdatePerson] and EXEC [Profile.Cache].[Person.UpdateAffiliation]

 

Nick

Noe, Stephan [BSD]

unread,
Dec 7, 2022, 4:32:31 PM12/7/22
to profi...@googlegroups.com

Sorry the delay. None of the suggestions allowed us to create the constraints.

 

In [Profile.Import].[PersonAffiliation] we have 3,175 rows, with 73 distinct ‘titles’ and in every case FacultyRank, FacultyRankOrder both set to null.

 

In [Profile.Data].[Person.Affiliation] we likewise have 3,175 rows, 73 distinct ‘Title’ and FacultyRankID always null.

 

In [Profile.Data].[Person.FacultyRank] we have 3,559 rows(?) with FacultyRank, FacultyRankSort always null.

 

My DBA was wondering if we could truncate [Person.Affiliation], [Person.FacultyRank], safely and re-run the jobs to see the outcome?

 

Would we be correct in assuming that we’d expect to see 73 rows in [Profile.Data].[Person.FacultyRank]?

 

I should also add we just realized we have 4,103 rows in [Profile.Import].[Person] but only 3,175 rows in [Profile.Import].[PersonAffiliation]. [Profile.Import].[PersonFilterFlag] has 4,103 rows. Our best guess here is the original maintainer populated person, personaffiliation, and personfilterflag tables out of band in a somewhat ad hoc manner some years ago, we’ve since automated that process and all three tables should be populated in lockstep. Unfortunately I don’t have a good data source to backfill the missing information for the outliers.

 

Thanks,

 

Stephan

Brown, Nicholas William

unread,
Dec 7, 2022, 4:44:49 PM12/7/22
to profi...@googlegroups.com

You should be able to truncate that table and rerun the jobs.

 

If you have more records in the Profile.Import.Person table than the Profile.Import.PersonAffiliation table, I would expect that you would run into issues. I would recommend deleting (or setting isActive = 0) in the Profile.Import.Person table for anyone without a corresponding record in the PersonAffiliation table.

 

Nick

Reply all
Reply to author
Forward
0 new messages