Bosco1983

Q: Profile Manager Remove Enterprise App - Error has occured

Server 5.1, El Cap 10.11.4

 

We have recently fully moved over to VPP for our App distribution.  Previously we did the old-skool way of sharing iOS Apps (uploading the app to our server after downloading it from the iTunes store).

I want to now remove all the old "Enterprise" Apps, and just keep my VPP catalogue.

 

When I highlight an app, click the minus sign to remove, I then get an error message.

 

Any thoughts?

 

cheers.

 

Screen Shot 2016-04-04 at 11.00.09.png

Mac mini, OS X Server

Posted on Apr 4, 2016 3:00 AM

Close

Q: Profile Manager Remove Enterprise App - Error has occured

  • All replies
  • Helpful answers

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 4, 2016 3:08 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 4, 2016 3:08 AM in response to Bosco1983

    Logs show the following:

     

    Apr  4 11:04:09 www quicklookd[24044]: Error returned from iconservicesagent: (null)

    Apr  4 11:04:09 www iconservicesagent[642]: -[ISGenerateImageOp generateImageWithCompletion:] Failed to composit image for descriptor <ISBindingImageDescriptor: 0x7fa198507c50>.

    Apr  4 11:04:09 www quicklookd[24044]: Error returned from iconservicesagent: (null)

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 5, 2016 1:57 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 5, 2016 1:57 AM in response to Bosco1983

    If I was to manually delete these from the database would this show correctly on the Profile Manager web portal?  I assume it would. 

    I've tried to delete just one app via its unique "ID" number but not had success, can anyone point out where im going wrong?

     

    Firstly I ran this to export the enterprise_apps table to a .txt file so I can see it clearer.  I then opened with Excel after replacing all "|" characters with a blank TAB character.  I found an app with ID of 155 which I want to remove.

    Select all from table name (devices) and save as a file (as terminal only shows 25 lines at a time…

    sudo psql -h "/Library/Server/ProfileManager/Config/var/PostgreSQL" -U _devicemgr -d devicemgr_v2m0 -c "select * from public.enterprise_apps" > enterprise_apps.txt

     

    Then I ran this to delete item 155

     

    sudo psql -h "/Library/Server/ProfileManager/Config/var/PostgreSQL" -U _devicemgr -d devicemgr_v2m0 -c "delete from public.enterprise_apps where id=155"


    but get this message:


    WARNING:  ~~~ DELETE FROM library_items_assets (155,438,f,t,4)

    CONTEXT:  SQL statement "DELETE FROM asset_metadata WHERE id = OLD.id"

    PL/pgSQL function _dm_after_asset_deleted(assets) line 6 at SQL statement

    SQL statement "SELECT _dm_after_asset_deleted(OLD)"

    PL/pgSQL function _dm_after_media_deleted(media) line 6 at PERFORM

    SQL statement "SELECT _dm_after_media_deleted(OLD)"

    PL/pgSQL function _dm_after_eapp_delete() line 6 at PERFORM

    ERROR:  column "supported_devices" is of type smallint but expression is of type character varying

    LINE 1: INSERT INTO deleted_media VALUES(OLD.*)

                                             ^

    HINT:  You will need to rewrite or cast the expression.

    QUERY:  INSERT INTO deleted_media VALUES(OLD.*)

    CONTEXT:  PL/pgSQL function _dm_after_media_deleted(media) line 7 at SQL statement

    SQL statement "SELECT _dm_after_media_deleted(OLD)"

    PL/pgSQL function _dm_after_eapp_delete() line 6 at PERFORM

     

    Clearly got something wrong here as my PSQL knowledge is minimal.  Any tips would be great.

    cheers

  • by daboyter,

    daboyter daboyter Apr 12, 2016 11:46 AM in response to Bosco1983
    Level 1 (0 points)
    Apr 12, 2016 11:46 AM in response to Bosco1983

    You ever find a fix for this? I'm running into it in a couple places.

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 13, 2016 1:54 AM in response to daboyter
    Level 1 (61 points)
    Servers Enterprise
    Apr 13, 2016 1:54 AM in response to daboyter

    No, in fact ive discovered another quirk which is a pain.

     

    I accidently added iPads to a group which contained Enterprise Apps rather than VPP.  If I remove the device from this group, it SHOULD remove the associated apps.  It doesnt.  Im left with Enterprise Apps which are asking for an Apple ID to open (rightly so).  I may have to fully un-enroll the iPads, remove the Enterprise Apps from the group and re-enroll the iPads.  MASSIVE problemo with large number of devices.

     

     

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 13, 2016 2:09 AM in response to daboyter
    Level 1 (61 points)
    Servers Enterprise
    Apr 13, 2016 2:09 AM in response to daboyter

    UPDATE:

     

    Removing Enterprise Apps from a Device Group works by clicking the cog, and then "remove apps".

    Simply moving the device out of the group doesnt work.

     

    At least one of the ways still works

     

    As for the Enterprise App Library however, this does still not let me remove any Apps from there

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 13, 2016 3:35 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 13, 2016 3:35 AM in response to Bosco1983

    UPDATE:

     

    Ignore previous post.  I still dont appear to have a way of removing Enterprise Apps other than un-enrolling a device.

  • by Chris Grande,

    Chris Grande Chris Grande Apr 13, 2016 11:42 AM in response to Bosco1983
    Level 2 (218 points)
    Servers Enterprise
    Apr 13, 2016 11:42 AM in response to Bosco1983

    I'm having the same issue with uploaded books (PDF, ePub) when I try to delete I get that screen and this error is logged:

     

        /Applications/Server.app/Contents/ServerRoot/usr/share/devicemgr/backend/thin:1 1:in `<main>'

    [438] [2016/04/13 14:39:13.625] F: ActiveRecord::StatementInvalid (PG::Error: ERROR:  column "supported_devices" is of type smallint but expression is of type character varying

        LINE 1: INSERT INTO deleted_media VALUES(OLD.*)

                                                 ^

        HINT:  You will need to rewrite or cast the expression.

        QUERY:  INSERT INTO deleted_media VALUES(OLD.*)

        CONTEXT:  PL/pgSQL function _dm_after_media_deleted(media) line 7 at SQL statement

        SQL statement "SELECT _dm_after_media_deleted(OLD)"

        PL/pgSQL function _dm_after_book_delete() line 6 at PERFORM

        : DELETE FROM "ebooks" WHERE ("id" IN (25)) ):

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 14, 2016 1:57 AM in response to Chris Grande
    Level 1 (61 points)
    Servers Enterprise
    Apr 14, 2016 1:57 AM in response to Chris Grande

    Sounds like the data in "supported_devices" contains small integers but the query is for character and then profile manager falls on its *** ? My DB knowledge is minimal though

     

    Any gurus out here who can help us out?

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 27, 2016 2:34 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 27, 2016 2:34 AM in response to Bosco1983

    Updated Logs:

     

    3:: [217] -[DMDevicemgrd receivedDatabaseNotification:]: <PGDatabaseNotification:0x7fdf597c3220> [channel: 'flush', message: 'db_notifications']

    0:: [217] [2016/04/27 10:31:16.570] -[DMDevicemgrd receivedDatabaseNotification:]: channel=flush

    2:: [217] [2016/04/27 10:31:16.570] -[DMDevicemgrd _setPushTimer]: Already have pending push notification timer (fires in 2.533325 seconds)

    2:: [217] [2016/04/27 10:31:16.572] Parsed '[DMDevicemgrd throttledAutoUpdateAllProfilesForMDMTarget:1100]' (xmin:1350792) to Class 'DMDevicemgrd', 'selector 'throttledAutoUpdateAllProfilesForMDMTarget:' with arguments 1100

    0:: [217] [2016/04/27 10:31:17.139]  [1;7;31mEXCEPTION: [0;31m  Postgres <-[PGConnection executeSQL:withParams:] (/Library/Caches/com.apple.xbs/Sources/RemoteDeviceManagement/RemoteDeviceManag ement-894.33/Compiled/Framework-Models/Postgres/PGConnection.m:602): "Postgres error 40001 (ERROR:  could not serialize access due to concurrent update

        CONTEXT:  SQL statement "UPDATE mdm_targets SET last_auto_sync_profiles = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = mt_id"

        PL/pgSQL function dm_auto_update_all_profiles_for_mdm_target(integer,boolean) line 37 at SQL statement

        )">

        USERINFO: {

            SQLSTATE = 40001;

            errorMessage = "ERROR:  could not serialize access due to concurrent update\nCONTEXT:  SQL statement \"UPDATE mdm_targets SET last_auto_sync_profiles = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = mt_id\"\nPL/pgSQL function dm_auto_update_all_profiles_for_mdm_target(integer,boolean) line 37 at SQL statement\n";

        }

         [4;31mBACKTRACE: [0m

         [0;31m? | 10d9ed3b8

        ? | 10d9ec561

        ? | 10d9c0c33

        ? | 10d6aa7f9

        ? | 7fff946b0a6c

        ? | 7fff946b08fe

        ? | 7fff946cbd56

        ? | 10d9b21e3

        ? | 10d9c3125

        ? | 10d9c2649

        ? | 10d9ea907

        ? | 10d9ea303

        ? | 10d9c230e

        ? | 7fff937757d7

        ? | 7fff93775495

         [0m [0m

    3:: [217] @@@ beginTransactionWithID:'__63-[PGConnectionPool _flushNotificationsFromDBNotificationsTable]_block_invoke' -[PGConnection executeSQL:withParams:] (/Library/Caches/com.apple.xbs/Sources/RemoteDeviceManagement/RemoteDeviceManag ement-894.33/Compiled/Framework-Models/Postgres/PGConnection.m:602): "Postgres error 40001 (ERROR:  could not serialize access due to concurrent update

        CONTEXT:  SQL statement "UPDATE mdm_targets SET last_auto_sync_profiles = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = mt_id"

        PL/pgSQL function dm_auto_update_all_profiles_for_mdm_target(integer,boolean) line 37 at SQL statement

        )" @@@

    0:: [217] [2016/04/27 10:31:17.722]  [1;7;31mEXCEPTION: [0;31m  Postgres <-[PGConnection executeSQL:withParams:] (/Library/Caches/com.apple.xbs/Sources/RemoteDeviceManagement/RemoteDeviceManag ement-894.33/Compiled/Framework-Models/Postgres/PGConnection.m:602): "Postgres error 40001 (ERROR:  could not serialize access due to read/write dependencies among transactions

        DETAIL:  Reason code: Canceled on identification as a pivot, during write.

        HINT:  The transaction might succeed if retried.

        CONTEXT:  SQL statement "UPDATE mdm_targets SET last_auto_sync_profiles = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = mt_id"

        PL/pgSQL function dm_auto_update_all_profiles_for_mdm_target(integer,boolean) line 37 at SQL statement

        )">

        USERINFO: {

            SQLSTATE = 40001;

            errorMessage = "ERROR:  could not serialize access due to read/write dependencies among transactions\nDETAIL:  Reason code: Canceled on identification as a pivot, during write.\nHINT:  The transaction might succeed if retried.\nCONTEXT:  SQL statement \"UPDATE mdm_targets SET last_auto_sync_profiles = (CURRENT_TIMESTAMP AT TIME ZONE 'UTC') WHERE id = mt_id\"\nPL/pgSQL function dm_auto_update_all_profiles_for_mdm_target(integer,boolean) line 37 at SQL statement\n";

        }

         [4;31mBACKTRACE: [0m

         [0;31m? | 10d9ed3b8

        ? | 10d9ec561

        ? | 10d9c0c33

        ? | 10d6aa7f9

        ? | 7fff946b0a6c

        ? | 7fff946b08fe

        ? | 7fff946cbd56

        ? | 10d9b21e3

        ? | 10d9c3125

        ? | 10d9c2649

        ? | 10d9ea907

        ? | 10d9ea303

        ? | 10d9c230e

        ? | 7fff937757d7

        ? | 7fff93775495

         [0m [0m

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 27, 2016 2:35 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 27, 2016 2:35 AM in response to Bosco1983

    Ive tried re-uploading an "Enterprise" App to Profile Manager but I still get the error message when trying to delete the App.  Surely there must be a way to "DELETE ALL from enterprise_apps WHERE APP TYPE = "Enterprise" if you get me?  (just made up those headings)

  • by Bosco1983,

    Bosco1983 Bosco1983 Apr 27, 2016 2:51 AM in response to Bosco1983
    Level 1 (61 points)
    Servers Enterprise
    Apr 27, 2016 2:51 AM in response to Bosco1983

    Seen this from another thread, looks like Serialisation "errors" aren't always "bad"

     

    Serialization "errors" are not true errors, they are indications that two or more transactions to the database made conflicting changes and the transactions need to be retried. You can expect to see this periodically, but the logs also include a "@@@ Retry 1 due to database transaction failure...." line immediately afterwards to indicate that the retry is happening. The count will go up on successive failures of the same transaction, but unless the counts get really high (say, >10) this is pretty much normal behavior.

     

    The heavier the load on the server, the more likely you are to see these, too, because there are more transactions being processed simultaneously.


    devicemgrd null ptr error loop causing high cpu load.

  • by Chris Grande,Solvedanswer

    Chris Grande Chris Grande May 18, 2016 4:18 AM in response to Bosco1983
    Level 2 (218 points)
    Servers Enterprise
    May 18, 2016 4:18 AM in response to Bosco1983

    Seems Server 5.1.5 on 10.11.5 solved this issue for me, at least with books, I'm now able to delete them with no issues.

  • by Bosco1983,

    Bosco1983 Bosco1983 May 18, 2016 4:18 AM in response to Chris Grande
    Level 1 (61 points)
    Servers Enterprise
    May 18, 2016 4:18 AM in response to Chris Grande

    Update has indeed fixed this! Huzzah!

     

    I can now :

     

    - delete enterprise Apps without crashing

    - select individual devices without crashing

     

    and PM feels more responsive.  Nice one Apple, only took you a year and a half