Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

can't enrol new iPhone using profile manager

I had an iPhone 4 enrolled using profile manager on Lion Server, no problem. Push notifications were working, all was good.


Then I bought an iPhone 4S, and took the micro-SIM card out of the iPhone 4, and stuck it into the iPhone 4S, and tried to enroll the iPhone 4S. I'm getting errors on the console:


ProfileManager[462]: ActiveRecord::StatementInvalid (PGError: ERROR: duplicate key value violates unique constraint "devices_ICCID_key"

DETAIL: Key ("ICCID")=(8930 2720 4010 2940 1034) already exists.


and the device shows up as "new device" and the push notifications just hang, it won't get enrolled.


I did de-enroll the old one first before trying to enroll the new one...


any ideas? this kind of *****

Posted on Nov 2, 2011 6:29 AM

Reply
24 replies

Nov 2, 2011 7:40 AM in response to plg

OK so I found a solution myself ... a bit heavy-handed, but it worked.

in postgreSQL delete all rows in the "devices" table in the device_management database

Then all registered devices are gone and I was able to re-enroll no problem.


There's probably a way of only deleting one row (the bad device) from the devices table but my SQL is not up to snuff and frankly after 30min of searching for how to do it I gave up and just deleted all rows.

Nov 24, 2011 9:35 AM in response to plg

Hi


After finding the the Key ("ICCID") in /Library/Server/ProfileManager/Logs/profilemanager.log

I ran sudo -u _devicemgr psql device_management to connect to the postgres database.


typed \x on; to enable sane output


then i ran the query SELECT * FROM devices WHERE "ICCID" LIKE '0000 0000 0000 0000 0000';

but with the numbers from my log file instead.

Please note that " and ' are important and means different thing in pgsql.

That shows the data for that device in the database.


Then I ran DELETE FROM devices WHERE "ICCID" LIKE '0000 0000 0000 0000 0000';

(again with the numbers from the log file)

That removes the matching row from the database and solved my problem without having to

remove all devices.

can't enrol new iPhone using profile manager

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.