Project Server 2016: Missing some UserViews?

*** 4/2/2018 - the fix was released in January but there is still one condition that might catch you out - if you have recently deleted a PWA then the site could still be in the recycle bin - and there will be an additional row in the pjpub.MSP_WEB_ADMIN table - so we will not create the views as the site could be restored.  Deleting fully should then allow you to add the views using the commands below.  ***

*** 12/20/2017 - the fix for this issue will be delivered in the January PU - planned for 1/9/2018 ***

We are still hunting down the cause of this issue but we are seeing either fresh Project Server 2016 Project Web App instances or updates to Project Server 2016 causing some of the usual views in the pjrep schema used for reporting to be dropped. One example of a missing view is the pjrep.MSP_EpmProject_UserView.  If you are familiar with 2013 then these views now in the pjrep schema were in the dbo schema of the Project Server 2013 database.



You can re-create the views by running the following PowerShell command in the SharePoint Management Shell

Repair-SPProjectWebInstance <PWA URL> -RepairRule 7


Once this complete, which only take s a few seconds, you should see the familiar views:


I plan to do a more complete description of the ‘Repair’ command soon as I am sure you are all thinking  “What are the other RepairRules?”.

And a reminder – we only support direct access via these views if there is only a single PWA site in the content database.  So if you need direct access such as SQL Server Reporting Services then you will need to add additional content databases and have each PWA in its own.  For OLAP and OData reporting this restriction does not apply. *** And thanks Steve Sanderlin for the reminder - we don't just not support direct access when there is more than 1 PWA - but we don't create the views ***

Comments (43)

  1. Thanks, Brian.
    What are the other Repair Rules? 🙂

  2. This is great news!! I have two separate local installs where these tables did not appear and I was trying to re-create them myself. Thanks!!

  3. I think there are mistake in stored procedure [pjrep].[MSP_Epm_GenerateAllMultiValueAssociationViews]
    in rows: SET @i = 1
    WHILE (@i 1
    PRINT ‘Skipping Reporting View creation. Reporting views are created for single tenant databases only’
    RETURN @Result
    CREATE TABLE #TBL_Reporting_MutliValuedCF(
    CF_INDEX int IDENTITY (0,1),–Here is temp table identity, starts from 0, not 1
    CustomFieldTypeGuid uniqueidentifier)
    CREATE CLUSTERED INDEX CL ON #TBL_Reporting_MutliValuedCF(CustomFieldTypeGuid)
    SET @i = 0–original text was SET @i = 1
    INSERT INTO #TBL_Reporting_MutliValuedCF(CustomFieldTypeGuid)
    SELECT AttributeTypeUID AS CustomFieldTypeGuid FROM pjrep.MSP_TVF_EpmMetadataAttribute(@siteId)
    WHERE AttributeIsIntrinsic = 0 AND AttributeIsMultiValueEnabled = 1
    SELECT @Count = COUNT(CustomFieldTypeGuid) FROM #TBL_Reporting_MutliValuedCF
    WHILE (@i < @Count)–original text was WHILE (@i <= @Count)
    @CustomFieldTypeGuid = CustomFieldTypeGuid
    FROM #TBL_Reporting_MutliValuedCF
    –in original procedure @CustomFieldTypeGuid always was NULL
    EXEC @Result = pjrep.MSP_Epm_GenerateMultiValueAssociationView @siteId, @CustomFieldTypeGuid
    IF @Result != 0 GOTO LblError
    SELECT @i = @i + 1
    DROP TABLE #TBL_Reporting_MutliValuedCF
    RETURN @Result

    1. Thanks Sergey, taking a look at this now.
      Best regards,

      1. Christoph Mülder says:

        Hi Brian,
        is this a known issue now, or do we need to open a call for it?

        1. Opening an incident would probably help Christoph – it is ‘known’ but will get more attention with a customer behind it.
          Best regards,

    2. CarlD says:

      confirmed the bug from my side! If you have MV fields then this sproc is executed in the repair, and this fails unless you change as noted to

      CREATE TABLE #TBL_Reporting_MutliValuedCF(
      CF_INDEX int IDENTITY (1,1),

      1. Christoph Mülder says:

        yes. it fails if there is exactly 1 multi value custom field. If there are none, it will not execute at all. If there are more than one, it will just create the views for all multi value fields except the first it gets.

  4. Kurt Verhaegen says:

    Hi Brian,
    Could it be that OLAP cube configuration is not working if the user_views don’t exist.
    I can configure the OLAP cube (add ent. custom fields to cube configuration), however the configuration is not saved.
    OLAP cube is building with standard dimensions & measures.
    I’m having 2 PWA sites provisioned (instances).
    Or is this independent of the missing userViews?

  5. Trutz-Sebastian Stephani says:

    Is it supported to move PWA instances between content databases using the Move-SPSite/Copy-SPSite PowerShell command now that all “content” is stored in the SharePoint content DB?

    1. I’ve successfully used Move-SPSite – and that is ideal to move a site to its own Content DB for reporting purposes. I’ve not used Copy-SPSite – I’d be a bit more hesitant saying that is supported.
      Best regards,

      1. Trutz-Sebastian Stephani says:

        Thank you for this confirmation.

  6. Ray Letts says:

    Hi all and thank you Brian for this. It did help certainly however it brought back the default out of the box views without any custom fields added.
    We came up with a trick we can offer to help others to get Project Server to redo the views with your organization’s custom fields.
    Using the service that drops and recreates the views when custom fields are modified/created we renamed all the custom fields; that rebuilt the views. then we renamed them back to the original names and we now had our views with the organization’s custom fields.
    Ray Letts
    Arbutus Solutions

    1. Thanks for sharing this Ray – we do have a hotfix in progress for this so hopefully we will have a better solution soon.
      Best regards,

      1. Saeed Zaman says:

        May I request to let us know the scheduled CU release for the fix of Missing user views ?

        1. I’m following up on it Saeed, Mustaq – more news when I have it.
          Best regards,

          1. We have the fix going through code review now Saeed/Mustaq and expect it to get into the March PU.
            Best regards,

          2. Mustaq says:

            Thanks for the update Brian Smith. We look forward for the same :).

          3. mustaq says:

            Issue is still occurring with March 2017 CU.

          4. Can you explain a bit more Mustaq? Are you finding the views get removed? Remember that if you have more than 1 PWA ina content DB then you don’t get views.
            Best regards,

          5. Hi Brian,
            Yes, we noticed views getting dropped even after March 2017 CU. I also confirm that we have only one PWA per content database.

  7. Mustaq Hussain says:

    Brian Smith, We are facing this issue of missing views very frequently, Can you please help us with scenarios that creates this issue and also if there is a ETA for the permanent fix. We are running the repair command to get this fixed. But we cannot do this frequently.

  8. Greg Mitchell says:

    Repair failed on our install
    RepairRDBViews failed. Error: System.Data.SqlClient.SqlException (0x80131904): Invalid parameter @CustomFieldTypeGuid when call MSP_Epm_GenerateMultiValueAssociationView. No such custom field found Failed to generate the Association Views User View Creation

    1. Hi Greg, and my apologies this comment slipped past me earlier in the year. Did you get that one resolved?
      Best regards,

  9. flori says:

    For the two issues

    IF @SiteCount > 0 => IF @SiteCount > 1

    CF_INDEX int IDENTITY (0,1), => CF_INDEX int IDENTITY (1,1),

    this might help.

    1. Project says:

      The repair command creates the missing views under WSS.
      Every night the disappear, any reason for that ? how can it be permanent ?

      1. Hi Flori, I am hearing that after loading the June CU the views are not getting created – but I hadn’t heard that they were being removed again after running the repair. Do you have more than one PWA site in the same content DB? In that case we do not support direct reporting so there may be a timer job stripping them.
        Best regards,

        1. Florian Grimm says:

          Hello Brian

          I updated my Project to cu oktober 2017 – no more views

          On my current DB
          result is 1. — this is what pjrep.MSP_Epm_GetSiteCollectionCount does

          The Project SQL Code
          ALTER PROCEDURE [pjrep].[MSP_Epm_GenerateAllUserViews]
          … snip …
          EXEC pjrep.MSP_Epm_GetSiteCollectionCount @SiteCount OUT
          IF @SiteCount > 0
          PRINT ‘Skipping Reporting View creation. Reporting views are created for single tenant databases only’
          … snap….

          so IF @SiteCount > 0
          is executed as if 1>0
          which means NO user views.

          BUT Since sometimes their are user views, I think their could be any timing thing / race condition.
          IMHO instead of
          IF @SiteCount > 0
          you may use
          if (EXISTS(SELECT SiteId FROM pjpub.MSP_WEB_ADMIN WHERE SiteId != @SiteId))
          to ask is their any other sitecollection than the PWA.

          Regards Flori

          1. Thanks Flori – a good analysis. I saw this same thing myself. I should be able to get a fix request going on this one again. The repair job does seem to work – at least for me it did.
            Best regards,

  10. Lali Murray says:

    I just installed June 2017 PU on my SharEPoint/Project 2016 farm, and it made the UserViews disappear again. I ran the report query and it worked, but this behaviour is not listed as a regression as far as I know. Previous PU/CU I installed did not impact UserViews.

    1. Lali Murray says:

      Apologies, I meant to say I ran Repair Command**, not Report Query.

      1. Hi Lali, I am hearing that the behavior has re-appeared. Could you open a support ticket so we can track the fix please?
        Best regards,

        1. imma Strassburg says:

          Hello Brian, we encountered the issue that the ECF are missing. Any news when this will be fixed, because it brigns alot of problems.
          Kind regards

          1. mustaq says:

            ECF ? Did you mean views or Custom fields ?

        2. Lali Murray says:

          Hi Brian,
          Views just disapeared again after installing August 2017 CU. I’ll run the script to fix them and then open a support case.
          Thank you,

          1. Hi Lali, Did you get chance to open Microsoft Incident and any update?

  11. Adrian says:

    Hi Brian,

    have you ever gotten around to the other Repair rules?
    For the interested, they are listed on under next to Microsoft.Office.Project.Server.HealthRules.ProjectSiteHealthRuleName

    Best regards,

  12. Hello All,
    I have tried with suggested powershell cmlet i.e.
    Repair-SPProjectWebInstance -RepairRule 7
    Then also tried to turn off language timer job as well. But no luck !
    All the missing user views are still missing. I have already used march patch also.
    Can any one help me out here, any script of any other configuration!
    Please suggest !

    1. If you have more than one PWA in your content database then the views will never get created so be sure that this isn’t the cause first OldMonkinSearch. Take a look in pjpub.MSP_WEB_ADMIN – each row is a PWA definition. Are you getting any errors when you try the repair? Best open a case if you are still having issues. I am aware of some current cases where it appears that custom field definitions appear to be causing some view creation problems. I’ll post back once we get to the bottom of that particular issue.
      Best regards,

  13. Rajkumar says:

    Wow……. Thanks a lot Brian Smith.. the command Repair-SPProjectWebInstance -RepairRule 7 worked like a charm…

  14. The fix for this issue should be delivered in the January Update – due to release 1/9/2018. Happy New Year!

  15. garciagu says:

    Hi Brian,

    I’ve applied the rule and I get a ‘The RDB User Views repair failed. Check the logs for more information’. A ULS entry says:

    System.Data.SqlClient.SqlException (0x80131904): Cannot drop the view ‘pjrep.MSP_EpmProject_UserView’, because it does not exist or you do not have permission. Failed to generate the user entity views

    I even added a dummy prep.MSP_EpmProject_UserView but get the same message and the dummy view I added gets deleted.

    Please help!

Skip to main content