googleapis / googleapis/nodejs-agentplatform

Cloud run container shutdown - Command failed with exit code 1

Open
#493 1 comment 0 reactions 0 assignees View on GitHub
api: aiplatform api: run priority: p2 type: bug
Dominant language
TypeScript
Stars
182
Forks
69
Avg merge
1d 8h
Merged PRs (30d)
10

Description

Hello,

I have a container shutdown when using generateContent() command in cloud run.

![Image](https://github.com/user-attachments/assets/a2b96790-012c-4d48-ac38-99c60456aeb5)

```
constructor() {
const vertexai = new VertexAI({
project: my-project-name,
location: 'europe-west9',
});

this.llmModel = vertexai.getGenerativeModel({
model: 'gemini-1.5-flash-001',
});
}

generateContent(prompt: string) {
try {
const response = await this.llmModel.generateContent({
contents: [{ role: 'user', parts: [{ text: prompt }] }],
generationConfig: {
temperature: 0.0,
topK: 1,
topP: 1,
maxOutputTokens: 8192,
}
});
return response;
} catch (error) {
console.log(error);
return {};
}
}
```

#### Environment details

- Programming language: NodeJS
- Docker : node:20-alpine
- Package version: 1.9.2

Cloud run is running on europe-west9. Cloud run service account has aiplatform.endpoints.predict permission, it's connected to a vpc network with a NAT and static external IP. Vertex AI APIs are enabled.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.