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

Return buffered text from log endpoint if decoding fails #15558

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

benbuzbee
Copy link
Contributor

To see why I think this is a good change lets look at why I am making it

My disk was full, which means GC was happening agressively. So by the time I called the logging endpoint from the SDK, the logs were GC'd

The error I was getting before was:

invalid character 'i' in literal false (expecting 'l')

Now the error I get is:

failed to decode log endpoint response as JSON: "failed to list entries: open /tmp/nomad.data.4219353875/alloc/f11fee50-2b66-a7a2-d3ec-8442cb3d557a/alloc/logs: no such file or directory"

Still not super descriptive but much more debugable

@vercel
Copy link

vercel bot commented Dec 15, 2022

@benbuzbee is attempting to deploy a commit to the HashiCorp Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @benbuzbee and thanks for raising this PR. I agree it makes the error much easier to understand.

CI is currently failing as the API Go module is missing the multi-error package dependency. If you have the time, could you update the module to include this? Additionally a changelog improvement entry would be great also.

To see why I think this is a good change lets look at why I am making it

My disk was full, which means GC was happening agressively. So by the
time I called the logging endpoint from the SDK, the logs were GC'd

The error I was getting before was:
```
invalid character 'i' in literal false (expecting 'l')
```

Now the error I get is:
```
failed to decode log endpoint response as JSON: "failed to list entries: open /tmp/nomad.data.4219353875/alloc/f11fee50-2b66-a7a2-d3ec-8442cb3d557a/alloc/logs: no such file or directory"
```

Still not super descriptive but much more debugable
@vercel
Copy link

vercel bot commented Jan 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
nomad-storybook-and-ui 🔄 Building (Inspect) Jan 6, 2023 at 6:31PM (UTC)

@benbuzbee
Copy link
Contributor Author

Thanks for looking @jrasell - I force pushed an update

Copy link
Member

@jrasell jrasell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @benbuzbee!

@jrasell jrasell added the backport/1.4.x backport to 1.4.x release line label Jan 16, 2023
@jrasell jrasell moved this from Needs Triage to In Progress in Nomad - Community Issues Triage Jan 16, 2023
@jrasell jrasell merged commit dc6b088 into hashicorp:main Jan 16, 2023
Nomad - Community Issues Triage automation moved this from In Progress to Done Jan 16, 2023
jrasell pushed a commit that referenced this pull request Jan 16, 2023
To see why I think this is a good change lets look at why I am making it

My disk was full, which means GC was happening agressively. So by the
time I called the logging endpoint from the SDK, the logs were GC'd

The error I was getting before was:
```
invalid character 'i' in literal false (expecting 'l')
```

Now the error I get is:
```
failed to decode log endpoint response as JSON: "failed to list entries: open /tmp/nomad.data.4219353875/alloc/f11fee50-2b66-a7a2-d3ec-8442cb3d557a/alloc/logs: no such file or directory"
```

Still not super descriptive but much more debugable
jrasell pushed a commit that referenced this pull request Jan 16, 2023
…5796)

To see why I think this is a good change lets look at why I am making it

My disk was full, which means GC was happening agressively. So by the
time I called the logging endpoint from the SDK, the logs were GC'd

The error I was getting before was:
```
invalid character 'i' in literal false (expecting 'l')
```

Now the error I get is:
```
failed to decode log endpoint response as JSON: "failed to list entries: open /tmp/nomad.data.4219353875/alloc/f11fee50-2b66-a7a2-d3ec-8442cb3d557a/alloc/logs: no such file or directory"
```

Still not super descriptive but much more debugable

Co-authored-by: Benjamin Buzbee <benbuzbee@users.noreply.github.com>
philrenaud pushed a commit that referenced this pull request Jan 23, 2023
To see why I think this is a good change lets look at why I am making it

My disk was full, which means GC was happening agressively. So by the
time I called the logging endpoint from the SDK, the logs were GC'd

The error I was getting before was:
```
invalid character 'i' in literal false (expecting 'l')
```

Now the error I get is:
```
failed to decode log endpoint response as JSON: "failed to list entries: open /tmp/nomad.data.4219353875/alloc/f11fee50-2b66-a7a2-d3ec-8442cb3d557a/alloc/logs: no such file or directory"
```

Still not super descriptive but much more debugable
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.4.x backport to 1.4.x release line
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants