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

API: EOF error when calling Nodes().gcAlloc() #5994

Closed
jrasell opened this issue Jul 23, 2019 · 2 comments
Closed

API: EOF error when calling Nodes().gcAlloc() #5994

jrasell opened this issue Jul 23, 2019 · 2 comments
Labels
theme/api HTTP API and SDK issues theme/cli type/bug

Comments

@jrasell
Copy link
Member

jrasell commented Jul 23, 2019

Nomad version v0.9.3 running locally (OSX) in dev mode.

To reproduce you can run Nomad locally in dev mode; run an example job and then stop the job . Once stopped the following code snippet can be used to observe the bug:

package main

import (
	"fmt"

	"github.com/hashicorp/nomad/api"
)

func main() {
	nomadClient, _ := api.NewClient(api.DefaultConfig())
	allocs, _, _ := nomadClient.Allocations().List(nil)
	fmt.Println(nomadClient.Nodes().GcAlloc(allocs[0].ID, nil))
}

The output:

EOF

The nomad server indicates a successful call:

2019-07-23T17:09:32.079+0200 [DEBUG] client.gc: alloc garbage collected: alloc_id=15935192-1b82-4d8e-1224-414010954153
2019-07-23T17:09:32.079+0200 [DEBUG] http: request complete: method=GET path=/v1/client/allocation/15935192-1b82-4d8e-1224-414010954153/gc duration=199.500448ms

Related to #5506 and #5970

@preetapan
Copy link
Contributor

Thanks @jrasell - looking at this and #5970 we may need to add empty struct handling to a number of places in the API in a more standard way..

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/api HTTP API and SDK issues theme/cli type/bug
Projects
None yet
Development

No branches or pull requests

3 participants