Scrivio Interview library
DebuggingIntermediate6 min read · updated 12 November 2026

Production uses a value for payment.timeout that nobody can find in any file. How would you find where it comes from?

The quickest way is the Actuator env endpoint: GET /actuator/env/payment.timeout lists every property source that holds the key, in precedence order, and names the one that supplies the value. Spring Boot 3 masks values by default, so we enable show-values only for authorised users, if at all. The usual hiding places are environment variables (PAYMENT_TIMEOUT maps to payment.timeout through relaxed binding), system properties, mounted config trees and imported locations such as a config server.

Why this question is asked

A value that nobody can find in any file is a classic production mystery. Someone changed a timeout, the change seems to have no effect, or the service behaves differently from what the repository says. It matters because configuration that cannot be traced cannot be trusted, and because the hidden source often reveals a second problem, such as an old environment variable or a forgotten config server entry. Interviewers ask it to see whether we know how Spring Boot assembles configuration and whether we debug systematically. In this answer, we will recap why a value can come from outside files, use the env endpoint to find it, handle masking safely, go through the hiding places one by one, and look at relaxed binding, which explains most of these mysteries.

1Why a Value Can Come From Nowhere Visible

Spring Boot does not read configuration only from files. Its Environment combines many property sources: command line arguments, environment variables, Java system properties, files in the jar and outside it, directories mounted by Kubernetes, and anything imported with spring.config.import, such as a Spring Cloud Config server or Vault. Searching the repository only covers the files we wrote, which is a small part of that list.

There is one more place: a default in code. If the property is bound with @Value("${payment.timeout:30s}") or a field initialiser in a @ConfigurationProperties class, and no source supplies the key at all, the value comes from the code itself. That case shows up as the key missing from every property source, which is also useful information.

2Ask the Running Service With the env Endpoint

The Actuator env endpoint shows the Environment of the running application. Asking for one key returns the winning source and every other source that also contains it, in precedence order. Spring Boot 3 masks the values, but the source names and origins are shown, and that is usually all we need.

Properties
# application.yml (for the management port, not public)
management:
endpoints.web.exposure.include: health,env
# request, made through a port-forward to one pod
curl -s localhost:8081/actuator/env/payment.timeout | jq
# {
# "property": { "source": "systemEnvironment", "value": "******" },
# "propertySources": [
# { "name": "systemEnvironment",
# "property": { "value": "******",
# "origin": "System Environment Property \"PAYMENT_TIMEOUT\"" } },
# { "name": "Config resource 'class path resource [application.yml]' ...",
# "property": { "value": "******", "origin": "class path resource [application.yml] - 12:14" } }
# ]
# }
Step throughTracing one property in a running pod
EngineerPod (Actuator)Environment
GET /actuator/env/payment.timeout
find the key in every property source
systemEnvironment wins; application.yml also has it
source names and origins, values masked
check the pod spec for PAYMENT_TIMEOUT

5 messages in order. Play them, or step through them one at a time.

The endpoint answers where, even when the value itself stays masked.

Notice what this tells us. The winner is systemEnvironment, an environment variable called PAYMENT_TIMEOUT, and it overrides a value in application.yml at line 12. The exact shape of the JSON varies a little between versions, so check yours, but the source name and origin are always there. If the key is bound through @ConfigurationProperties, the configprops endpoint shows the bound object and the origin of each field as well.

3Showing Values Safely

Since Spring Boot 3.0, the env and configprops endpoints mask all values by default, because configuration often holds passwords and tokens. The setting management.endpoint.env.show-values accepts NEVER, ALWAYS and WHEN_AUTHORIZED. If we need values, WHEN_AUTHORIZED with a specific role is the only option we should consider in production, and only when the Actuator endpoints are already protected by Spring Security on a separate management port.

YAML
management:
server.port: 8081 # not exposed through the public ingress
endpoint:
env:
show-values: when-authorized
roles: OPS_CONFIG_READ # only users with this role see values

In most investigations we do not need the value at all; knowing which source wins tells us where to look, and we can read the value there with the right permissions. Turning on ALWAYS even briefly, on a service with secrets in its configuration, is the kind of shortcut that ends up in an incident report.

4Checking the Usual Hiding Places

If the Actuator is not available, or to confirm what it said, we check the sources in precedence order. Environment variables come first: kubectl describe pod or the deployment spec shows them, including those injected from a ConfigMap with envFrom, which do not appear by name in the deployment file. Java system properties are often hidden in JAVA_TOOL_OPTIONS or JAVA_OPTS set by a base image, so a -Dpayment.timeout=10s there beats any environment variable.

Next come mounted config trees. If the service has spring.config.import=configtree:/etc/config/, then a file called /etc/config/payment/timeout or /etc/config/payment.timeout becomes the property, and that file comes from a ConfigMap or Secret that may live in a different repository. Finally, imported locations: a config server import (spring.config.import=configserver:...) pulls properties from a Git repository the service team may never look at, and the env endpoint shows it with a name such as configserver:... followed by the file it came from.

Shell
kubectl exec deploy/payments -- printenv | grep -i timeout # PAYMENT_TIMEOUT=45s
kubectl exec deploy/payments -- sh -c 'echo $JAVA_TOOL_OPTIONS' # -XX:MaxRAMPercentage=75
kubectl exec deploy/payments -- ls -R /etc/config # payment/ timeout

5Relaxed Binding Explains Most Mysteries

The reason nobody found the value is often that they searched for the wrong spelling. Spring Boot's relaxed binding maps environment variables to property names: it lower-cases the name and turns underscores into dots, so PAYMENT_TIMEOUT becomes payment.timeout. A search for payment.timeout in the repository and in the deployment files will never match PAYMENT_TIMEOUT.

Properties
PAYMENT_TIMEOUT=45s # -> payment.timeout
PAYMENT_RETRY_MAXATTEMPTS=5 # -> payment.retry.maxattempts, which binds to payment.retry.max-attempts
PAYMENT_RETRY_MAX_ATTEMPTS=5 # -> payment.retry.max.attempts: a different, nested name that will not bind

So when we search, we search for both spellings, and for the key inside SPRING_APPLICATION_JSON values too. Once the source is found, the lasting fix is to remove the stray value or move it into the place the team agreed on, and to make origin checks part of the runbook so the next person finds it in minutes.

6Follow-up questions

What if the key appears in no property source at all?

Then the value comes from code: a default in @Value such as ${payment.timeout:30s}, a field initialiser in a @ConfigurationProperties class, or a value hard-coded in a client library. The configprops endpoint shows the bound object, and searching the code for the property name, in both relaxed forms, finds the default.

Can I log property origins at startup instead?

Yes. We can iterate over ConfigurableEnvironment.getPropertySources() at startup and log the name of the first source that contains a list of important keys, without logging the values. Some teams add this to their platform starter so every service prints where its key settings came from.

Why is the env endpoint risky?

Because it can reveal every secret the application holds if values are shown, and even masked output reveals infrastructure details. It should be on a management port not reachable from outside, protected by authentication, and exposed only where needed.

7Conclusion

In this answer, we saw that a value not found in any file comes from one of Spring Boot's other property sources or from a default in code. The Actuator env endpoint shows every source holding the key and which one wins, with values masked by default in Spring Boot 3, so show-values should stay off or be limited to authorised users. Environment variables, system properties in JAVA_TOOL_OPTIONS, mounted config trees and config server imports are the usual hiding places, and relaxed binding, which maps PAYMENT_TIMEOUT to payment.timeout, explains why searches often miss them.

What to say in the interviewAbout 80 seconds aloud

Open with

I would ask the running service instead of searching files. The Actuator env endpoint, for example GET /actuator/env/payment.timeout on the management port, lists every property source that contains the key in precedence order and shows which one supplies the value, along with an origin like System Environment Property PAYMENT_TIMEOUT or a file and line number.

Then, if they want more

In Spring Boot 3 the values are masked by default, which is fine, because the source name is what I need. If I really had to see values I would use show-values set to when-authorized with a dedicated role, on a protected management port, never always. If Actuator is not available, I go through the sources in precedence order.

I check the pod's environment variables, including ones injected from ConfigMaps with envFrom. I check system properties hidden in JAVA_TOOL_OPTIONS. I check mounted config trees under the configtree import paths, and any spring.config.import location such as a config server, which may pull the value from a Git repository the team never looks at.

I also search for the environment variable spelling, because relaxed binding maps PAYMENT_TIMEOUT to payment.timeout, and that is why searches for the dotted name miss it. If no source has the key, the value is a default in code.

About this answer

Last updated
12 November 2026
Versions it names
Spring Boot 3, Spring Boot 3.0
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Boot reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Production uses a value for payment.timeout that nobody can find in any file. How would...": https://scrivio-interview-library.netlify.app/spring-boot/externalized-configuration/0a13b666a6/