Unable to reach LocalStack when running it with colima

LocalStack colima could not connect to LocalStack health endpoint

3 min read | by Jordi Prats

If we try to run localstack using colima we might face the following error:

$ localstack status services
 ERROR: could not connect to LocalStack health endpoint at http://localhost:4566

Because enabling a reachable IP address would have an impact on the startup time, by default colima doesn't expose any IP address. To fix it we just need to add the --network-address to the colima start command:

$ colima stop
INFO[0000] stopping colima
INFO[0000] stopping ...                                  context=docker
INFO[0012] stopping ...                                  context=vm
INFO[0016] done
$ colima start --network-address
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] dependencies missing for setting up reachable IP address  context=vm
INFO[0000] sudo password may be required                 context=vm
INFO[0003] starting ...                                  context=vm
INFO[0037] provisioning ...                              context=docker
INFO[0037] starting ...                                  context=docker
INFO[0042] done

Or use the --edit flag to update the option to true:

$ colima start -e

Once enabled, if we run again the localstack status services, we'll be able to reach LocalStack:

$ localstack status services
┏━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Service                   Status      ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ acm                        available │
│ apigateway                 available │
│ cloudformation             available │
│ cloudwatch                 available │
│ config                     available │
│ dynamodb                   available │
│ dynamodbstreams            available │
│ ec2                        available │
│ es                         available │
│ events                     available │
│ firehose                   available │
│ iam                        available │
│ kinesis                    available │
│ kms                        available │
│ lambda                     available │
│ logs                       available │
│ opensearch                 available │
│ redshift                   available │
│ resource-groups            available │
│ resourcegroupstaggingapi   available │
│ route53                    available │
│ route53resolver            available │
│ s3                         available │
│ s3control                  available │
│ secretsmanager             available │
│ ses                        available │
│ sns                        available │
│ sqs                        available │
│ ssm                        available │
│ stepfunctions              available │
│ sts                        available │
│ support                    available │
│ swf                        available │
│ transcribe                 available │
└──────────────────────────┴─────────────┘

Posted on 20/02/2023

Categories