Users can provide package_url to agent_config -> extra.
Some customers do that.
If the URL fails downloading, you get something like this:
The curl command fails, but we never check its return code. Then we proceed to extract the garbage we get from curl, resulting in the error above.
Script should:
1. Log properly
2. Check for error codes