plg

Q: 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

Close

Q: can't enrol new iPhone using profile manager

  • All replies
  • Helpful answers

Page 1 Next
  • by plg,

    plg plg Nov 2, 2011 7:40 AM in response to plg
    Level 1 (0 points)
    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.

  • by burti,

    burti burti Nov 8, 2011 4:30 PM in response to plg
    Level 1 (0 points)
    Nov 8, 2011 4:30 PM in response to plg

    Hi plg

     

    I'm having the same issue with a replcament iPhone 4.

     

    I'm used to MySQL and not postgreSQL, could you give a little more detail on how you got the the database please?

     

    thanks in advance

  • by plg,

    plg plg Nov 9, 2011 10:42 AM in response to burti
    Level 1 (0 points)
    Nov 9, 2011 10:42 AM in response to burti

    I used pgAdmin (download from here: http://www.pgadmin.org/) to open up the relevant database ... there was a lot of fiddling to get the username & pw for the postgresql database configured so that pgAdmin could access it. To tell you the truth I didn't document every step (I should have) and so I can't give you a step-by-step.

  • by burti,

    burti burti Nov 9, 2011 1:22 PM in response to plg
    Level 1 (0 points)
    Nov 9, 2011 1:22 PM in response to plg

    No worries, I do exactly the same.

     

    At least I know it's fixable beacuse I was starting to think it was the iphone 4 or I was doing something wrong.

     

    Thanks for relaying

  • by Gnitset,

    Gnitset Gnitset Nov 24, 2011 9:35 AM in response to plg
    Level 1 (0 points)
    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.

  • by burti,

    burti burti Nov 28, 2011 2:21 PM in response to Gnitset
    Level 1 (0 points)
    Nov 28, 2011 2:21 PM in response to Gnitset

    Thanks Gnitset. I'll give it a try!

  • by Zero.IQ,

    Zero.IQ Zero.IQ Dec 4, 2011 3:06 AM in response to Gnitset
    Level 1 (0 points)
    Dec 4, 2011 3:06 AM in response to Gnitset

    Thanks Gnitset!

     

    You saved me!

  • by burti,

    burti burti Dec 5, 2011 4:40 AM in response to burti
    Level 1 (0 points)
    Dec 5, 2011 4:40 AM in response to burti

    After restoring the whole postgresql as Profile Manager didn't exist when I wanted to try Gnitset fix, I finally go my iPhone sorted and enroled!

     

    Fantastic. Thanks again GnitSet!

  • by nickates3,

    nickates3 nickates3 Apr 4, 2012 11:12 AM in response to Gnitset
    Level 1 (0 points)
    Apr 4, 2012 11:12 AM in response to Gnitset

    Worked great for me! Issue arose after I swapped out an iPad at the GB and used the same SIM.

  • by MikeB_uk,

    MikeB_uk MikeB_uk Apr 10, 2012 9:33 AM in response to Gnitset
    Level 1 (0 points)
    Apr 10, 2012 9:33 AM in response to Gnitset

    THANK YOU!!!!!

     

    A replacement iPhone caused me real heartburn due to this issue. Your solution was perfect and has solved it perfectly.

     

    Many thanks!

  • by lo0ob,

    lo0ob lo0ob Apr 29, 2012 9:10 PM in response to Gnitset
    Level 1 (0 points)
    Apr 29, 2012 9:10 PM in response to Gnitset

    i just want to express my thanks to you gnitset. have been trying to trouble shoot it for past 2 days and finally came across your post.. it worked like a charmed!.

     

    anyway , for benefit of those who is not familiar with mac,

     

    go to utility --> Console and type in gnitset command. it should work.

  • by Chris Marriott,

    Chris Marriott Chris Marriott May 18, 2012 8:03 AM in response to plg
    Level 1 (80 points)
    May 18, 2012 8:03 AM in response to plg

    Could you provide some details on how to connect/configure adding a server in pgadmin?  I'm unfamiliar with how to connect and what database you're referring to.  Thanks for any help you can provide.

     

     

    Chris

  • by ghiathb,

    ghiathb ghiathb Sep 28, 2012 10:00 AM in response to Gnitset
    Level 1 (4 points)
    iTunes
    Sep 28, 2012 10:00 AM in response to Gnitset

    You are a life saver, thank you so much, i've been struggling with this for 2 days.

  • by hpsca,

    hpsca hpsca Nov 22, 2012 6:15 AM in response to plg
    Level 1 (0 points)
    Nov 22, 2012 6:15 AM in response to plg

    Thanks!! helped me out....

     

    So, Apple, when are you going to put this in an interface???

Page 1 Next