aws-amplify / aws-amplify/amplify-cli

Golang `mock` tcp :8900: connect: connection refused

Open
#13,693 1 comment 0 reactions 0 assignees View on GitHub
bug functions mock p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

yarn

### If applicable, what version of Node.js are you using?

v18.19.0

### Amplify CLI Version

12.10.2

### What operating system are you using?

Mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

N/A

### Describe the bug

when running `amplify mock function --event src/event.json`, got error

> tcp :8900: connect: connection refused

### Expected behavior

when running `amplify mock function --event src/event.json`, lambda should work as expected.

### Reproduction steps

1. in a new folder, `yarn init -y`
2. `amplify init -y`
3. `amplify add function`, choose `go`.
4. run `amplify mock function --event src/event.json`, see the error.

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

### Before submitting, please confirm:

- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `amplify mock function --event src/event.json` with a newly initialized Go function, as described in the reproduction steps. Trace the mock function command's handling of the Go runtime and TCP connection on port 8900. Done means the command runs the Lambda successfully without the connection-refused error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, node.js, typescript
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.