Sorry, something went wrong An entry with the same key already exists In SharePoint

In this article, I will explain How to

Remove PWA Instance ORPHANED In Project Server Application Service.


Scenario

In SharePoint and Project Server 2013, I removed a PWA Instance in Project Server Application Service via Central Administration.

I have tried to recreate a new one with the same details of the previously deleted instance. Unfortunately,  I got the below error:

Sorry, something went wrong An entry with the same key already exists.

Sorry, something went wrong An entry with the same key already exist.


Cause

The “Sorry, something went wrong An entry with the same key already exists.” usually occurs because the configuration details of the PWA instance that have been deleted is still stored in Project Server Application Service configuration.

Therefore, you can’t create a new PWA Instance with the same details of the previously deleted instance till removing and clearing the existing orphaned.


Solution

Delete ORPHANED In SharePoint

  • Run SharePoint Management Shell as administrator,

SharePoint 2013 Management Shell

  • Run the below cmdlet to get the Project Server application service details assigned to $serviceapp object.

$serviceapp = get-spserviceapplication | ? {$_.TypeName –like "*Project*"}

  • Call object $serviceapp to list all PWA application services with its related id.
$serviceapp

Get PWA Service ID In Project Server

  • If you have configured more than one PWA application services. In this case, you should get the PWA Application service ID that hosted the deleted PWA instance using the below cmdlet.
$serviceapp = get-spserviceapplication | ? {$_.Id –eq "Service ID"}
  • Define a new object to hold all Site Collections/instances related to Project Server application service.
$pwainst = $serviceapp.Sitecollection
$pwainst

Get PWA Service site collections In Project Server

  • After calling “$pwainst” object, the output should show all instances details within the Project Server application service as shown below.

Remove PWA Instance ORPHANED In Project Server Application Service.

Although I didn’t provision any PWA instances yet, but I got instance details, and that means the configuration details of the deleted PWA instance is still stored in the Project Server application service configuration.

  • Copy the Site Id, then paste it to the following command to remove its orphaned.
$siteid = $pwainst | ? {$_.siteId –eq ""}
$siteid
$siteid.Delete()
  • Again, Call “$pwainst” object to ensure that all orphaned has been cleared.
  • Go back to provision a new PWA instance that should be now worked properly.

Provision PWA Instance In Project Server


Applies To
  • Project Server 2016.
  • Project Server 2013.
  • Project Server 2010.
  • SharePoint Server 2016.
  • SharePoint Server 2013.
  • SharePoint Server 2010.
See Also

DELETE PROJECT SERVICE APPLICATION SERVICE USING POWERSHELL.

Advertisements

7 thoughts on “Sorry, something went wrong An entry with the same key already exists In SharePoint

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s