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

cache / external_cache configuration not being applied #3175

Closed
bevenio opened this issue Oct 3, 2023 · 2 comments
Closed

cache / external_cache configuration not being applied #3175

bevenio opened this issue Oct 3, 2023 · 2 comments

Comments

@bevenio
Copy link

bevenio commented Oct 3, 2023

Hey 👋

Whenever i try to configure both the cache service (host/scheme/query) and the external cache (host/scheme/path) in either the pbs.yaml or by setting env variables during startup of the server neither of those are set. Also there is no error appearing, telling me what is misconfigured. When it is just the cache config (without external cache) everything works.

Commit: 1360786

pbs.yaml example:

cache:
  host: some-service.some-namespace.svc
  scheme: http
external_cache:
  host: some-external-url.com
  scheme: https
  path: /cache

The logs during startup look something like this, basically empty:

I1003 08:09:02.308627       7 structlog.go:42]   	cache.scheme: 
I1003 08:09:02.308635       7 structlog.go:42]   	cache.host: 
I1003 08:09:02.308708       7 structlog.go:42]   	cache.query: 
I1003 08:09:02.308716       7 structlog.go:33]   	cache.expected_millis: 10
I1003 08:09:02.308722       7 structlog.go:33]   	cache.default_ttl_seconds.banner: 0
I1003 08:09:02.308726       7 structlog.go:33]   	cache.default_ttl_seconds.video: 0
I1003 08:09:02.308730       7 structlog.go:33]   	cache.default_ttl_seconds.native: 0
I1003 08:09:02.308734       7 structlog.go:33]   	cache.default_ttl_seconds.audio: 0
I1003 08:09:02.308742       7 structlog.go:42]   	external_cache.scheme: 
I1003 08:09:02.308753       7 structlog.go:42]   	external_cache.host: 
I1003 08:09:02.308761       7 structlog.go:42]   	external_cache.path: 

Is this a bug or intentional behaviour? Unfortunately i did not find anything about this in the docs.

Additional information:
When i overwrite the config defaults in the config/config.go file, everything works as expected.

@SyntaxNode
Copy link
Contributor

SyntaxNode commented Oct 3, 2023

That's strange behavior. I can't reproduce the issue on the master branch head.

I used the following pbs.yaml:

cache:
  host: some-service.some-namespace.svc
  scheme: http
external_cache:
  host: some-external-url.com
  scheme: https
  path: /cache

and receive the following logs at startup:

I1003 09:48:52.418286   44381 structlog.go:42]   	cache.scheme: http
I1003 09:48:52.418291   44381 structlog.go:42]   	cache.host: some-service.some-namespace.svc
I1003 09:48:52.418296   44381 structlog.go:42]   	cache.query: 
I1003 09:48:52.418301   44381 structlog.go:33]   	cache.expected_millis: 10
I1003 09:48:52.418308   44381 structlog.go:33]   	cache.default_ttl_seconds.banner: 0
I1003 09:48:52.418313   44381 structlog.go:33]   	cache.default_ttl_seconds.video: 0
I1003 09:48:52.418318   44381 structlog.go:33]   	cache.default_ttl_seconds.native: 0
I1003 09:48:52.418323   44381 structlog.go:33]   	cache.default_ttl_seconds.audio: 0
I1003 09:48:52.418331   44381 structlog.go:42]   	external_cache.scheme: https
I1003 09:48:52.418336   44381 structlog.go:42]   	external_cache.host: some-external-url.com
I1003 09:48:52.418342   44381 structlog.go:42]   	external_cache.path: /cache

I verified with the debugger that the proper configuration is applied.

YAML files are white space sensitive. Perhaps you have subtle issue in the whitespace formatting? Or perhaps there is an issue in a surrounding config section which is confusing the parser?

@SyntaxNode SyntaxNode moved this from Triage to Research in Prebid Server Prioritization Oct 3, 2023
@bevenio
Copy link
Author

bevenio commented Oct 4, 2023

I see, it actually was a whitespace problem.. thank you.
So it is expected behaviour to parse as much as possible and ignoring everything that does not respect the yaml format?

@bevenio bevenio closed this as completed Oct 4, 2023
@github-project-automation github-project-automation bot moved this from Research to Done in Prebid Server Prioritization Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants