hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
14.99k stars 3.33k forks source link

Download from sharepoint link does not work #10581

Open bolausson opened 3 years ago

bolausson commented 3 years ago

Overview of the Issue

Using a sharepoint link to download a ISO does not work.

Reproduction Steps

Pint packer to an ISO file using a sharepoint link e.g. "https://yourcompany.sharepoint.com/:u:/t/swrepo/XY0-s5Vg5FtFzUp5ep-uKGYBbgcJrjhTW1J876rKh_-VXd?e=ywnHDL&download=1"

(if you need a working sharepoint link to try, let me know and I can send one in private)

==> virtualbox-iso: Retrieving ISO
==> virtualbox-iso: Trying https://yourcompany.sharepoint.com/:u:/t/swrepo/XY0-s5Vg5FtFzUp5ep-uKGYBbgcJrjhTW1J876rKh_-VXd?e=ywnHDL&download=1
==> virtualbox-iso: Trying https://yourcompany.sharepoint.com/:u:/t/swrepo/XY0-s5Vg5FtFzUp5ep-uKGYBbgcJrjhTW1J876rKh_-VXd?e=ywnHDL?checksum=md5%3Axr234v41b9cd05s1627940bd12414c82&download=1&e=ywnHDL
==> virtualbox-iso: Download failed bad response code: 403
==> virtualbox-iso: error downloading ISO: [bad response code: 403]
2021/02/06 17:14:39 packer-builder-virtualbox-iso plugin: Leaving retrieve loop for ISO
2021/02/06 17:14:39 [INFO] (telemetry) ending virtualbox-iso
==> Wait completed after 2 seconds 225 milliseconds
2021/02/06 17:14:39 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2021/02/06 17:14:39 machine readable: virtualbox-iso,error []string{"error downloading ISO: [bad response code: 403]"}
==> Builds finished but no artifacts were created.
Build 'virtualbox-iso' errored after 2 seconds 225 milliseconds: error downloading ISO: [bad response code: 403]

wget works fine.

Packer version

1.6.5

Simplified Packer Buildfile

"iso_url": "{{user sharepointlink}}",

Operating system and Environment details

Gentoo Linux

Log Fragments and crash.log files

See above

Greetings, Bjoern

SwampDragons commented 3 years ago

Hi, thanks for reaching out. A 403 normally means that you don't have permission to download. My guess is that either this is an issue with sharepoint not liking Packer's user agent, or with your link not containing correct permissions to access the file.

bolausson commented 3 years ago

Hej,

so why does it work with CURL or WGET on the same link? It is defenitely not a permission issue.

SwampDragons commented 3 years ago

This may be an issue with the golang tool we use to retrieve ISOs. We'll investigate before the next release. I'll let you know if we end up needing that link.

bolausson commented 3 years ago

Thanks!