C-Command Software Forum

hdiutil: flatten: "test.dmg" failed: Resource temporarily unavailable

I’m having this issue intermittently on Catalina using 3.5.6 and 3.5.7b1. It usually occurs the first time, and then if I re-run DropDMG (using the command-line tool) it often succeeds:

     [exec] Error: hdiutil: flatten: flattening "test.dmg"...
     [exec] hdiutil: flatten: "test.dmg" failed: Resource temporarily unavailable (-54)
     [exec] hdiutil: flatten failed - Invalid argument

I’m using the latest Catalina beta at this time. Is there anything more I can provide to help diagnose this issue?

This is probably a Catalina bug, so I would recommend reporting to Apple that the “hdiutil: flatten” command is failing intermittently.

Is this occurring when creating a disk image with a license agreement? If so, it may help to create the image without the license first, and then add it later (by converting).

I have same problem, after update to Catalina.

Added Diagnostic report, simple log is:


dropdmg -t --internet-enabled --custom-icon --format=zlib --destination="builds/Seznam.cz/mac/nwjs0.37.4/dist" --base-name="Seznam.cz-dev-nwjs0.37.4-5.5.1-909762.dmg" --signing-identity="xxx" --layout-folder="./MacPackaging/DropDMG/Layouts/Seznam" --license-folder="./MacPackaging/DropDMG/Licenses/Seznam" "builds/Seznam.cz/mac/nwjs0.37.4/Seznam.cz.app";
>> Error: hdiutil: flatten: flattening "Seznam.cz-dev-nwjs0.37.4-5.5.1-909762.dmg"...
>> hdiutil: flatten: "Seznam.cz-dev-nwjs0.37.4-5.5.1-909762.dmg" failed: Prostředek dočasně nedostupný (-54)
>> hdiutil: flatten failed - Neplatný argument
>> Exited with code: 1.

Tested on v3.5.7 and v3.5.8b1, both failed

Thanks for the report. I will try to find a workaround to this Catalina bug. In the meantime, it may help to restart your Mac. And the error should not occur when not using a license agreement.

Restart mac doesn’t solve problem.

Works, without signing:


dropdmg --always-create --internet-enabled --custom-icon --format=zlib --destination="builds/" --base-name="application.dmg" --layout-folder="./MacPackaging/DropDMG/Layouts/Seznam" "application.app";

But, i need sign (second line has same error with hdiutil: flatten):


dropdmg --always-create --internet-enabled --custom-icon --format=zlib --destination="builds/" --base-name="application.dmg" --layout-folder="./MacPackaging/DropDMG/Layouts/Seznam" "builds/application.app"
dropdmg --signing-identity="XXX" --license-folder="./MacPackaging/DropDMG/Licenses/Seznam" "builds/application.dmg"

I think the difference there is that, like I said, no flattening is needed if there is no license agreement. If you do have a license agreement, signing shouldn’t matter because it happens after flattening.

Ahh, you are right, signing works:


dropdmg --always-create --internet-enabled --custom-icon --format=zlib --destination="builds/" --base-name="application.dmg" --layout-folder="./MacPackaging/DropDMG/Layouts/Seznam" --signing-identity="XXX" "application.app"

But not add license agreement:


dropdmg --license-folder="./MacPackaging/DropDMG/Licenses/Seznam" "builds/application.dmg"

Does it make a difference if you have “Always run with root access” checked or unchecked in the preferences?

I believe this is fixed in the DropDMG 3.5.8b2 public beta.

Thanks, now its works.

Good job.