"packer init" failed to download builder

Practice packer AMI images building, following tutorial at Build an Image | Packer - HashiCorp Learn, but it failed at 1st step ‘packer init .’

The error messages are:


Failed getting the “github.com/hashicorp/amazon” plugin:
1 error occurred:
* Get “https://api.github.com/repos/hashicorp/packer-plugin-amazon/git/matching-refs/tags”: stream error: stream ID 1; NO_ERROR

I’m running packer 1.7.8 on MacOS. Thanks,

I tried to curl the url ‘https://api.github.com/repos/hashicorp/packer-plugin-amazon/git/matching-refs/tags’ in the error messages,

It works fine.

$ curl https://api.github.com/repos/hashicorp/packer-plugin-amazon/git/matching-refs/tags
[
{
“ref”: “refs/tags/v0.0.1”,
“node_id”: “MDM6UmVmMzQ5NDc5ODE1OnJlZnMvdGFncy92MC4wLjE=”,
“url”: “https://api.github.com/repos/hashicorp/packer-plugin-amazon/git/refs/tags/v0.0.1”,
“object”: {
“sha”: “ff072d167737a09e6d4de9c8966cf10749153ba1”,
“type”: “commit”,
“url”: “https://api.github.com/repos/hashicorp/packer-plugin-amazon/git/commits/ff072d167737a09e6d4de9c8966cf10749153ba1
}
},