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

sdk-server expects SDK_LOG_LEVEL #3858

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

KAllan357
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:
I think I noticed a bug in my Agones sdk-server where I was constantly seeing the log line:

{"error":"not a valid logrus Level: \"\"","message":"Invalid LOG_LEVEL value. Defaulting to 'info'.","severity":"warning","time":"2024-06-05T13:53:37.5359166-04:00"}

I'm also seeing this in my local K8s cluster running Agones v1.40:

agones-gameserver-sidecar {"error":"not a valid logrus Level: \"\"","message":"Invalid LOG_LEVEL value. Defaulting to 'info'.","severity":"warning","time":"2024-06-05T18:08:05.006261795Z"}

There is a chance this is a bug introduced in #3631. The relevant code in the sdk-server binary is

https://github.com/googleforgames/agones/blob/main/cmd/sdk-server/main.go#L326

runtime.Must(viper.BindEnv("logLevel", "SDK_LOG_LEVEL"))

This PR simply adjusts the name Env Var attached to the Gameserver's Agones SDK Sidecar container.

Which issue(s) this PR fixes:

Closes #

Special notes for your reviewer:

Copy link

google-cla bot commented Jun 5, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added kind/bug These are bugs. size/XS labels Jun 5, 2024
@KAllan357
Copy link
Contributor Author

I just signed the CLA but I'm not seeing how to retrigger that.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 650b4a04-8b10-4a94-bd86-a1ed47bf8791

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Ooh! Good catch. I didn't see that in the PR!

Rather than change Env var settings from what they used to be (should be?), I'd suggest fixing:

runtime.Must(viper.BindEnv("logLevel", "SDK_LOG_LEVEL"))

And setup a proper logLevelFlag variable etc, and make the above line be:

runtime.Must(viper.BindEnv(logLevelFlag))

Then we fix the bug in the sdk-server rather than potentially force an env var change.

Also that default here:

viper.SetDefault("logLevel", string(gs.Spec.SdkServer.LogLevel))
-- that's no good. It should also be "info" 😄

@KAllan357
Copy link
Contributor Author

@markmandel Thanks for the feedback. I adjusted the PR as you described. Note that I also changed it from "logLevel" to log-level to get Viper to do its thing when the env var is LOG_LEVEL:

$ go run cmd/sdk-server/main.go
{"ctlConf":{"GameServerName":"","PodNamespace":"".....

$ LOG_LEVEL=HOWDY go run cmd/sdk-server/main.go
{"error":"not a valid logrus Level: \"HOWDY\"","message":"Invalid LOG_LEVEL value. Defaulting to 'info'.","severity":"warning","time":"2024-06-06T13:22:19.982728509-04:00"}
{"ctlConf":{"GameServerName":"","PodNamespace":"" .....

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: d7c19b02-40d8-42ff-a5e0-de7979746ad4

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3858/head:pr_3858 && git checkout pr_3858
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.42.0-dev-9cbf6d1-amd64

@markmandel
Copy link
Member

Thanks! Sounds good - will take a peek next week 👍🏻

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: e2117b2f-d5e6-4c20-ae6a-c494b8d45828

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3858/head:pr_3858 && git checkout pr_3858
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.42.0-dev-8827a56-amd64

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@markmandel markmandel merged commit 460306d into googleforgames:main Jun 11, 2024
4 checks passed
@Shavakan
Copy link

We also faced a similar issue recently and ended up in this PR.
@markmandel I hope I don't sound pushing, but could you kindly inform me when this fix will likely be released?

spiceratops referenced this pull request in spiceratops/k8s-gitops Jul 23, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [agones](https://agones.dev)
([source](https://togithub.com/googleforgames/agones)) | minor |
`1.41.0` -> `1.42.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>googleforgames/agones (agones)</summary>

###
[`v1.42.0`](https://togithub.com/googleforgames/agones/blob/HEAD/CHANGELOG.md#v1420-2024-07-16)

[Compare
Source](https://togithub.com/googleforgames/agones/compare/v1.41.0...v1.42.0)

[Full
Changelog](https://togithub.com/googleforgames/agones/compare/v1.41.0...v1.42.0)

**Breaking changes:**

- Update csharp.md to indicate ConnectAsync is deprecated by
[@&#8203;aallbrig](https://togithub.com/aallbrig) in
[https://github.com/googleforgames/agones/pull/3866](https://togithub.com/googleforgames/agones/pull/3866)

**Implemented enhancements:**

- Add security context to Agones containers by
[@&#8203;peterzhongyi](https://togithub.com/peterzhongyi) in
[https://github.com/googleforgames/agones/pull/3856](https://togithub.com/googleforgames/agones/pull/3856)
- Add Security Context to game server sidecar by
[@&#8203;peterzhongyi](https://togithub.com/peterzhongyi) in
[https://github.com/googleforgames/agones/pull/3869](https://togithub.com/googleforgames/agones/pull/3869)
- Drop CountsAndLists Data from the Fleet and Game Server Set When the
Flag is False by [@&#8203;igooch](https://togithub.com/igooch) in
[https://github.com/googleforgames/agones/pull/3881](https://togithub.com/googleforgames/agones/pull/3881)
- Adds tests to confirm that Fleet, Fleet Autoscaler, and Fleet
Allocation apply defaults code is idempotent by
[@&#8203;igooch](https://togithub.com/igooch) in
[https://github.com/googleforgames/agones/pull/3888](https://togithub.com/googleforgames/agones/pull/3888)
- feat: Add CRD Changes and Feature Flag for chain policy by
[@&#8203;indexjoseph](https://togithub.com/indexjoseph) in
[https://github.com/googleforgames/agones/pull/3880](https://togithub.com/googleforgames/agones/pull/3880)

**Fixed bugs:**

- sdk-server expects SDK_LOG_LEVEL by
[@&#8203;KAllan357](https://togithub.com/KAllan357) in
[https://github.com/googleforgames/agones/pull/3858](https://togithub.com/googleforgames/agones/pull/3858)
- this will resolve From/layer extraction issue on ltsc2019 in examples
by [@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3873](https://togithub.com/googleforgames/agones/pull/3873)
- featuregate: adds validation if PortPolicyNone is not enabled by
[@&#8203;daniellee](https://togithub.com/daniellee) in
[https://github.com/googleforgames/agones/pull/3871](https://togithub.com/googleforgames/agones/pull/3871)
- added local as default for registry when registry is not specified by
[@&#8203;kamaljeeti](https://togithub.com/kamaljeeti) in
[https://github.com/googleforgames/agones/pull/3876](https://togithub.com/googleforgames/agones/pull/3876)
- Buffer Unity SDK ReceiveData when watching for configuration changes
by [@&#8203;ZeroParticle](https://togithub.com/ZeroParticle) in
[https://github.com/googleforgames/agones/pull/3872](https://togithub.com/googleforgames/agones/pull/3872)
- agones-{extensions,allocator}: Make servers context aware by
[@&#8203;zmerlynn](https://togithub.com/zmerlynn) in
[https://github.com/googleforgames/agones/pull/3845](https://togithub.com/googleforgames/agones/pull/3845)
- added condition for distributed logic by
[@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3877](https://togithub.com/googleforgames/agones/pull/3877)

**Security fixes:**

- Bump [@&#8203;grpc/grpc-js](https://togithub.com/grpc/grpc-js) from
1.10.7 to 1.10.9 in /sdks/nodejs by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/googleforgames/agones/pull/3863](https://togithub.com/googleforgames/agones/pull/3863)

**Other:**

- Preparation for Release v1.42.0 by
[@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3854](https://togithub.com/googleforgames/agones/pull/3854)
- Add helpful note to edit-first-gameserver-go by
[@&#8203;peterzhongyi](https://togithub.com/peterzhongyi) in
[https://github.com/googleforgames/agones/pull/3846](https://togithub.com/googleforgames/agones/pull/3846)
- Moved Passthrough feature description to the correct section in
Feature Stages by [@&#8203;vicentefb](https://togithub.com/vicentefb) in
[https://github.com/googleforgames/agones/pull/3861](https://togithub.com/googleforgames/agones/pull/3861)
- Updated Node.js Page to Reflect that Counters and Lists is Implemented
by [@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3865](https://togithub.com/googleforgames/agones/pull/3865)
- Change Slack channel description from #developers to #development by
[@&#8203;branhoff](https://togithub.com/branhoff) in
[https://github.com/googleforgames/agones/pull/3868](https://togithub.com/googleforgames/agones/pull/3868)
- updated UpdateList documentation for local sdk server and sdk server
by [@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3878](https://togithub.com/googleforgames/agones/pull/3878)
- Add zio-agones to the list of third party client SDKs by
[@&#8203;ghostdogpr](https://togithub.com/ghostdogpr) in
[https://github.com/googleforgames/agones/pull/3875](https://togithub.com/googleforgames/agones/pull/3875)
- refactor simple game server by
[@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3817](https://togithub.com/googleforgames/agones/pull/3817)
- Update Slack invite link by
[@&#8203;markmandel](https://togithub.com/markmandel) in
[https://github.com/googleforgames/agones/pull/3896](https://togithub.com/googleforgames/agones/pull/3896)
- Added cleanup for app-engine services in cloudbuild script by
[@&#8203;kamaljeeti](https://togithub.com/kamaljeeti) in
[https://github.com/googleforgames/agones/pull/3890](https://togithub.com/googleforgames/agones/pull/3890)
- Adds a command to generate the zz_generated.deepcopy.go files for the
apis by [@&#8203;igooch](https://togithub.com/igooch) in
[https://github.com/googleforgames/agones/pull/3900](https://togithub.com/googleforgames/agones/pull/3900)
- update go version to 1.21.12 by
[@&#8203;ashutosji](https://togithub.com/ashutosji) in
[https://github.com/googleforgames/agones/pull/3894](https://togithub.com/googleforgames/agones/pull/3894)

**New Contributors:**

- [@&#8203;KAllan357](https://togithub.com/KAllan357) made their first
contribution in
[https://github.com/googleforgames/agones/pull/3858](https://togithub.com/googleforgames/agones/pull/3858)
- [@&#8203;branhoff](https://togithub.com/branhoff) made their first
contribution in
[https://github.com/googleforgames/agones/pull/3868](https://togithub.com/googleforgames/agones/pull/3868)
- [@&#8203;aallbrig](https://togithub.com/aallbrig) made their first
contribution in
[https://github.com/googleforgames/agones/pull/3866](https://togithub.com/googleforgames/agones/pull/3866)
- [@&#8203;ZeroParticle](https://togithub.com/ZeroParticle) made their
first contribution in
[https://github.com/googleforgames/agones/pull/3872](https://togithub.com/googleforgames/agones/pull/3872)
- [@&#8203;ghostdogpr](https://togithub.com/ghostdogpr) made their first
contribution in
[https://github.com/googleforgames/agones/pull/3875](https://togithub.com/googleforgames/agones/pull/3875)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzIuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzMi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9oZWxtIiwidHlwZS9taW5vciJdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug These are bugs. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants