Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nil pointer #46

Closed
dpengftw opened this issue May 14, 2024 · 3 comments
Closed

Nil pointer #46

dpengftw opened this issue May 14, 2024 · 3 comments

Comments

@dpengftw
Copy link

My guess is that the API calls are reaching a rate limit, therefore the code is running into nil pointer.

Solution would be to use a backoff function to call AWS api, if the first call fails.

`> ecsgo
? Select a task: panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102fdafac]

goroutine 18 [running]:
github.com/tedsmitt/ecsgo/internal.getPlatformFamily({0x103619a00, 0x1400011a100}, {0x1034115e0?, 0x140004ded80?}, 0x140004c8900)
github.com/tedsmitt/ecsgo/internal/internal.go:87 +0x8c
github.com/tedsmitt/ecsgo/internal.(*App).getContainerOS(0x140004016b0)
github.com/tedsmitt/ecsgo/internal/app.go:426 +0xa0
github.com/tedsmitt/ecsgo/internal.(*App).getTask(0x140004016b0)
github.com/tedsmitt/ecsgo/internal/app.go:366 +0xb8c
github.com/tedsmitt/ecsgo/internal.(*App).Start.func1()
github.com/tedsmitt/ecsgo/internal/app.go:70 +0x130
created by github.com/tedsmitt/ecsgo/internal.(*App).Start
github.com/tedsmitt/ecsgo/internal/app.go:60 +0x84`

@dpengftw
Copy link
Author

Forgot to mention that this is with ECS with EC2 backend.

tedsmitt added a commit that referenced this issue Oct 11, 2024
remove unused createSSMClient function
tedsmitt added a commit that referenced this issue Oct 11, 2024
…-sdk (#51)

* feat(aws-sdk): #46 add retry with backoff for aws clients

remove unused createSSMClient function

* feat(main): allow configuration via env vars prefixed with ECSGO_X

* chore: remove unused variables, fix lint errors

* tests: remove EC2Client from app_test.go
@tedsmitt
Copy link
Owner

@dpengftw can you try upgrading to the latest version and trying this again? A back off was added to the sdk v2 config - not had chance to test it yet though

@dpengftw
Copy link
Author

Ok, looks like that did the trick:

`

ecsgo --version
ecsgo version Version: 0.6.1, Commit: c29e18f, Built date: 2024-10-15T19:23:45Z, Built by: goreleaser

Starting session with SessionId: ecs-execute-command-9ybux6aajbhjarulxttbossnv8
sh-4.2# date
Sun Oct 20 01:26:03 UTC 2024
sh-4.2# exit`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants