Doing a manual installation with the following configuration:

Drupal 7.4 on Server 2008 R2
PHP 5.3.5
SQL 2008 R2 on Server 2008 R2 (separate machine)

All the pre-requisites for IIS and installed as indicated in the documentation. Everything goes good until it gets to the portion where I define the database and it starts to create tables. It creates tables, and somewhere in the proecss it throws the following error:

SQLSTATE[23000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'registry_pkey'. Cannot insert duplicate key in object 'dbo.registry'.

Is there an issue related to SQL 2008 R2, or something else? I have ability to use a SQL 2005 server if there has been no testing done for SQL 2008 R2. Unfortunately, I do not have a SQL 2008 server available.

Comments

defigo’s picture

I am running in to the same problem here with the same setup except is says:

SQLSTATE[23000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]
Violation of PRIMARY KEY constraint 'registry_pkey'.
Cannot insert duplicate key in object 'dbo.registry'.
The duplicate key value is (DatabaseConnection_sqlsrv, class).

This error shows up when I try to update the database or clear the cache.

I was wondering if you where able to resolve this, if so how where you able to do so?

brianharcourt’s picture

SQLSTATE[23000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'registry_pkey'. Cannot insert duplicate key in object 'dbo.registry'.

Drupal 7.8
Amazon EC2 Windows Datacenter edition
SQLServer Express
IIS7

dbo.registry seems to be empty - so I don't know where they are seeing the duplicate key.

Worth noting - this has been a struggling install: Am down to dropping the database, 'refreshing' the settings file, and restarting IIS7. Are the db transactions cached somewhere?

TechAttitude’s picture

Are you installing it on an IIS server for local host usage?

brianharcourt’s picture

Hi Sashwat,

Yes - this is localhost. It's a dev environment. All components on one machine.

dAv3’s picture

I get the same thing with a fresh install:

- Windows Server 2008 R2
- MS SQL Server R2
- PHP 5.3
- Drupal 7.8 (Acquia install profile)

SQL Server is located on same machine, however i was told to change the db server location from localhost to 'SERVERNAME'\SQLEXPRESS

GennittiGM’s picture

I am not sure if this question was already answered someplace else on the site, but if someone can assist or direct me, it would be greatly appreciated.

I am trying to perform a manual install of Drupal on a Windows Server 2008 (IIS 7), with a conection to a seperate MSSQL 2008 server.

I can't use the Web Platform Installer so I have to make the install manually. I am truley a beginner and need the instaltion instructions step by step.

Anyone who can help? Thanks

-Greg-

Gideon77’s picture

I wrote a kludge fix to work around the bug: ignore the PHP exception that is thrown when attempting to insert a duplicate row in the registry table.

To fix the problem, modify the file includes/registry.inc as follows.

*** orig\registry.inc	2011-10-12 03:10:22.000000000 -0400
--- registry.inc	2012-02-29 13:21:03.410406200 -0500
*************** function _registry_parse_file($filename,
*** 176,182 ****
          'weight' => $weight,
        ));
      }
!     $query->execute();
    }
  }
  
--- 176,189 ----
          'weight' => $weight,
        ));
      }
!     //$query->execute();
!     try {
!         // BUG: Ignore exception thrown (see drupal.org thread 1210862)
!         @$query->execute();
!     } catch (Exception $e) {
!         // ignore - AEK
!     }
! 
    }
  }
  

The above patch was applied to Acquia Drupal 7.8.7. Your line numbers might vary.

With this patch I was able to complete a fresh install with Microsoft SQL Server.