If you get an "error while compressing file.tar.gz" type error, with a chdir error and escaped characters, it was due to two calls to getpwnam in the same string generation. What this did was wiped the result for the first one when the 2nd call was generated. Once both calls were completed, then the calling string function tried to assemble the string with a non-existant memory space. Fix is to call getpwnam once to it's own string, and use the new string twice in the assembly of the setup. The error happened randomly depending on the length and charcters of the name of the tar.gz file.