11 Replies Latest reply: Jan 15, 2013 6:03 AM by Sensemann
thomas_k Level 1 Level 1 (0 points)

Hello,

 

today i tried to enroll a new iPhone 4S and someting wnt terrible wrong.

 

Oct 14 21:16:58 grisu.kicks-***.org ProfileManager[2527] <Alert>: ActiveRecord::StatementInvalid (PGError: ERROR:  duplicate key value violates unique constraint "devices_ICCID_key"

          DETAIL:  Key ("ICCID")=(8949 0200 0005 0496 2742) already exists.

          : UPDATE "devices" SET "updated_at" = '2011-10-14 19:16:58.621678', "BluetoothMAC" = 'd0:23:db:4c:d3:ff', "DeviceName" = 'Thomas’ iPhone', "CurrentCarrierNetwork" = 'Telekom', "WiFiMAC" = 'd0:23:db:4c:d3:fe', "SIMCarrierNetwork" = 'Telekom.de', "ProfileRestrictions" = NULL, "AvailableDeviceCapacity" = 57.0510635375977, "BuildVersion" = '9A334', "BatteryLevel" = 1.0, "ModemFirmwareVersion" = '1.0.11', "PhoneNumber" = '+4915115675482', "ProvisioningProfileList" = '--- []

 

          ', "InstalledApplicationList" = '--- []

 

          ', "GlobalRestrictions" = NULL, "ICCID" = '8949 0200 0005 0496 2742', "CarrierSettingsVersion" = '11.0', "OSVersion" = '5.0', "DeviceCapacity" = 57.4193229675293, "ModelName" = 'iPhone', "last_checkin_time" = '2011-10-14 19:16:58.590519', "ManagedApplicationList" = '--- {}

 

          ', "CertificateList" = '---

          - Data: |

              -----BEGIN CERTIFICATE-----

              MIIDRjCCAi6gAwIBAgIBATALBgkqhkiG9w0BAQswTjEaMBgGA1UEAwwRVGhv

              bWFzIEtvc2NoJ3MgQ0ExCzAJBgNVBAYTAkRFMSMwIQYJKoZIhvcNAQkBFhR0

              aG9tYXMua29zY2hAbWFjLmNvbTAeFw0xMTA4MjQxOTMzMjFaFw0zMTA4MTkx

              OTMzMjFaME4xGjAYBgNVBAMMEVRob21hcyBLb3NjaCdzIENBMQswCQYDVQQG

              EwJERTEjMCEGCSqGSIb3DQEJARYUdGhvbWFzLmtvc2NoQG1hYy5jb20wggEi

              MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDLEJrBPCakb8Ct+6V+3Ai9

              ntpTp/zLjyPujJrQHWSUplD4Osj5KEm0VxGGOJqGhI912R0z05IHx8LszWyf

              WuRapn8CmKCZ7U4hFtehD5w37U0sJLDik4M95q/EISDHDO+32lnEQVK49SGp

              RcrVqhvJ3+i2iH6KhDE4inRvDPvVxdESbl4YLpHTKna9YBzKEblnKDoWEBOa

              xciwPpdzGky2AinjQjLa1dHpUMBPPiUmSs+OCu8s3WSmn30CAl817TCSwEKQ

              iO+IRuAxCCpvViPJsHbnfmPTDchm7hfsUUCboucgwWz0VgMzCGXRDHmiUqc2

              03OKyCXp1jTbGp7OdLwLAgMBAAGjMTAvMA8GA1UdEwEB/wQFMAMBAf8wCwYD

              VR0PBAQDAgGGMA8GA1UdJQQIMAYGBFUdJQAwDQYJKoZIhvcNAQELBQADggEB

              ABUfvveP+m9YKLP4xMDJG4K6xjVC6e8fpuhnVMIrSQBcjntx+KsUVHpJP3BE

              aR5Gmhikqhl72MV2t8+wQ2kz06IoHOa/PmYFiyG6//ojTiNqAvymSIpwJAWZ

              cSDEuBbEXkVGOIfIDRjflcA7ycaUbhcz9fMK/Q5HYWoJVWFwdUyjWjGhGx4V

              1c/dG84Q2SRSFM0iK2W3EiOdWntAWX2thba7JQ+n2vQR8azmKkCRkBarBXZV

              tkW+GeqidRuYJLgzzuvgOYORNXAlBPzk+ljfWse20hphHYSB6uLVh882PjmI

              qOhBj/ai9sjxuqrIJsMBvHs/ekGotdtMKLbKil5esnI=

              -----END CERTIFICATE-----

 

            IsIdentity: false

            CommonName: xxxxx

            metadata:

              :public_key:

                :duplicable: true

                :frozen: false

                :public_key: !ruby/object:OpenSSL::PKey::RSA {}

 

                :parameters:

                  dmq1: !ruby/object:OpenSSL::BN {}

 

                  dmp1: !ruby/object:OpenSSL::BN {}

 

                  iqmp: !ruby/object:OpenSSL::BN {}

 

                  n: !ruby/object:OpenSSL::BN {}

 

                  d: !ruby/object:OpenSSL::BN {}

 

                  p: !ruby/object:OpenSSL::BN {}

 

                  e: !ruby/object:OpenSSL::BN {}

 

                  q: !ruby/object:OpenSSL::BN {}

 

              :is_identity: false

              :certificate:

                :serial_number: 1

                :issuer: /CN=xxxxx/C=DE/emailAddress=xxxxx

                :duplicable: true

                :version: 2

                :frozen: false

                :signature_algorithm: sha256WithRSAEncryption

                :subject: /CN=xxxxx xxxxx/C=DE/emailAddress=xxxxx

                :not_before: 2011-08-24 19:33:21 Z

                :not_after: 2031-08-19 19:33:21 Z

              :is_root: true

          - Data: |

              -----BEGIN CERTIFICATE-----

              MIIDITCCAgmgAwIBAgIEL9Gv6TALBgkqhkiG9w0BAQswgbMxLTArBgNVBAMM

              JEludGVybWVkaWF0ZUNBX0dSSVNVLktJQ0tTLUFTUy5PUkdfMTEpMCcGA1UE

              CgwgVGhvbWFzIEtvc2No4oCZcyBQcml2YXRlIE5ldHdvcmsxLTArBgNVBAsM

              JE1BQ09TWCBPcGVuRGlyZWN0b3J5IEludGVybWVkaWF0ZSBDQTEoMCYGCSqG

              SIb3DQEJARYZdC5rb3NjaEBzY2h1Y2tlZHVzdGVyLm9yZzAeFw0xMTEwMTQx

              OTE2NDNaFw0xMjEwMTMxOTE2NDNaMDExLzAtBgNVBAMMJkRldmljZSBNYW5h

              Z2VtZW50IElkZW50aXR5IENlcnRpZmljYXRlMIGfMA0GCSqGSIb3DQEBAQUA

              A4GNADCBiQKBgQDk/m/Bxqv1r5tbmk/5EZQOVS7PeFUSrx/Wfc2rZFRv+RI9

              7vyT/L5X9J3uX41MykllwgfAqWEAZCDBzq1Mu1KJUQF2dAT/al5yas90F4Wf

              I6BrinfsLI2iuZ75pENgoZRn5qzWh77ysYjeJAkWC7p52it/rawYZPe1+s0H

              qUQN2QIDAQABo0QwQjAOBgNVHQ8BAf8EBAMCAYIwMAYDVR0lAQH/BCYwJAYI

              KwYBBQUHAwEGCSqGSIb3Y2QEAwYHKwYBBQIDBQYEVR0lADANBgkqhkiG9w0B

              AQsFAAOCAQEAo+CjALfM/toaojFwdh+vrXJulLwFLiGbxR41vqL79e3jZwhi

              58qo7fIiDaKhtAtpsPbxsFKuQAjxbm0hjyjDKzJTmPhurN/n6HVh4qb2GgwQ

              EIbyfBSJBOUImGSV5/owV6/GwRy6BaZAP63/3jVtwBfVc5SmhW8jRjfSvbTD

              f5kW698wfxVZ+I6v/QzWw1jGabd8br8Lwdy21cGd78aw5yEkI4BlaGMcNAmx

              QDDmGOp2dFaEK1fV7vP58P3nYX4+qQBIL330dEKa+j7l9SOw5oo6o7Ct2UVR

              d3kY6H1+TSMe/5/kfzC4ORCoto6rOzyCpk7HrwFdvUKWHmdhE7wCQA==

              -----END CERTIFICATE-----

 

            IsIdentity: true

            CommonName: Device Management Identity Certificate

            metadata:

              :is_identity: true

          ', "ProfileList" = '---

          - PayloadVersion: 1

            PayloadContent:

            - PayloadVersion: 1

              PayloadOrganization: "xxxxx"

              PayloadIdentifier: com.apple.ssl.certificate

              PayloadDescription: "Installs the Root certificate for xxxxx."

              PayloadType: com.apple.security.root

              PayloadDisplayName: "Root certificate for xxxxx"

            PayloadIdentifier: com.apple.config.xxx.xxx.xxx.ssl

            PayloadDescription: Configures your device to trust the Profile Manager server.

            PayloadRemovalDisallowed: false

            IsEncrypted: false

            HasRemovalPasscode: false

            PayloadUUID: 069a7180-d8c2-012e-cffb-00254ba05c26

            PayloadDisplayName: "Trust Profile for xxxxx"

          - PayloadVersion: 1

            PayloadOrganization: "xxxxx"

            PayloadContent:

            - PayloadVersion: 1

              PayloadOrganization: "xxxxx"

              PayloadIdentifier: com.apple.mdmconfig.SCEP

              PayloadDescription: Configures SCEP

              PayloadType: com.apple.security.scep

              PayloadDisplayName: Device Credential Request

            - PayloadVersion: 1

              PayloadOrganization: "xxxxx"

              PayloadIdentifier: com.apple.mdmconfig.mdm

              PayloadDescription: Configures Mobile Device Management

              PayloadType: com.apple.mdm

              PayloadDisplayName: Device Management

            PayloadIdentifier: com.apple.config.xxx.xxx.xxx.mdm

            PayloadDescription: Allows the server to manage your device.

            PayloadRemovalDisallowed: false

            IsEncrypted: false

            HasRemovalPasscode: false

            PayloadUUID: f6d09c70-d8c6-012e-d035-00254ba05c26

            PayloadDisplayName: Remote Management

          ', "SecurityInfo" = '---

          HardwareEncryptionCaps: 3

          PasscodeCompliantWithProfiles: true

          PasscodeCompliant: true

          PasscodePresent: false

          ', "Model" = 'MD261D' WHERE "id" = 19):

            app/helpers/task_helper.rb:202:in `handle_response'

            app/helpers/task_helper.rb:328:in `handle_connect'

            app/controllers/device_controller.rb:95:in `connect'

            app/controllers/application_controller.rb:71:in `give_session_to_models'

            thin (1.2.7) lib/thin/connection.rb:76:in `pre_process'

            thin (1.2.7) lib/thin/connection.rb:74:in `catch'

            thin (1.2.7) lib/thin/connection.rb:74:in `pre_process'

            thin (1.2.7) lib/thin/connection.rb:57:in `process'

            thin (1.2.7) lib/thin/connection.rb:42:in `receive_data'

            eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'

            eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'

            thin (1.2.7) lib/thin/backends/base.rb:57:in `start'

            thin (1.2.7) lib/thin/server.rb:156:in `start'

            thin (1.2.7) lib/thin/controllers/controller.rb:80:in `start'

            thin (1.2.7) lib/thin/runner.rb:177:in `send'

            thin (1.2.7) lib/thin/runner.rb:177:in `run_command'

            thin (1.2.7) lib/thin/runner.rb:143:in `run!'

            /usr/share/devicemgr/webserver/thin:8

Oct 14 21:16:58 grisu.kicks-***.org ProfileManager[2527] <Info>: Rendering /usr/share/devicemgr/backend/public/500.html (500 Internal Server Error)

 

Has anyone an idea how to fix this?

  • 1. Re: Device Enrollment Failed
    Jonathan Cipriani Level 1 Level 1 (40 points)

    I also have this issue and do not have the knowledge to address the issue.  I have that it's a database problem feeling.

  • 2. Re: Device Enrollment Failed
    eloybrea Level 1 Level 1 (0 points)

    Same problem here ... new iPhone 4.

    This should be the problem

    PGError: ERROR:  duplicate key value violates unique constraint "devices_ICCID_key"

    But ICCID should be unique in each chipcard.

    I don't have any clue, how this can happen....  did somebody find a solution for this ?

  • 3. Re: Device Enrollment Failed
    cragiboy Level 1 Level 1 (5 points)

    I have the same problem, when i make a backup from a device, which was also part of the Profile Manager. When i make a backup from the old device with itunes on another device i got this error with the new device, when trying to enroll.

     

    Any solution?

  • 4. Re: Device Enrollment Failed
    thomas_k Level 1 Level 1 (0 points)

    The Problem is that the ICCID is unique in each chipcard. But not overall. For example if you reuse the card in an other device.

     

    It's not possible to remove a device from the profile manager, because removing it in the profile manager sets the device only as deleted in the database and dont removes it.

     

    So the only Solution is to identify the device in the database and then remove either the ICCID or the whole device.

     

    For example that you want to keep the old device as backup its better to remove only the ICCID and keep the device in the database.

     

    If the device is definitely gone (you sell it, it got swapped in case of a defect or so on), then there is no need to keep it in the database an you better remove the whole device.

  • 5. Re: Device Enrollment Failed
    cragiboy Level 1 Level 1 (5 points)

    Where can i find the database on the mac to remove the ICCID or the whole device?

  • 6. Re: Device Enrollment Failed
    thomas_k Level 1 Level 1 (0 points)

    What did you mean with "where can i find the database"?

     

    The data is stored in the postgresql database.

  • 7. Re: Device Enrollment Failed
    Jonathan Cipriani Level 1 Level 1 (40 points)

    I found a solution in this thread.  Hopefully it will also help you.

  • 8. Re: Device Enrollment Failed
    thomas_k Level 1 Level 1 (0 points)

    If you want to keep the old device, for example as backup device or to hand it over to your wife, child, whatever, i would suggest not to delete the whole device or you have later to recreate the device profile and reassign the group memberships.

     

    So if the device isn't definitely gone, i would prefer to remove only the ICCID.

     

    This could be done by

     

    update devices set "ICCID" = NULL where "ICCID" like 'XXXX XXXX XXXX XXXX XXX';

  • 9. Re: Device Enrollment Failed
    Sensemann Level 1 Level 1 (0 points)

    Hi all reader of this thread,

    please commit a feedback about this profile manager issue at http://www.apple.com/feedback

    I've gone through different Apple support departments, and at least the German Apple Care Mac OS X Server devision had told me, that the advisor personal knows about this ICCID problem. He often had cased with this issue and he suggested the same solution to alter the devicemanager database with SQL commands.

    BUT THIS CAN'T BE THE SOLUTION Apple will give fore their customers!

    We have to inform Apple that the current implementation of profile manager is unsuitable.

     

    Here is a thread how to remove the effect iOS device completely:

    https://discussions.apple.com/thread/3457659?start=0&tstart=0

     

    Thanks

    Jens

  • 10. Re: Device Enrollment Failed
    KiltedTim Level 8 Level 8 (37,810 points)

    FYI. Every post is date and time stamped when it is posted.  Please look at the date and time.

     

    This thread has been dead for over a year.

  • 11. Re: Device Enrollment Failed
    Sensemann Level 1 Level 1 (0 points)

    Hi,

    the thread my be dead, but the problem is still present in the latest profile manager version. So when somebody searches for the problem he can get informations and also can give Apple the feedback.

     

    Jens