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

add troubleshooting section to variables doc #1417

Merged
merged 7 commits into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions content/spin/v3/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ url = "https://github.com/fermyon/developer/blob/main/content/spin/v3/variables.
---
- [Adding Variables to Your Applications](#adding-variables-to-your-applications)
- [Using Variables From Applications](#using-variables-from-applications)
- [Troubleshooting](#troubleshooting)

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.

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

Used an API
```

## Troubleshooting

**"No provider resolved" error**

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.

```console
Handler returned an error: Error::Provider("no provider resolved required variable \"YOUR_VARIABLE\"")
```

michelleN marked this conversation as resolved.
Show resolved Hide resolved
See [Dynamic Application Configuration](./dynamic-configuration#application-variables-runtime-configuration) for information on setting variable values via environment variables, or configuring secure variable providers.

**"No variable" error**

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.

```console
Handler returned an error: Error::Undefined("no variable for \"<component-id>\".\"your-variable\"")
```

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.
Loading