replace url with path. limit the number of retries on error.