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

Content of pretty log format and unpretty log format isn't the same #10068

Open
d7oc opened this issue Sep 16, 2024 · 4 comments
Open

Content of pretty log format and unpretty log format isn't the same #10068

d7oc opened this issue Sep 16, 2024 · 4 comments
Labels

Comments

@d7oc
Copy link
Contributor

d7oc commented Sep 16, 2024

Describe the bug

By product definition the content of the log should be the same not matter if pretty log output is enabled or not. This isn't the case. Some field like the IP address are missing in pretty log output.

Steps to reproduce

  1. Enabled pretty log output
  2. Do some operation
  3. Look at the log output
  4. Disabled pretty log output
  5. Do some operation
  6. Compare the log output with the result before

Expected behavior

The log output should be the same, just the formatting should be different.

Actual behavior

The log output isn't the same. The IP address is missing

Pretty log:

proxy-6d4d85677f-59dwl proxy 2024-09-15T13:22:50Z ERR Could not get user by claim error="parsing time \"http://www.google.com/\" as \"2006-01-02T15:04:05Z07:00\": cannot parse \"http://www.google.com/\" as \"2006\"" authenticator=signed_url line=github.com/owncloud/ocis/v2/services/proxy/pkg/middleware/signed_url_auth.go:243 path=/remote.php/dav/spaces/xxx/index.html service=proxy url=/remote.php/dav/spaces/1da06874-da62-43a9-9b21-6c68e3c36865%242a035869-7f49-4ef5-b20e-4ea72970eb99/index.html?OC-Credential=xxx%40acc.myaccessid.org&OC-Date=http%3A%2F%2Fwww.google.com%2F&OC-Expires=1200&OC-Verb=GET&OC-Algo=PBKDF2%2F10000-SHA512&OC-Signature=xxx

Standard log:

proxy-86d79db66-gs6zc proxy {"level":"error","service":"proxy","error":"failed to verify access token: token is expired by 12m36.978976343s","authenticator":"oidc","path":"/ocs/v2.php/apps/notifications/api/v1/notifications/sse","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0","client.address":"92.117.244.5","network.peer.address":"","network.peer.port":"","time":"2024-09-16T13:09:17Z","line":"github.com/owncloud/ocis/v2/services/proxy/pkg/middleware/oidc_auth.go:194","message":"failed to authenticate the request"}

Setup

Kubernetes setup, but setup shouldn't matter.

@d7oc d7oc added the Type:Bug label Sep 16, 2024
@micbar
Copy link
Contributor

micbar commented Sep 16, 2024

hm, from a first glance, these are not identical error messages.

1 github.com/owncloud/ocis/v2/services/proxy/pkg/middleware/signed_url_auth.go:243
2 github.com/owncloud/ocis/v2/services/proxy/pkg/middleware/oidc_auth.go:194

@micbar
Copy link
Contributor

micbar commented Sep 16, 2024

NOTE, not all log entries have the same attributes.

@d7oc
Copy link
Contributor Author

d7oc commented Sep 16, 2024

But they should all contain the client IP address, right? Otherwise we can't detect the source.

@micbar
Copy link
Contributor

micbar commented Sep 16, 2024

No, they should not.

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

No branches or pull requests

2 participants