Skip to content

Commit e36b3e6

Browse files
authored
Merge pull request #1417 from michelleN/variables
add troubleshooting section to variables doc
2 parents 7d34a6b + 65392b8 commit e36b3e6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

content/spin/v3/variables.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ url = "https://github.com/fermyon/developer/blob/main/content/spin/v3/variables.
88
---
99
- [Adding Variables to Your Applications](#adding-variables-to-your-applications)
1010
- [Using Variables From Applications](#using-variables-from-applications)
11+
- [Troubleshooting](#troubleshooting)
1112

1213
Spin supports dynamic application variables. Instead of being static, their values can be updated without modifying the application, creating a simpler experience for rotating secrets, updating API endpoints, and more.
1314

@@ -266,3 +267,25 @@ date: Wed, 31 Jul 2024 22:03:35 GMT
266267

267268
Used an API
268269
```
270+
271+
## Troubleshooting
272+
273+
**"No provider resolved" error**
274+
275+
If you run into the following error, you've most likely not set the variable, either through the environment variable provider using the `SPIN_VARIABLE_` prefix or through another provider.
276+
277+
```console
278+
Handler returned an error: Error::Provider("no provider resolved required variable \"YOUR_VARIABLE\"")
279+
```
280+
281+
See [Dynamic Application Configuration](./dynamic-configuration#application-variables-runtime-configuration) for information on setting variable values via environment variables, or configuring secure variable providers.
282+
283+
**"No variable" error**
284+
285+
If you run into the following error, you've most likely not configured the component section in the `spin.toml` to have access to the variable specified.
286+
287+
```console
288+
Handler returned an error: Error::Undefined("no variable for \"<component-id>\".\"your-variable\"")
289+
```
290+
291+
To fix this, edit the `spin.toml` and add to the `[component.<component-id>.variables]` table a line such as `<your-variable> = "{{ app-variable }}".` See [above](https://developer.fermyon.com/spin/v3/variables#adding-variables-to-your-applications) for more information.

0 commit comments

Comments
 (0)