Check that output file is writable and not a directory