Skip to content

fix: use encoded service key to avoid railway parse problem#664

Merged
rsproule merged 1 commit intomasterfrom
rfs/fix-vertex-key
Nov 4, 2025
Merged

fix: use encoded service key to avoid railway parse problem#664
rsproule merged 1 commit intomasterfrom
rfs/fix-vertex-key

Conversation

@rsproule
Copy link
Contributor

@rsproule rsproule commented Nov 4, 2025

No description provided.

@vercel
Copy link
Contributor

vercel bot commented Nov 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
assistant-ui-template Ready Ready Preview Comment Nov 4, 2025 6:52pm
echo-control Ready Ready Preview Comment Nov 4, 2025 6:52pm
echo-next-boilerplate Ready Ready Preview Comment Nov 4, 2025 6:52pm
echo-next-image Ready Ready Preview Comment Nov 4, 2025 6:52pm
echo-next-sdk-example Ready Ready Preview Comment Nov 4, 2025 6:52pm
echo-video-template Ready Ready Preview Comment Nov 4, 2025 6:52pm
echo-vite-sdk-example Ready Ready Preview Comment Nov 4, 2025 6:52pm
next-chat-template Ready Ready Preview Comment Nov 4, 2025 6:52pm
react-boilerplate Ready Ready Preview Comment Nov 4, 2025 6:52pm
react-chat Ready Ready Preview Comment Nov 4, 2025 6:52pm
react-image Ready Ready Preview Comment Nov 4, 2025 6:52pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
component-registry Skipped Skipped Nov 4, 2025 6:52pm

@vercel vercel bot temporarily deployed to Preview – component-registry November 4, 2025 18:48 Inactive
@railway-app
Copy link

railway-app bot commented Nov 4, 2025

🚅 Deployed to the echo-pr-664 environment in echo

Service Status Web Updated (UTC)
echo ◻️ Removed (View Logs) Web Nov 4, 2025 at 7:16 pm

Comment on lines +476 to +478
// decode from base64
const serviceAccountKey = Buffer.from(
serviceAccountKeyEncoded!,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// decode from base64
const serviceAccountKey = Buffer.from(
serviceAccountKeyEncoded!,
if (!serviceAccountKeyEncoded) {
return null;
}
// decode from base64
const serviceAccountKey = Buffer.from(
serviceAccountKeyEncoded,

The code uses a non-null assertion operator (!) on serviceAccountKeyEncoded without checking if it's defined first, which will cause a runtime TypeError if the environment variable is not set.

View Details

Analysis

TypeError in VertexAIProvider.getServiceAccountCredentials() when GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED is undefined

What fails: VertexAIProvider.getServiceAccountCredentials() throws TypeError when environment variable GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED is not set

How to reproduce:

# Ensure environment variable is not set
unset GOOGLE_SERVICE_ACCOUNT_KEY_ENCODED
# Call any method that uses Vertex AI authentication (getAccessToken, initializeStorage)

Result: TypeError: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined"

Expected: Method should return null when credentials are unavailable, consistent with initializeStorage() method which checks if (!credentials) and returns null per lines 280-283 in packages/app/server/src/providers/VertexAIProvider.ts

@rsproule rsproule merged commit f4384b6 into master Nov 4, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant