hashicorp / hashicorp/nomad

docs: CLI expects even number of bytes in prefix search

Open
#11,619 2 comments 0 reactions 0 assignees View on GitHub
theme/cli theme/docs type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Nomad v1.1.3 (8c0c8140997329136971e66e4c2337dfcf932692)

### Operating system and Environment details
Linux

### Issue
Sometimes, when passing a prefix of an allocation ID to `nomad alloc status` or `nomad logs`, the prefix will be rejected with `Prefix matched multiple allocations`, even when the prefix uniquely identifies an allocation.

### Reproduction steps
1. Create multiple allocations (don't have to be from the same job, but need a common prefix), e.g.:
- `3d6519a4`
- `3d55aac6`
- `3db35960`
2. Run `nomad logs ` where `` is a valid prefix one character longer than the common prefix, e.g. `nomad logs 3db`

#### Expected Result
Nomad prints the logs from the uniquely identified allocation (`3db35960`)

#### Actual Result
```
$ nomad logs 3db
Prefix matched multiple allocations

ID Node ID Task Group Version Desired Status Created Modified
3d6519a4 a3ff1954 snapshot 2 run complete 3h26m ago 3h26m ago
3d55aac6 97c09966 myapp-service 1 run running 2d15h ago 2d15h ago
3db35960 20f9a784 myapp-service 1 run running 2d15h ago 2d15h ago
```

Possibly related behaviour is that a non-matching last character is also ignored:

```
$ nomad logs 3d65a
// logs from 3d6519a4 are printed here
```

### Job file (if appropriate)

### Nomad Server logs (if appropriate)

### Nomad Client logs (if appropriate)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.