This project is read-only.

Import progress not reaching 100

Topics: PowerShell Cmdlets
Sep 30, 2014 at 10:59 PM

I am running imports with some larger solution zips on a fairly slow server. I am getting the following output from the build:
Solution Import Completed. Import Job Id: cd247ccc-4219-4f5a-9c37-e2412d9bd41d
Import Progress: 97.4003466204506
Import Result: success
Import Failed

It seems to timeout after 7 mins. Manual import of the same file works fine (takes longer). The log file shows no error just some unprocessed items in the end.

I looked through the source and found AsyncWaitTimeout for the import command. However, that values seems to be set to 15 minutes, well above my error at 7 mins.

Sep 30, 2014 at 11:25 PM

If you do the manual import and download the log file after the import, what is the import progress? (I suspect it will be 97).

The current import script has the strictest success criteria by default for safety reasons.
progress = 100
result = success
no errors
version updated

There are occasions in which the solution completes successfully where not all the components are processed like in your case.

I would take a look at the log file first and see what is going on.

If you are happy with the log file then you can consider removing the progress = 100 check from the import powershell script.

If you are updating version number on each build then checking the version number post import if is equal to the new version should be enough.

Hope this helps.


Marked as answer by waelhamze on 10/1/2014 at 3:09 PM
Oct 1, 2014 at 6:28 AM
Thanks for the quick response.

Again, I am thoroughly impressed by the quality of this tool. Easy to understand and very well structured.

So it is a "bug" coming from the platform? Reporting success even though the job isn't finished seems like very odd behavior. The remaining items to process are workflow activations so nothing special about them (a good part of the workflows are already activated).

I can remove that restriction from the if statement in the ImportSolution.ps1 file. However, wouldn't that mean I am unsure if the last workflows were actually activated? I would feel very uncomfortable with that during a production release.

Will do a manual import and check that log file.

Oct 1, 2014 at 6:47 AM
Confirmed the log file is identical if I do it manually.

So some scenarios I can think would be that the job is reporting success and but the log stream doesn't get flushed to disc until after we retrieve it. Or, that the job reports success before it is completed.

Will hopefully have time to do some testing today.

Oct 1, 2014 at 11:08 PM
Hi Peter,

The log is downloaded from CRM and it happens all inside a transaction so I doubt flushing is the cause here.

It is more likely CRM ignore some minor things like activating workflows and still marks the job as success which is not ideal in some cases.

Anyway let me know what you find found.


Feb 28, 2017 at 11:20 AM
Hi Wael,

We are facing similar issue. How to tackle this situation as I am using your script in DevOps in Visual Studio online and since the script is not completing 100% eventually erroring out. Manually importing is completing but with same warning message in the logs which are coming in powershell