googleapis / googleapis/nodejs-agentplatform
Cloud run container shutdown - Command failed with exit code 1
- 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.

```
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
Assessment
This issue has not been assessed yet.