cloudfoundry/vcap — Issue #189: Problem in app_package.rb
Author: jmprice
Created: 2012-02-23 01:05:16+00:00
State: open

Application deployment fails for applications that contain subdirectories who's files already exist in the resource pool.

The failure occurs in
def resolve_path(working_dir, tainted_path)
expanded_dir = File.realdirpath(working_dir)
expanded_path = File.realdirpath(tainted_path, expanded_dir)
pattern = "#{expanded_dir}/*"
unless File.fnmatch?(pattern, expanded_path)
raise ArgumentError, "Resource path sanity check failed #{pattern}:#{expanded_path}!!!!"
end
expanded_path
end

The function File.realdirpath expects/requires that the all but the last component of the path really exist. At the time the code that calls 'resolve_path', the directory structure does not yet exist and the deployment fails with the message, "Failed synchronizing resource pool".