Search Me

Tuesday, February 4, 2014

App-V Client Sync fails with 070000000D, error tyring to un-publish packages that have been removed

Problem:

While requesting the App-V 5.x client to sync with the publishing server, the following error is returned:

PS C:\> Sync-AppvPublishingServer -ServerId 1

Sync-AppvPublishingServer : There were errors encountered when trying to un-publish packages that have been removed
from the server.
Operation attempted: RefreshPublishingServer.
AppV Error Code: 070000000D.
Please consult AppV Client Event Log for more details.
At line:1 char:1
+ Sync-AppvPublishingServer -ServerId 1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidResult: (:) [Sync-AppvPublishingServer], ClientException
    + FullyQualifiedErrorId : RefreshPublishingServerError,Microsoft.AppV.AppvClientPowerShell.SyncAppvPublishingServe
   r

The operation appears to be successful (new applications are available to the user), but the error is displayed.

Cause:

The problem is stated right in the error message, "errors encountered when trying to un-publish packages that have been removed from the server".  The client is telling you that it once had a package published to it, and it is trying to remove it, but it can't because it is no longer available on the content store.

Resolution:

The simplest way to resolve this error is to restore the files for the App-V package (on the content store) and unpublish the application.  Once you do this you should be able to do a sync-appvpublishingserver and have it complete without error.

If you no longer have the package available, then you will have to identify the GUID.  The way I did this was:


  1. Remove all packages from the machine using the following powershell command:

    Get-AppvClientPackage | Remove-AppvClientPackage
  2. Check the client to make sure that you do not have any packages on it.  Use the following command:

    Get-AppvClientPackage

    It should return no results.

  3. Remove all of the package folders from the machine.
    1. Browse to C:\ProgramData\App-V
    2. Delete all the folders (they should all be GUIDS).  If you cannot delete a folder, make sure that you've removed all the packages first.  If you're still having trouble, reboot the client, remove the packages again, and then delete the folders.
  4. At this point, C:\ProgramData\App-V should be empty.  Execute a sync with the publishing server.

    Sync-AppvPublishingServer -ServerID

    PS C:\> Sync-AppvPublishingServer -ServerId 1
    Sync-AppvPublishingServer : There were errors encountered when trying to un-publish packages that have been removed
    from the server.
    Operation attempted: RefreshPublishingServer.
    AppV Error Code: 070000000D.
    Please consult AppV Client Event Log for more details.
    At line:1 char:1
    + Sync-AppvPublishingServer -ServerId 1
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidResult: (:) [Sync-AppvPublishingServer], ClientException
        + FullyQualifiedErrorId :
    refreshPublishingServerError,Microsoft.AppV.AppvClientPowerShell.SyncAppvPublishingServe
       r

    Notice the error - ignore it for now.  We did the sync to get a list of all "good" folders.  Now we know which GUIDS should be on the system.
  5. Open REGEDIT and browse to HKCU\Software\Microsoft\App-V\Client\Packages.  Compare the results in this key with the folders that are now C:\ProgramData\App-V.  For each folder, there should be a corresponding GUID in the registry.  If you have stray GUIDS in the registry, delete them.
  6. Perform another Sync

    Sync-AppvPublishingServer -ServerID

    And you should be good to go now.



NOTE: As with all configuration changes, you should back up registry settings and files before you make any changes.  This will help you restore your system to the state it was before making the change.  That way, if the information I'm sharing with you doesn't work for your system, you can quickly get back to a previous state and continue troubleshooting.