Context
When upgrading LangSmith Helm chart to a newer version, users may encounter a pod crash error with the message Error parsing token err='token contains an invalid number of segments in the platform backend. This typically occurs when there are issues with the license key configuration or when the license key is incorrectly encoded.
Answer
If you encounter a token parsing error during LangSmith upgrade, follow these steps to resolve the issue:
Verify that your LangSmith license key is correctly formatted:
The license key should start with
lcl_.Ensure the license key is not base64 encoded.
Check your Helm values configuration file to ensure proper formatting:
config: langsmithLicenseKey: "lcl_your_license_key" apiKeySalt: "your_salt" authType: mixed basicAuth: enabled: true initialOrgAdminEmail: "your_email" initialOrgAdminPassword: "your_password" jwtSecret: "your_jwt_secret"Verify the Kubernetes secret contains the correct license key:
kubectl get secret langsmith-secrets -n langsmith -o yamlEnsure the 'langsmith_license_key' exists and is properly formatted.
If the issue persists after checking these configurations, you may need to:
Regenerate your JWT secret using instructions from our documentation.
Contact LangSmith support to verify your license key validity or request a new one
References
https://docs.langchain.com/langsmith/kubernetes#configure-your-helm-charts
https://docs.langchain.com/langsmith/kubernetes#prerequisites