redhat-developer / mapt

Multi Architecture Provisioning Tool
Apache License 2.0
9 stars 7 forks source link

"Send on closed channel" panic when trying to create a dedicated M2 host on aws #174

Closed jsliacan closed 10 months ago

jsliacan commented 10 months ago

When creating a dedicated M2 host with the script (see bottom of he issue), one gets the following panic:

$ ~/Downloads/mac/01_create-dedicatedhost.sh
690ba34fade920c9814a7768ace80dc0ad0a8c9ce275e46f15931e62cc925e9b
{"level":"debug","msg":"Running 'qenvs aws mac create'","time":"2023-12-06T11:32:27Z"}
{"level":"debug","msg":"context initialized for qenvs9ae01560","time":"2023-12-06T11:32:27Z"}
{"level":"debug","msg":"checking if m2 is offered at us-east-1","time":"2023-12-06T11:32:27Z"}
{"level":"debug","msg":"creating dedicated host for mac machine m2","time":"2023-12-06T11:32:29Z"}
{"level":"debug","msg":"Creating stack stackDedicatedHost-macmini","time":"2023-12-06T11:32:29Z"}
panic: send on closed channel

goroutine 85 [running]:
github.com/adrianriobo/qenvs/pkg/provider/aws/data.LokupRegionOfferingInstanceType.func1(0xc0004284e0)
    /workspace/pkg/provider/aws/data/instance-type.go:57 +0xd8
created by github.com/adrianriobo/qenvs/pkg/provider/aws/data.LokupRegionOfferingInstanceType
    /workspace/pkg/provider/aws/data/instance-type.go:53 +0x33e

The script 01_create-dedicatedhost.sh:

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
TARGET_REGION=us-east-1

podman run -d --name create-macmini --rm \
            -v ${PWD}:/workspace:z \
            -e AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
            -e AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
            -e AWS_DEFAULT_REGION=${TARGET_REGION} \
            quay.io/rhqp/qenvs:v0.6.0 aws mac create \
                --project-name macmini \
                --backed-url s3://crcqe-tstenvs-tfstate/local/jsliacan/mac \
                --conn-details-output /workspace \
                --tags project=openshift-local,source=local,org=jsliacan \
                --only-host

# Check logs 
podman logs -f create-macmini