Skip to content

Commit e3410c3

Browse files
authored
Merge pull request #2918 from replicatedhq/87604
Add troubleshooting info for helm dependency update 401 errors
2 parents 72171b5 + b1c40b7 commit e3410c3

File tree

3 files changed

+41
-10
lines changed

3 files changed

+41
-10
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
(Recommended) Log out of the Replicated registry:
1+
If you see a 401 Unauthorized error after running `helm dependency update`, run the following command to remove credentials from the Replicated registry, then re-run `helm dependency update`:
22

3-
```bash
4-
helm registry logout registry.replicated.com
5-
```
3+
```bash
4+
helm registry logout registry.replicated.com
5+
```
66

7-
Replicated recommends that you log out of the Replicated registry to avoid errors that can occur when Helm attempts to pull the SDK chart from the registry if you are logged in with a license that has expired.
7+
For more information, see [401 Unauthorized Error When Updating Helm Dependencies](replicated-sdk-installing#401).

docs/vendor/helm-install-release.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ To package a Helm chart so that it can be added to a release:
2828

2929
<DependencyYaml/>
3030

31-
For additional guidelines related to adding the SDK as a dependency, see [Install the SDK as a Subchart](replicated-sdk-installing#install-the-sdk-as-a-subchart) in _Installing the Replicated SDK_.
32-
33-
1. <RegistryLogout/>
31+
For additional guidelines related to adding the SDK as a dependency, see [Install the SDK as a Subchart](replicated-sdk-installing#install-the-sdk-as-a-subchart) in _Installing the Replicated SDK_.
3432

3533
1. Update dependencies and package the chart as a `.tgz` file:
3634

3735
<HelmPackage/>
3836

37+
:::note
38+
<RegistryLogout/>
39+
:::
40+
3941
1. Add the `.tgz` file to a release. For more information, see [Managing Releases with the Vendor Portal](releases-creating-releases) or [Managing Releases with the CLI](releases-creating-cli).
4042

4143
After the release is promoted, your Helm chart is automatically pushed to the Replicated registry. For information about how to install a release with the Helm CLI, see [Installing with Helm](install-with-helm). For information about how to install Helm charts with KOTS, see [About Distributing Helm Charts with KOTS](/vendor/helm-native-about).

docs/vendor/replicated-sdk-installing.mdx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ To install the SDK as a subchart:
2525

2626
<DependencyYaml/>
2727

28-
1. <RegistryLogout/>
29-
3028
1. Update the `charts/` directory:
3129

3230
```
3331
helm dependency update
3432
```
33+
:::note
34+
<RegistryLogout/>
35+
:::
3536

3637
1. Package the Helm chart into a `.tgz` archive:
3738

@@ -151,3 +152,31 @@ To add the SDK Helm chart to a release for a Kubernetes manifest-based applicati
151152
## Install the SDK in Integration Mode
152153
153154
<IntegrationMode/>
155+
156+
## Troubleshoot
157+
158+
### 401 Unauthorized Error When Updating Helm Dependencies {#401}
159+
160+
#### Symptom
161+
162+
You see an error message similar to the following after adding the Replicated SDK as a dependency in your Helm chart then running `helm dependency update`:
163+
164+
```
165+
Error: could not download oci://registry.replicated.com/library/replicated-sdk: failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://registry.replicated.com/v2/token?scope=repository%3Alibrary%2Freplicated-sdk%3Apull&service=registry.replicated.com: 401 Unauthorized
166+
```
167+
168+
#### Cause
169+
170+
When you run `helm dependency update`, Helm attempts to pull the Replicated SDK chart from the Replicated registry. An error can occur if you are already logged in to the Replicated registry with a license that has expired, such as when testing application releases.
171+
172+
#### Solution
173+
174+
To solve this issue:
175+
176+
1. Run the following command to remove login credentials for the Replicated registry:
177+
178+
```
179+
helm registry logout registry.replicated.com
180+
```
181+
182+
1. Re-run `helm dependency update` for your Helm chart.

0 commit comments

Comments
 (0)